mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Fixed password policy
This commit is contained in:
parent
2a4e7bcceb
commit
428e0ffbd7
@ -262,9 +262,9 @@ if ($create_user) {
|
|||||||
$password_confirm = '';
|
$password_confirm = '';
|
||||||
$new_user = true;
|
$new_user = true;
|
||||||
} else {
|
} else {
|
||||||
$have_number = false;
|
|
||||||
$have_simbols = false;
|
|
||||||
if ($config['enable_pass_policy']) {
|
if ($config['enable_pass_policy']) {
|
||||||
|
$have_number = true;
|
||||||
|
$have_simbols = true;
|
||||||
if ($config['pass_needs_numbers']) {
|
if ($config['pass_needs_numbers']) {
|
||||||
$nums = preg_match('/([[:alpha:]])*(\d)+(\w)*/', $password_confirm);
|
$nums = preg_match('/([[:alpha:]])*(\d)+(\w)*/', $password_confirm);
|
||||||
if ($nums == 0) {
|
if ($nums == 0) {
|
||||||
@ -273,8 +273,7 @@ if ($create_user) {
|
|||||||
$password_new = '';
|
$password_new = '';
|
||||||
$password_confirm = '';
|
$password_confirm = '';
|
||||||
$new_user = true;
|
$new_user = true;
|
||||||
} else {
|
$have_number = false;
|
||||||
$have_number = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,23 +285,12 @@ if ($create_user) {
|
|||||||
$password_new = '';
|
$password_new = '';
|
||||||
$password_confirm = '';
|
$password_confirm = '';
|
||||||
$new_user = true;
|
$new_user = true;
|
||||||
} else {
|
$have_simbols = false;
|
||||||
$have_simbols = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
if ($have_number && $have_simbols) {
|
||||||
if ($have_number && $have_simbols) {
|
$result = create_user($id, $password_new, $values);
|
||||||
$result = create_user($id, $password_new, $values);
|
|
||||||
}
|
|
||||||
} else if ($config['pass_needs_symbols'] && !$config['pass_needs_numbers']) {
|
|
||||||
if ($have_simbols) {
|
|
||||||
$result = create_user($id, $password_new, $values);
|
|
||||||
}
|
|
||||||
} else if (!$config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
|
||||||
if ($have_number) {
|
|
||||||
$result = create_user($id, $password_new, $values);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = create_user($id, $password_new, $values);
|
$result = create_user($id, $password_new, $values);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user