class_PasswordVerifierFilter.php

Go to the documentation of this file.
00001 <?php
00025 class PasswordVerifierFilter extends BaseFilter implements Filterable {
00031         protected function __construct () {
00032                 // Call parent constructor
00033                 parent::__construct(__CLASS__);
00034         }
00035 
00041         public final static function createPasswordVerifierFilter () {
00042                 // Get a new instance
00043                 $filterInstance = new PasswordVerifierFilter();
00044 
00045                 // Return the instance
00046                 return $filterInstance;
00047         }
00048 
00056         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
00057                 // Get password
00058                 $password = $requestInstance->getRequestElement('pass');
00059 
00060                 // Is the password still not set?
00061                 if (is_null($password)) {
00062                         // Not found in form so stop the filtering process
00063                         $requestInstance->requestIsValid(false);
00064 
00065                         // Add a message to the response
00066                         $responseInstance->addFatalMessage('password_unset');
00067 
00068                         // Abort here
00069                         return false;
00070                 } elseif (empty($password)) {
00071                         // Password is empty
00072                         $requestInstance->requestIsValid(false);
00073 
00074                         // Add a message to the response
00075                         $responseInstance->addFatalMessage('password_empty');
00076 
00077                         // Abort here
00078                         return false;
00079                 }
00080         }
00081 }
00082 
00083 // [EOF]
00084 ?>

Generated on Mon Dec 8 01:06:45 2008 for Ship-Simulator by  doxygen 1.5.6