]> git.mjollnir.org Git - moodle.git/commitdiff
Some changes to make login a little more robust on some sites that have
authormoodler <moodler>
Sat, 3 Apr 2004 04:55:35 +0000 (04:55 +0000)
committermoodler <moodler>
Sat, 3 Apr 2004 04:55:35 +0000 (04:55 +0000)
multiple addresses

login/index.php

index 2584b68f909e32500efe35dccc0edf73c9910ec5..91150dd08f1542aebee08929724a9b08785c4501 100644 (file)
 
             set_moodle_cookie($USER->username);
 
+            $wantsurl = $SESSION->wantsurl;
+
+            unset($SESSION->wantsurl);
             unset($SESSION->lang);
 
             if (user_not_fully_set_up($USER)) {
                 $site = get_site();
                 redirect("$CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id");
 
-            } else if (empty($SESSION->wantsurl)) {
-                redirect("$CFG->wwwroot/");
+            } else if (strpos($wantsurl, $CFG->wwwroot) === 0) {   /// Matches site address
+                redirect($wantsurl);
 
             } else {
-                $wantsurl = $SESSION->wantsurl;
-                unset($SESSION->wantsurl);
-                redirect($wantsurl);
+                redirect("$CFG->wwwroot/");      /// Go to the standard home page
             }
     
             reset_login_count();