#10106 deleted session when user is deleted

This commit is contained in:
Daniel Cebrian 2023-01-11 10:59:52 +01:00
parent 1ce72edf0f
commit a7fccc2f77
2 changed files with 15 additions and 0 deletions

View File

@ -333,6 +333,7 @@ if ($delete_user === true) {
$result = delete_user($id_user);
if ($result) {
delete_session_user($id_user);
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s', io_safe_output($id_user))

View File

@ -811,6 +811,20 @@ function users_get_users_by_group($id_group, $um=false, $disabled=true)
}
/**
* Delete session user if exist
*
* @param string $id_user User id.
*
* @return boolean Return .
*/
function delete_session_user($id_user)
{
$sql = "DELETE FROM tsessions_php where data like '%\"".$id_user."\"%'";
return db_process_sql($sql);
}
function users_has_profile_without_UM($id_user, $id_groups)
{
$sql = sprintf(