diff --git a/index.php b/index.php index 1f19edeabf..37c58e1ae3 100644 --- a/index.php +++ b/index.php @@ -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'])); @@ -163,6 +163,7 @@ echo 'Login'; die(); } + coreBOS_Session::delete('authenticated_user_id'); $action = 'Login'; $module = 'Users'; include 'modules/Users/Login.php'; diff --git a/modules/Users/Users.php b/modules/Users/Users.php index 5f28b4dd15..769407aa2a 100644 --- a/modules/Users/Users.php +++ b/modules/Users/Users.php @@ -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'); } /**