]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9287 missing resultset check in mnet config_form(); merged from MOODLE_18_STABLE
authorskodak <skodak>
Wed, 11 Apr 2007 08:51:01 +0000 (08:51 +0000)
committerskodak <skodak>
Wed, 11 Apr 2007 08:51:01 +0000 (08:51 +0000)
auth/mnet/auth.php

index 47f7e52d02a4e7737b1b98cfe17fb81a28d225e8..f8baa0758e50895afffa4a4508e0af3f9fcbd5e5 100644 (file)
@@ -673,15 +673,16 @@ class auth_plugin_mnet extends auth_plugin_base {
             ORDER BY
                 h.name ASC";
 
-        $resultset = get_records_sql($query);
         $id_providers       = array();
         $service_providers  = array();
-        foreach($resultset as $hostservice) {
-            if(!empty($hostservice->idppublish) && !empty($hostservice->spsubscribe)) {
-                $service_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
-            }
-            if(!empty($hostservice->idpsubscribe) && !empty($hostservice->sppublish)) {
-                $id_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
+        if ($resultset = get_records_sql($query)) {
+            foreach($resultset as $hostservice) {
+                if(!empty($hostservice->idppublish) && !empty($hostservice->spsubscribe)) {
+                    $service_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
+                }
+                if(!empty($hostservice->idpsubscribe) && !empty($hostservice->sppublish)) {
+                    $id_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
+                }
             }
         }