diff --git a/settings.php b/settings.php index ea03e0ba..060b85b4 100644 --- a/settings.php +++ b/settings.php @@ -174,16 +174,18 @@ $settings->add($recycleonjoin); // Only call to the web services and load the setting if the connection is OK - if ($status == 'connectionok') { - $zoomgrps[] = null; - $groupobj = zoom_webservice()->get_groups(); - foreach ($groupobj->groups as $group) { - $zoomgrps[$group->id] = $group->name; + if (isset($status)) { + if ($status == 'connectionok') { + $zoomgrps[] = null; + $groupobj = zoom_webservice()->get_groups(); + foreach ($groupobj->groups as $group) { + $zoomgrps[$group->id] = $group->name; + } + $protectedgrp = new admin_setting_configselect('zoom/protectedgrp', + get_string('protectedgrp','mod_zoom'), + get_string('protectedgrp_desc','mod_zoom'),0,$zoomgrps); + $settings->add($protectedgrp); } - $protectedgrp = new admin_setting_configselect('zoom/protectedgrp', - get_string('protectedgrp','mod_zoom'), - get_string('protectedgrp_desc','mod_zoom'),0,$zoomgrps); - $settings->add($protectedgrp); } // Global settings.