fixed error
This commit is contained in:
parent
efd6a72bb8
commit
d650ff6959
|
@ -389,9 +389,12 @@ if (isset($login_failed)) {
|
|||
echo '<h1>'.__('ERROR').'</h1>';
|
||||
echo '<p>'.$config['auth_error'].'</p>';
|
||||
echo '</div>';
|
||||
if ($config['enable_pass_policy']) {
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-error', false);
|
||||
echo '</div>';
|
||||
|
|
|
@ -258,7 +258,7 @@ if ($create_user) {
|
|||
} else {
|
||||
$have_number = false;
|
||||
$have_simbols = false;
|
||||
|
||||
if ($config['enable_pass_policy']) {
|
||||
if ($config['pass_needs_numbers']) {
|
||||
$nums = preg_match('/([[:alpha:]])*(\d)+(\w)*/', $password_confirm);
|
||||
if ($nums == 0) {
|
||||
|
@ -285,6 +285,22 @@ if ($create_user) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
||||
if ($have_number && $have_simbols) {
|
||||
$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 {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
|
||||
$info = '{"Id_user":"'.$values['id_user'].'","FullName":"'.$values['fullname'].'","Firstname":"'.$values['firstname'].'","Lastname":"'.$values['lastname'].'","Email":"'.$values['email'].'","Phone":"'.$values['phone'].'","Comments":"'.$values['comments'].'","Is_admin":"'.$values['is_admin'].'","Language":"'.$values['language'].'","Timezone":"'.$values['timezone'].'","Block size":"'.$values['block_size'].'"';
|
||||
|
||||
|
@ -296,33 +312,7 @@ if ($create_user) {
|
|||
|
||||
$can_create = false;
|
||||
|
||||
if ($config['pass_needs_symbols']) {
|
||||
if ($have_simbols) {
|
||||
$symbols = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['pass_needs_numbers']) {
|
||||
if ($have_number) {
|
||||
$nums = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
||||
if ($nums && $symbols) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
} else if ($config['pass_needs_symbols'] && !$config['pass_needs_numbers']) {
|
||||
if ($symbols) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
} else if (!$config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
||||
if ($nums) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
} else {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$res = save_pass_history($id, $password_new);
|
||||
|
|
Loading…
Reference in New Issue