Commit 8bb1b7ca authored by Richard Mansfield's avatar Richard Mansfield

Only allow remove_user_sessions to be called for a single user (bug #745345)

Change-Id: Iafc67ec17f31cebdf680fd16e730de970068adc1
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent e2b5783a
......@@ -273,15 +273,13 @@ function insert_messages() {
}
function remove_user_sessions($userid=null) {
/**
* Delete all sessions belonging to a given user except for the current one
*/
function remove_user_sessions($userid) {
global $sessionpath, $USER;
if (is_null($userid)) {
$sessionids = get_column('usr_session', 'session');
}
else {
$sessionids = get_column('usr_session', 'session', 'usr', $userid);
}
$sessionids = get_column('usr_session', 'session', 'usr', (int) $userid);
if (empty($sessionids)) {
return;
......
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