[ 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/ -> domainvalidator.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/data/validator/rules/nonemptyrule.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/data/validator/rules/filteredwordsrule.class.php" );
   6      
   7      /**
   8       * \ingroup Validator
   9       *
  10       * Checks if a domain is valid. Domains have to comply with the following rules:
  11       *
  12       * - They must not be empty
  13       * - They must not be any of the forbidden usernames. Forbidden domains
  14       *   (and usernames) can be configured via the 'forbidden_usernames'
  15       *   configuration parameter.
  16       *
  17       * @see NonEmptyRule
  18       * @see FilteredWordsRule
  19       */
  20      class DomainValidator extends Validator 
  21      {
  22      	function DomainValidator()
  23          {
  24              $this->Validator();
  25              $this->addRule( new NonEmptyRule());
  26              $config =& Config::getConfig();
  27              $forbiddenDomainNames = $config->getValue( "forbidden_usernames", "" );
  28              $forbiddenDomainNamesArray = explode( " ", $forbiddenDomainNames );
  29              $this->addRule( new FilteredWordsRule( $forbiddenDomainNamesArray ));
  30          }
  31      }
  32  ?>


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