Merge branch 'ent-8725-lista-exclusion-passwords' into 'develop'

Added exclude words for passwords control

See merge request 
This commit is contained in:
Daniel Rodriguez 2022-10-25 09:07:08 +00:00
commit 8aa6ea8bc8
5 changed files with 56 additions and 1 deletions
pandora_console

View File

@ -442,6 +442,13 @@ if ($create_user) {
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if (excludedPassword($password_new) === true) {
$is_err = true;
ui_print_error_message(__('The password provided is not valid. Please set another one.'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else {
if ((!is_user_admin($config['id_user']) || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) {
$pass_ok = login_validate_pass($password_new, $id, true);

View File

@ -758,6 +758,12 @@ function delete_user(string $id_user)
function update_user_password(string $user, string $password_new)
{
global $config;
if (excludedPassword($password_new) === true) {
$config['auth_error'] = __('The password provided is not valid. Please, set another one.');
return false;
}
if (isset($config['auth']) === true && $config['auth'] === 'pandora') {
$sql = sprintf(
"UPDATE tusuario SET password = '".md5($password_new)."', last_pass_change = '".date('Y-m-d H:i:s', get_system_time())."' WHERE id_user = '".$user."'"

View File

@ -515,6 +515,10 @@ function config_update_config()
if (config_update_value('reset_pass_option', (bool) get_parameter('reset_pass_option'), true) === false) {
$error_update[] = __('Activate reset password');
}
if (config_update_value('exclusion_word_list', (string) get_parameter('exclusion_word_list'), true) === false) {
$error_update[] = __('Exclusion word list for passwords');
}
}
break;
@ -2199,6 +2203,10 @@ function config_process_config()
config_update_value('reset_pass_option', 0);
}
if (isset($config['exclusion_word_list']) === false) {
config_update_value('exclusion_word_list', '');
}
if (!isset($config['include_agents'])) {
config_update_value('include_agents', 0);
}

View File

@ -9119,3 +9119,37 @@ div#err_msg_centralised {
margin-right: -110px;
margin-top: 13px;
}
.tag-editor {
padding: 0.5em !important;
}
.tag-editor div {
float: right !important;
}
.tag-editor .tag-editor-tag {
padding: 5px !important;
color: #fff !important;
background: #82b92e !important;
border-radius: 0 2px 2px 0 !important;
}
.tag-editor .tag-editor-delete {
padding: 5px !important;
line-height: 16px !important;
background: #82b92e !important;
border-radius: 2px 0 0 2px !important;
}
.tag-editor .tag-editor-delete i {
line-height: 16pt !important;
}
.tag-editor .tag-editor-delete i:before {
color: #fff !important;
}
.tag-editor .tag-editor-delete:hover i:before {
color: #ccc !important;
}

View File

@ -211,7 +211,7 @@ if (isset($_GET['modified']) && !$view_mode) {
$user_info = $upd_info;
} else {
if (!$error_msg) {
$error_msg = __('Error updating passwords: ');
$error_msg = __('Error updating passwords: ').($config['auth_error'] ?? '');
}
$user_auth_error = $config['auth_error'];