(bug 54980) Remove toolbox UserRights if anon user
authoraddshore <addshorewiki@gmail.com>
Sat, 5 Oct 2013 14:20:52 +0000 (16:20 +0200)
committeraddshore <addshorewiki@gmail.com>
Sat, 5 Oct 2013 14:43:44 +0000 (16:43 +0200)
Change-Id: Ie489ce327a56cf314c9dc525d6bd3eaa39739260

includes/SkinTemplate.php

index d968d79..44cafe9 100644 (file)
@@ -1280,12 +1280,14 @@ class SkinTemplate extends Skin {
                                );
                        }
 
-                       $sur = new UserrightsPage;
-                       $sur->setContext( $this->getContext() );
-                       if ( $sur->userCanExecute( $this->getUser() ) ) {
-                               $nav_urls['userrights'] = array(
-                                       'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
-                               );
+                       if ( !$user->isAnon() ) {
+                               $sur = new UserrightsPage;
+                               $sur->setContext( $this->getContext() );
+                               if ( $sur->userCanExecute( $this->getUser() ) ) {
+                                       $nav_urls['userrights'] = array(
+                                               'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
+                                       );
+                               }
                        }
                }