From: martin <martin> Date: Sun, 28 Jul 2002 16:35:34 +0000 (+0000) Subject: Fixed bug where admin controls would be shown to teachers in edit-mode (thanks dopey) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20cad2b64f492bd40284bebabf8b412b6f8408f8;p=moodle.git Fixed bug where admin controls would be shown to teachers in edit-mode (thanks dopey) --- diff --git a/index.php b/index.php index c455013755..b62f76cff1 100644 --- 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§ion=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);