* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
+class RulesAcceptedFilter extends BaseFilter implements Filterable {
/**
- * Private constructor
+ * Protected constructor
*
* @return void
*/
$this->setObjectDescription("A filter for checking if rules where accepted");
// Create unique ID number
- $this->createUniqueID();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
+ $this->generateUniqueId();
}
/**
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Implement this!
- $this->partialStub("Please implement this method.");
+ // Get the "rules" value from request
+ $rules = $requestInstance->getRequestElement('rules');
+
+ // Was the "rules" value found in form? And is it set?
+ if (is_null($rules)) {
+ // Not found in form so stop processing here
+ $requestInstance->requestIsValid(false);
+
+ // Add a message to the response
+ $responseInstance->addFatalMessage('rules_unchecked');
+
+ // Skip further processing
+ return false;
+ }
}
}