fixed csrf

This commit is contained in:
alejandro.campos@artica.es 2022-12-15 08:48:48 +01:00
parent f6b4631b50
commit 26426c1bfa
2 changed files with 12 additions and 0 deletions

View File

@ -77,6 +77,7 @@ if (is_ajax()) {
true
).'  ';
$table->data['autocreate_remote_users'] = $row;
$table->data['csrf_token'] = html_print_csrf_hidden();
add_enterprise_auth_autocreate_profiles($table, $type_auth);
}
@ -475,6 +476,8 @@ if (!is_metaconsole()) {
html_print_input_hidden('hash_save_config', md5('save'.$config['dbpass']));
}
html_print_csrf_hidden();
html_print_table($table);
echo '<div id="table_auth_result"></div>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';

View File

@ -523,6 +523,15 @@ function config_update_config()
break;
case 'auth':
$validatedCSRF = validate_csrf_code();
// CSRF Validation.
if ($validatedCSRF === false) {
include_once 'general/login_page.php';
// Finish the execution.
exit('</html>');
}
// AUTHENTICATION SETUP.
if (config_update_value('auth', get_parameter('auth'), true) === false) {
$error_update[] = __('Authentication method');