Commit 4a4ba694 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: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 52231254
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment