From 4711957d9931f5bfa89a5430ea8beba0e0875a8c Mon Sep 17 00:00:00 2001 From: peterbulmer Date: Sun, 7 Sep 2008 03:24:56 +0000 Subject: [PATCH] MDL-16285 Simplify separate treatment of executing peer. Change 'if' to comply with moodle coding standards Improvements to comment Author: Peter Bulmer --- auth/mnet/auth.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index 0147a42c79..8340e0ff41 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -1087,24 +1087,20 @@ class auth_plugin_mnet extends auth_plugin_base { $mnetsessions = $DB->get_records('mnet_session', array('userid' => $userid, 'useragent' => $useragent)); - // If we are being executed from a remote machine (client) we don't have - // to kill the moodle session on that machine. - if (isset($MNET_REMOTE_CLIENT) && isset($MNET_REMOTE_CLIENT->id)) { - $excludeid = $MNET_REMOTE_CLIENT->id; - } else { - $excludeid = -1; - } - if (false == $mnetsessions) { $returnstring .= "Could find no remote sessions\n$sql\n"; $mnetsessions = array(); } foreach($mnetsessions as $mnetsession) { + // If this script is being executed by a remote peer, that means the user has clicked + // logout on that peer, and the session on that peer can be deleted natively. + // Skip over it. + if (isset($MNET_REMOTE_CLIENT->id) && ($mnetsession->mnethostid == $MNET_REMOTE_CLIENT->id)) { + continue; + } $returnstring .= "Deleting session\n"; - if ($mnetsession->mnethostid == $excludeid) continue; - $mnet_peer = new mnet_peer(); $mnet_peer->set_id($mnetsession->mnethostid); -- 2.39.5