]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php
Login and auth classes added. WARNING: All class config entries must end with _class!
[shipsimu.git] / inc / classes / main / filter / checkboxes / class_RulesAcceptedFilter.php
index e10c7c9084e0a0063409069210641f55d19d0bff..d52c6aa6ac639c9e1eedd85dd8817c22be3bf698 100644 (file)
@@ -23,9 +23,9 @@
  * 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
         */
@@ -37,11 +37,7 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
                $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();
        }
 
        /**
@@ -65,8 +61,20 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
         * @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;
+               }
        }
 }