Permalink
Browse files

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

  • Loading branch information...
1 parent be0d1cd commit 18798c6f55e5d86570eca67be91df33778252656 martin committed Jun 4, 2002
Showing with 8 additions and 6 deletions.
  1. +8 −6 user/view.php
View
@@ -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);

0 comments on commit 18798c6

Please sign in to comment.