You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-07-31 10:04:20 +03:00
improve comment, fix return value in callable for password_verify.
This commit is contained in:
@ -229,13 +229,14 @@ $CONF['password_validation'] = array(
|
|||||||
'/.{5}/' => 'password_too_short 5', # minimum length 5 characters
|
'/.{5}/' => 'password_too_short 5', # minimum length 5 characters
|
||||||
// '/([a-zA-Z].*){3}/' => 'password_no_characters 3', # must contain at least 3 consecutive characters
|
// '/([a-zA-Z].*){3}/' => 'password_no_characters 3', # must contain at least 3 consecutive characters
|
||||||
'/([0-9].*){2}/' => 'password_no_digits 2', # must contain at least 2 digits
|
'/([0-9].*){2}/' => 'password_no_digits 2', # must contain at least 2 digits
|
||||||
'length_check' => function($password) { return strlen(trim($password)) > 2; }, // not unicode safe.
|
|
||||||
/* support a 'callable' value which if it returns a non-empty string will be assumed to have failed. */
|
/* support a 'callable' value which if it returns a non-empty string will be assumed to have failed, non-empty string should be a PALANG key */
|
||||||
|
'length_check' => function($password) { if (strlen(trim($password)) < 3) { return 'password_too_short'; } }, // not unicode safe.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'any-key' => function($password) {
|
* 'any-key' => function($password) {
|
||||||
* if ( rand(0, 5) == 0 ) { return 'password_too_short'; }
|
* if ( rand(0, 5) == 0 ) { return 'password_too_short'; }
|
||||||
* // add some remote api check here ... or whatever
|
* // add some remote api check here ... or whatever
|
||||||
* },
|
* },
|
||||||
*/
|
*/
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user