Whoops ... don't put unenrol button unless the user is the current user!

This commit is contained in:
martin 2002-06-04 06:35:36 +00:00
parent be0d1cd55a
commit 18798c6f55

View File

@ -103,12 +103,14 @@
echo "</TD></TR></TABLE></TABLE>";
// Print other functions
echo "<CENTER><TABLE ALIGN=CENTER><TR>";
echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
echo "<INPUT type=hidden name=id value=\"$course->id\">";
echo "<INPUT type=submit value=\"Unenrol me from $course->shortname\">";
echo "</FORM></P></TD>";
echo "</TR></TABLE></CENTER>\n";
if ($id == $USER->id) {
echo "<CENTER><TABLE ALIGN=CENTER><TR>";
echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
echo "<INPUT type=hidden name=id value=\"$course->id\">";
echo "<INPUT type=submit value=\"Unenrol me from $course->shortname\">";
echo "</FORM></P></TD>";
echo "</TR></TABLE></CENTER>\n";
}
print_footer($course);