Skip to content

Commit

Permalink
sec(Users) logout user when deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Oct 31, 2021
1 parent cf14198 commit fb7c6c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.php
Expand Up @@ -141,7 +141,7 @@
header("Location: index.php?action=$default_action&module=$default_module");
}

if ($use_current_login) {
if ($use_current_login && coreBOS_Settings::SettingExists('cbodUserConnection'.$_SESSION['authenticated_user_id'])) {
//getting the internal_mailer flag
if (!isset($_SESSION['internal_mailer'])) {
$qry_res = $adb->pquery('select internal_mailer from vtiger_users where id=?', array($_SESSION['authenticated_user_id']));
Expand All @@ -163,6 +163,7 @@
echo 'Login';
die();
}
coreBOS_Session::delete('authenticated_user_id');
$action = 'Login';
$module = 'Users';
include 'modules/Users/Login.php';
Expand Down
6 changes: 6 additions & 0 deletions modules/Users/Users.php
Expand Up @@ -1499,6 +1499,12 @@ public function transformOwnerShipAndDelete($userId, $transformToUserId) {
$adb->pquery('delete from vtiger_users where id=?', array($userId));
//Delete user extension in asterisk.
$adb->pquery('delete from vtiger_asteriskextensions where userid=?', array($userId));
// close user session
coreBOS_Settings::delSetting('cbodUserConnection'.$userId);
coreBOS_Settings::delSetting('cbodLastLoginTime'.$userId);
// delete user files if they exist
@unlink('user_privileges/sharing_privileges_'.$userId.'.php');
@unlink('user_privileges/user_privileges_'.$userId.'.php');
}

/**
Expand Down

0 comments on commit fb7c6c4

Please sign in to comment.