]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/filter/validator/class_PasswordValidatorFilter.php
A lot rewrites and fixes for weak redirect methods
[shipsimu.git] / inc / classes / main / filter / validator / class_PasswordValidatorFilter.php
index 21d0941ee982b44e40af4d23a9f977eb6dfa2af2..2591f1ea78efc2a4af1a0e65c452dcbeb9b11118 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -22,7 +22,7 @@
  * 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 PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class PasswordValidatorFilter extends BaseFilter implements Filterable {
        /**
         * Protected constructor
         *
@@ -31,27 +31,21 @@ class PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set part description
-               $this->setObjectDescription("A filter for Password validation");
-
-               // Create unique ID number
-               $this->createUniqueID();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance         An instance of this filter class
+        * @param       $controllerInstance             An instance of a Controller class
+        * @return      $filterInstance                 An instance of this filter class
         */
-       public final static function createPasswordValidatorFilter () {
+       public final static function createPasswordValidatorFilter (Controller $controllerInstance) {
                // Get a new instance
                $filterInstance = new PasswordValidatorFilter();
 
+               // Set the controller
+               $filterInstance->setControllerInstance($controllerInstance);
+
                // Return the instance
                return $filterInstance;
        }
@@ -85,13 +79,13 @@ class PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable
                        // Is the password empty?
                        if (empty($password1)) {
                                // Add a message to the response
-                               $responseInstance->addFatalMessage('password1_empty');
+                               $responseInstance->addFatalMessage('pass1_empty');
                        } // END - if
 
                        // Is the confirmation empty?
                        if (empty($password2)) {
                                // Add a message to the response
-                               $responseInstance->addFatalMessage('password2_empty');
+                               $responseInstance->addFatalMessage('pass2_empty');
                        } // END - if
 
                        // Abort here
@@ -101,7 +95,7 @@ class PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable
                        $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
-                       $responseInstance->addFatalMessage('passwords_mismatching');
+                       $responseInstance->addFatalMessage('pass_mismatch');
 
                        // Abort here
                        return false;