From 3f9ccf85ce03e32a2e8b481fd1b7992fc6b15b78 Mon Sep 17 00:00:00 2001 From: Martin Dougiamas Date: Fri, 14 May 2010 02:55:46 +0000 Subject: [PATCH] MDL-22425 Don't show My Home link on home page if not logged in --- lib/navigationlib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index dfbac0f7981..fe7b57d8bd1 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -842,8 +842,10 @@ class global_navigation extends navigation_node { // users: Other users information loaded here. $this->rootnodes = array(); if (get_home_page() == HOMEPAGE_SITE) { - // The home element should be the my moolde because the root element is the site - $this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_SETTING, null, 'home'); + // The home element should be my moodle because the root element is the site + if (isloggedin()) { // Makes no sense if you aren't logged in + $this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_SETTING, null, 'home'); + } } else { // The home element should be the site because the root node is my moodle $this->rootnodes['home'] = $this->add(get_string('sitehome'), new moodle_url('/'), self::TYPE_SETTING, null, 'home'); @@ -3559,4 +3561,4 @@ class navigation_cache { } } } -} \ No newline at end of file +}