fixed visual error

This commit is contained in:
marcos.alconada 2019-08-22 15:25:35 +02:00
parent 1d0875e89a
commit 8d8e08d37b
1 changed files with 60 additions and 1 deletions

View File

@ -256,6 +256,36 @@ if ($create_user) {
$password_confirm = '';
$new_user = true;
} else {
$have_number = false;
$have_simbols = false;
if ($config['pass_needs_numbers']) {
$nums = preg_match('/([[:alpha:]])*(\d)+(\w)*/', $password_confirm);
if ($nums == 0) {
ui_print_error_message(__('Password must contain numbers'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else {
$have_number = true;
}
}
if ($config['pass_needs_symbols']) {
$symbols = preg_match('/(\w)*(\W)+(\w)*/', $password_confirm);
if ($symbols == 0) {
ui_print_error_message(__('Password must contain symbols'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else {
$have_simbols = true;
}
}
$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'].'"';
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
@ -264,7 +294,36 @@ if ($create_user) {
$info .= '}';
}
$result = create_user($id, $password_new, $values);
$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);
}