]> git.mjollnir.org Git - moodle.git/commitdiff
Mnet: Bugfix: Revised query to find hosts we SSO with: MDL-8082
authordonal72 <donal72>
Thu, 11 Jan 2007 05:59:57 +0000 (05:59 +0000)
committerdonal72 <donal72>
Thu, 11 Jan 2007 05:59:57 +0000 (05:59 +0000)
course/report/log/lib.php

index 0a1cd3f25fd7df2edd7614620caafba92e566e75..4bbebde8f59124ef02577f99367d95c0f6a0b6a2 100644 (file)
@@ -73,22 +73,17 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select
         }
     }
 
-    // Get all the hosts that we SSO with
-    $sql = "SELECT DISTINCT 
-                h.id, 
-                h.name,
-                s.name as servicename
-            FROM 
-                {$CFG->prefix}mnet_host h
-            LEFT OUTER JOIN 
-                {$CFG->prefix}mnet_host2service hs    ON 
-                (h.id=hs.hostid AND hs.subscribe!=0)
-            LEFT OUTER JOIN 
-                {$CFG->prefix}mnet_service2rpc sr ON 
-                sr.serviceid=hs.serviceid
-            LEFT OUTER JOIN 
-                {$CFG->prefix}mnet_service s      ON 
-                (sr.serviceid=s.id AND s.name='sso')";
+    // Get all the hosts that have log records
+    $sql = "select distinct
+                h.id,
+                h.name
+            from
+                {$CFG->prefix}mnet_host h,
+                {$CFG->prefix}mnet_log l
+            where
+                h.id = l.hostid
+            order by
+                h.name";
     $hosts = get_records_sql($sql);
 
     foreach($hosts as $host) {