]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16285 Simplify separate treatment of executing peer.
authorpeterbulmer <peterbulmer>
Sun, 7 Sep 2008 03:24:56 +0000 (03:24 +0000)
committerpeterbulmer <peterbulmer>
Sun, 7 Sep 2008 03:24:56 +0000 (03:24 +0000)
Change 'if' to comply with moodle coding standards
Improvements to comment

Author: Peter Bulmer <peter.bulmer@catalyst.net.nz>

auth/mnet/auth.php

index 0147a42c79ff6441ef017e8a92259cfd1ce2e04a..8340e0ff41f3611efbdef7dda98fa0cc0df2c359 100644 (file)
@@ -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);