Fix - Remove all sessions from user see BT#11656

pull/2487/head
jmontoyaa 9 years ago
parent 86495f56f9
commit 29a055394f
  1. 3
      main/cron/import_csv.php
  2. 8
      main/inc/lib/sessionmanager.lib.php

@ -1206,12 +1206,11 @@ class ImportCsv
break;
case 'drh':
$userInfo = api_get_user_info($userId);
SessionManager::removeAllDrhFromSession($chamiloSessionId);
SessionManager::subscribeSessionsToDrh(
$userInfo,
[$chamiloSessionId],
false,
false
true
);
break;

@ -2950,14 +2950,14 @@ class SessionManager
* @param array $userInfo Human Resource Manager info
* @param array $sessions_list Sessions id
* @param bool $sendEmail
* @param bool $removeOldConnections
* @param bool $removeSessionsFromUser
* @return int
* */
public static function subscribeSessionsToDrh(
$userInfo,
$sessions_list,
$sendEmail = false,
$removeOldConnections = true
$removeSessionsFromUser = true
) {
// Database Table Definitions
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
@ -2984,9 +2984,8 @@ class SessionManager
}
$affected_rows = 0;
// Deleting assigned sessions to hrm_id.
if ($removeOldConnections) {
if ($removeSessionsFromUser) {
if (api_is_multiple_url_enabled()) {
$sql = "SELECT s.session_id
FROM $tbl_session_rel_user s
@ -3014,6 +3013,7 @@ class SessionManager
}
}
}
// Inserting new sessions list.
if (!empty($sessions_list) && is_array($sessions_list)) {
foreach ($sessions_list as $session_id) {

Loading…
Cancel
Save