]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5661 - mymoodle redirect problem; merged from MOODLE_16_STABLE
authorskodak <skodak>
Thu, 1 Jun 2006 05:40:45 +0000 (05:40 +0000)
committerskodak <skodak>
Thu, 1 Jun 2006 05:40:45 +0000 (05:40 +0000)
login/index.php

index a0c25d5589580c6fe80625e920e766426d3cec68..618b4b7a8e857123dc361c304ee7d051d53122b3 100644 (file)
             }
 
 
+          /// Prepare redirection
             if (user_not_fully_set_up($USER)) {
                 $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.SITEID;
                 // We don't delete $SESSION->wantsurl yet, so we get there later
                 unset($SESSION->wantsurl);
 
             } else {
-                $urltogo = $CFG->wwwroot.'/my';      /// Go to the standard home page
-                if (isadmin() || empty($CFG->mymoodleredirect) || isguest()) {
-                    $urltogo = $CFG->wwwroot;       /// not needed by admins or guests or when it's turned off
+                // no wantsurl stored or external - go to homepage
+                $urltogo = $CFG->wwwroot;
+                unset($SESSION->wantsurl);
+            }
+
+          /// Go to my-moodle page instead of homepage if mymoodleredirect enabled
+            if (!isadmin() and !empty($CFG->mymoodleredirect) and !isguest()) {
+                if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
+                    $urltogo = $CFG->wwwroot.'/my/';
                 }
-                unset($SESSION->wantsurl);         /// Just in case
             }
 
+
             // check if user password has expired
             // Currently supported only for ldap-authentication module
             if (isset($CFG->ldap_expiration) && $CFG->ldap_expiration == 1 ) {