]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed bug where admin controls would be shown to teachers in edit-mode (thanks dopey)
authormartin <martin>
Sun, 28 Jul 2002 16:35:34 +0000 (16:35 +0000)
committermartin <martin>
Sun, 28 Jul 2002 16:35:34 +0000 (16:35 +0000)
index.php

index c455013755e5e40c24356b005a3b4fbf4407d25c..b62f76cff16736419c39db9e953bc911d14546ba 100644 (file)
--- a/index.php
+++ b/index.php
@@ -28,7 +28,7 @@
     <TD VALIGN="TOP" NOWRAP>
       <? $readings = list_all_readings();
       
-         if ($site->newsitems > 0 or $readings or $USER->editing) {
+         if ($site->newsitems > 0 or $readings or ($USER->editing and isadmin())) {
       
              print_simple_box(get_string("mainmenu"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
 
@@ -45,7 +45,7 @@
                     echo "<LI>$reading";
                  }
              }
-             if ($USER->editing) {
+             if ($USER->editing and isadmin()) {
                  echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&section=0&add=reading\">".
                       get_string("addreading", "reading")."</A>...</P>";
              } else {
@@ -99,7 +99,7 @@
     </TD>
     <TD WIDTH="30%" VALIGN="TOP"> 
       <? 
-         if ($USER->editing) {
+         if ($USER->editing and isadmin()) {
              $site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
          }
          print_simple_box($site->summary, "", "100%", $THEME->cellheading);