tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Source for file form_field_password.class.php

Documentation is available at form_field_password.class.php

  1. <?php
  2. // *** Tangra (Application Framework and Tools for PHP)
  3. //  $Id$
  4. //
  5.  
  6. /**
  7.  * Contains class Form_Field_Password
  8.  *
  9.  * @package tangra_lib
  10.  * @subpackage form
  11.  */
  12.  
  13. /**
  14.  *
  15.  */
  16. require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text.class.php');
  17.  
  18.  
  19. /**
  20.  * Represents password field
  21.  *
  22.  * @package tangra_lib
  23.  * @subpackage form
  24.  */
  25.     /**
  26.      * Constructor
  27.      *
  28.      * @param string $name Name of the field
  29.      * @param boolean $required Is field required. Default is false
  30.      * @param integer $maxlength Maximum length of the text. Default is 100
  31.      * @param string $value Default value.
  32.      */
  33.     function __construct($name$required false$maxlength 100$value NULL{
  34.         parent::__construct($name$required$maxlength$value);
  35.  
  36.         $this->add_potential_error('password_asterisk_used');
  37.     }
  38.  
  39.  
  40.     /**
  41.      * Performs basic check for validity
  42.      *
  43.      * @return boolean 
  44.      * @internal
  45.      */
  46.     public function basic_check({
  47.         $has_errors parent::basic_check();
  48.  
  49.         if (!$has_errors{
  50.             if (strpos($this->get_html_value()'*'!== FALSE{
  51.                 $this->set_error('password_asterisk_used');
  52.                 $has_errors true;
  53.             }
  54.         }
  55.  
  56.         return $has_errors;
  57.     }
  58. }