Merge branch 'ent-10106-borrar-sesion-de-usuario-cuando-se-borra-un-usuario' into 'develop'

Ent 10106 borrar sesion de usuario cuando se borra un usuario

See merge request artica/pandorafms!5397
This commit is contained in:
Daniel Rodriguez 2023-01-23 15:28:19 +00:00
commit 0a4ddc480a
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(