Commit 470e671c authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1594642: Problem where global $sessionpath not set



When I tried closing my site I got DirectoryIterator error

behatnotneeded - the patch 6609 will test this

Change-Id: I35024f8e6a558ee9d009e7c2754a0026e8042b2f
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 4a4ba694)
parent e7107840
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -477,8 +477,8 @@ function insert_messages($placement='messages') {
 * Delete all sessions belonging to a given user except for the current one
 */
function remove_user_sessions($userid) {
    global $sessionpath, $USER, $SESSION;

    global $USER, $SESSION;
    $sessionpath = get_config('sessionpath');
    $sessionids = get_column('usr_session', 'session', 'usr', (int) $userid);

    if (empty($sessionids)) {
@@ -545,8 +545,8 @@ function remove_user_sessions($userid) {
 * Delete all session files except for the current one
 */
function remove_all_sessions() {
    global $sessionpath, $USER;

    global $USER;
    $sessionpath = get_config('sessionpath');
    $sid = $USER->get('sessionid');

    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sessionpath));