*
* @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
*
* 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
*
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;
}
// 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
$requestInstance->requestIsValid(false);
// Add a message to the response
- $responseInstance->addFatalMessage('passwords_mismatching');
+ $responseInstance->addFatalMessage('pass_mismatch');
// Abort here
return false;