/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEPassword.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEPassword.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Sat Feb 22 21:07:48 2003 UTC revision 1.3 by jonen, Thu May 6 16:27:27 2004 UTC
# Line 47  class FEPassword extends FEText { Line 47  class FEPassword extends FEText {
47    
48    
49      /**      /**
50         * return a string to the user for the
51         * confirmation page
52         *
53         * @return string
54         */
55        function get_element_text() {
56            return str_repeat('*', strlen($this->get_value()));
57        }
58    
59    
60        /**
61       * This function performs the actual validation       * This function performs the actual validation
62       * It is called only if the validation is required by       * It is called only if the validation is required by
63       * this element       * this element
# Line 55  class FEPassword extends FEText { Line 66  class FEPassword extends FEText {
66       * validation and setting the appropriate error message       * validation and setting the appropriate error message
67       * in case of a failed validation       * in case of a failed validation
68       *       *
69         * @param FormValidation object
70       */       */
71      function validate() {      function validate(&$_FormValidation) {
72          $v = new FormValidation;          if (!$_FormValidation->is_password($this->get_value())) {
73          if (!$v->is_password($this->get_value())) {              $this->set_error_message( $_FormValidation->get_error_message() );
             $this->set_error_message( $v->get_error_message() );  
74              return FALSE;              return FALSE;
75          }          }
76          return TRUE;          return TRUE;
# Line 116  class FEConfirmPassword extends FEPasswo Line 127  class FEConfirmPassword extends FEPasswo
127       * validation and setting the appropriate error message       * validation and setting the appropriate error message
128       * in case of a failed validation       * in case of a failed validation
129       *       *
130         * @param FormValidation object
131       */       */
132      function validate() {      function validate(&$_FormValidation) {
133          $v = new FormValidation;          if (!$_FormValidation->is_password($this->get_value())) {
134          if (!$v->is_password($this->get_value())) {              $this->set_error_message( $_FormValidation->get_error_message() );
             $this->set_error_message( $v->get_error_message() );  
135              return FALSE;              return FALSE;
136          }          }
137    
# Line 133  class FEConfirmPassword extends FEPasswo Line 144  class FEConfirmPassword extends FEPasswo
144          }          }
145    
146          //looks like we have an FEPassword to confirm against          //looks like we have an FEPassword to confirm against
147          if (!$v->is_confirm_password($this->get_value(),          if (!$_FormValidation->is_confirm_password($this->get_value(),
148                                      $this->_fepassword->get_value())) {                                                     $this->_fepassword->get_value())) {
149              $this->set_error_message( $v->get_error_message() );              $this->set_error_message( $_FormValidation->get_error_message() );
150              return FALSE;              return FALSE;
151          }          }
152    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed