]> git.mjollnir.org Git - moodle.git/commitdiff
Whoops ... don't put unenrol button unless the user is the current user!
authormartin <martin>
Tue, 4 Jun 2002 06:35:36 +0000 (06:35 +0000)
committermartin <martin>
Tue, 4 Jun 2002 06:35:36 +0000 (06:35 +0000)
user/view.php

index 499e29336ca9c7b3270594e4a55ad0a87c7bd1c1..e78c2eaf1a705102be6b743dca17b13e187b07df 100644 (file)
     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);