]> git.mjollnir.org Git - moodle.git/commitdiff
enrol/mnet: fix a warning, do not list the sitecourse
authormartinlanghoff <martinlanghoff>
Wed, 17 Jan 2007 23:12:15 +0000 (23:12 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 17 Jan 2007 23:12:15 +0000 (23:12 +0000)
enrol/mnet/allowed_courses.php
enrol/mnet/config.html

index 6419044fd3f2f1c7c3015c7b64bd6838795a310a..9612667fae94af2ceef4d21be968cdae3d7078a2 100644 (file)
@@ -102,6 +102,7 @@ if ($categories = get_records('course_categories', '', '', 'name', 'id, name'))
 }
 $courses = array();
 if ($courses = get_records('course', '', '', 'shortname', 'id, shortname')) {
+    unset($courses[SITEID]); // never list or offer the siteid
     $allowedcourses = array();
     if (empty($CFG->enrol_mnet_allowed_courses)) {
         $potentialcourses = $courses;
index 90d53c6c77ed70fc6971b8fe36b242878539c013..186603bb0e37da4e44fbc1d42fa8d01514a54306 100644 (file)
@@ -4,6 +4,10 @@ if (empty($CFG->mnet_mode) || $CFG->mnet_mode !== 'strict') {
     print_box(get_string('mnetdisabled','mnet'));
 }
 
+$servercount = 0;
+if (is_array($mnethosts)) {
+    $servercount = count(array_keys($mnethosts));
+}
 ?>
 <table cellspacing="0" cellpadding="5" border="0" align="center">
 
@@ -13,7 +17,7 @@ if (empty($CFG->mnet_mode) || $CFG->mnet_mode !== 'strict') {
 <tr valign="top">
     <td align="left" colspan="3">
     <a href="<?php echo $CFG->wwwroot .'/enrol/mnet/remote_hosts.php?sesskey=' . sesskey(); ?>" >Manage Moodle Network Enrolments.</a><br/>
-    Servers configured: <?php echo count(array_keys($mnethosts)); ?>
+    Servers configured: <?php echo $servercount; ?>
 
     </td>
 </tr>