diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index b847a65d45..3dc1db9b78 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -682,6 +682,10 @@ if ($update_user) { ] ); $res3 = save_pass_history($id, $password_new); + + // Generate new API token. + $newToken = api_token_generate(); + $res4 = update_user($id, ['api_token' => $newToken]); } ui_print_result_message( @@ -706,6 +710,10 @@ if ($update_user) { 'utimestamp' => time(), ] ); + + // Generate new API token. + $newToken = api_token_generate(); + $res4 = update_user($id, ['api_token' => $newToken]); } ui_print_result_message( diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 9707a53769..a8e83789aa 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9612,6 +9612,7 @@ function api_set_new_user($id, $thrash2, $other, $thrash3) $values['section'] = $other['data'][11]; $values['session_time'] = $other['data'][12]; $values['metaconsole_access_node'] = $other['data'][13]; + $values['api_token'] = api_token_generate(); if (empty($password) === true) { returnError('Password cannot be empty.'); @@ -9708,6 +9709,8 @@ function api_set_update_user($id, $thrash2, $other, $thrash3) if (!update_user_password($id, $other['data'][4])) { returnError('The user could not be updated. Password info incorrect.'); return; + } else { + $values['api_token'] = api_token_generate(); } }