PFAHandler.php:

- fix field type for skipping password fields (must be 'pass', not 'password')
- implement validation of 'pass' fields with validate_password()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1293 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 76befc69ff
commit 3a8a738585

@ -98,7 +98,7 @@ class PFAHandler {
}
} else {
if (isset($values[$key])) {
if ($row['type'] != "password" || strlen($values[$key]) > 0 || $this->new == 1) { # skip on empty (aka unchanged) password on edit
if ($row['type'] != "pass" || strlen($values[$key]) > 0 || $this->new == 1) { # skip on empty (aka unchanged) password on edit
$valid = true; # trust input unless validator objects
# validate based on field type (_inp_$type)
@ -335,11 +335,13 @@ class PFAHandler {
return false;
}
function _inp_password($field, $val){
# TODO: fetchmail specific. Not suited for mailbox/admin passwords.
$this->errormsg[$field] = "_inp_password not implemented yet";
function _inp_pass($field, $val){
$validpass = validate_password($val);
if(count($validpass) == 0) return true;
$this->errormsg[$field] = $validpass[0]; # TODO: honor all error messages, not only the first one?
return false;
# return base64_encode($val);
}
}

Loading…
Cancel
Save