[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/data/validator/ -> passwordvalidator.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/data/validator/validator.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/data/validator/rules/nonemptyrule.class.php" );
   6      lt_include( PLOG_CLASS_PATH."class/data/validator/rules/stringrangerule.class.php" );    
   7  
   8      define( "MIN_PASSWORD_LENGTH_DEFAULT", 6 );
   9  
  10      define( "ERROR_PASSWORD_TOO_SHORT", 1 );
  11      define( "ERROR_PASSWORD_EMPTY", 2 );
  12  
  13      /**
  14       * \ingroup Validator
  15       *
  16       * Validates passwords according to certain rules:
  17       *
  18       * - passwords should not be empty
  19       * - password should have a length between minimun_password_length (if not available, defaults to '6') and a maximum length of 32
  20       *
  21       * @see NonEmptyRule
  22       * @see RangeRule
  23       */
  24      class PasswordValidator extends Validator 
  25      {
  26      	function PasswordValidator()
  27          {
  28              $this->Validator();
  29              $config =& Config::getConfig();
  30              
  31              $this->addRule( new NonEmptyRule());
  32              $this->addRule( new StringRangeRule( $config->getValue( "minimum_password_length", MIN_PASSWORD_LENGTH_DEFAULT ), 32 ));
  33          }
  34      }
  35  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics