Merge branch 'wip-MDL-37983-master' of git://github.com/abgreeve/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 4 Mar 2013 15:42:25 +0000 (16:42 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 4 Mar 2013 15:42:25 +0000 (16:42 +0100)
login/index.php

index fde60a4..a98af01 100644 (file)
@@ -202,7 +202,10 @@ if ($frm and isset($frm->username)) {                             // Login WITH
             // no wantsurl stored or external - go to homepage
             $urltogo = $CFG->wwwroot.'/';
             unset($SESSION->wantsurl);
+        }
 
+        // If the url to go to is the same as the site page, check for default homepage.
+        if ($urltogo == ($CFG->wwwroot . '/')) {
             $home_page = get_home_page();
             // Go to my-moodle page instead of site homepage if defaulthomepage set to homepage_my
             if ($home_page == HOMEPAGE_MY && !is_siteadmin() && !isguestuser()) {