]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19972 new function require_real_user()
authormudrd8mz <mudrd8mz>
Thu, 30 Jul 2009 14:13:27 +0000 (14:13 +0000)
committermudrd8mz <mudrd8mz>
Thu, 30 Jul 2009 14:13:27 +0000 (14:13 +0000)
lib/moodlelib.php

index 9744465b33eb7e7b0dfcc2834db7194bd9ebc409..687a3222344b17f5c2d5f009b8c76e4de977dc5d 100644 (file)
@@ -2231,6 +2231,16 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
 }
 
 
+/**
+ * Prints error if the user is logged in as guest user with username 'guest'.
+ *
+ * @return void
+ */
+function require_real_user($user=NULL) {
+    if (isguestuser($user)) {
+        print_error('guestsarenotallowed');
+    }
+}
 
 /**
  * This function just makes sure a user is logged out.