diff --git a/model/AdminHandler.php b/model/AdminHandler.php index 93a53bcf..198c7c8b 100644 --- a/model/AdminHandler.php +++ b/model/AdminHandler.php @@ -206,6 +206,20 @@ class AdminHandler extends PFAHandler { } } + /** + * compare password / password2 field + * error message will be displayed at the password2 field + */ + protected function _field_password2($field, $val) { + if ($this->RAWvalues['password'] == $this->RAWvalues['password2']) { + unset ($this->errormsg['password2']); # no need to warn about too short etc. passwords - it's enough to display this message at the 'password' field + return true; + } + + $this->errormsg['password2'] = Lang::read('pAdminEdit_admin_password_text_error'); + return false; + } + } /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 7be37aec..0f4cb8ae 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -7,6 +7,7 @@ class PFAHandler { protected $struct = array(); protected $new = 0; # 1 on create, otherwise 0 protected $values = array(); + protected $RAWvalues = array(); # unchecked (!) input given to set() - use it carefully! protected $values_valid = false; protected $admin_username = ""; # if set, restrict $allowed_domains to this admin protected $domain_field = ""; # column containing the domain @@ -88,6 +89,9 @@ class PFAHandler { $values[$this->id_field] = $this->id; } + $this->RAWvalues = $values; # allows comparison of two fields before the second field is checked + # Warning: $this->RAWvalues contains unchecked input data - use it carefully! + # base validation $this->values = array(); $this->values_valid = false;