]> git.mjollnir.org Git - moodle.git/commitdiff
Added hack for guest login with seeing login page
authormoodler <moodler>
Sat, 6 Sep 2003 03:34:52 +0000 (03:34 +0000)
committermoodler <moodler>
Sat, 6 Sep 2003 03:34:52 +0000 (03:34 +0000)
login/index.php

index 550d8226111e10515179904721769f256144954b..da57ff85b44e3ccf86257e23a3101e6a46763921 100644 (file)
         }
     }
 
+    $frm = false;
+    if (!empty($SESSION->wantsurl) and strstr($SESSION->wantsurl,"username=guest")) {
+        /// Log in as guest automatically (idea from Zbigniew Fiedorowicz)
+        $frm->username = "guest";
+        $frm->password = "guest";
+    } else {
+        $frm = data_submitted();
+    }
 
-    if ($frm = data_submitted()) {
+    if ($frm) {
         $frm->username = trim(moodle_strtolower($frm->username));
         $user = authenticate_user_login($frm->username, $frm->password);
         update_login_count();