X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Fskins%2FSkinTemplate.php;h=1e6c6431e12350c4ced067393b7d0f895b6c2134;hb=ab9436fb9a20b5a335574e36fdd476becabe2dd1;hp=5fd9f1fed776134375f4ebf362bb8b4f23d8dc27;hpb=57e4804bf2ba4481eb9b35680fb8ccc71a912c50;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 5fd9f1fed7..1e6c6431e1 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -62,12 +62,10 @@ class SkinTemplate extends Skin { * roughly equivalent to PHPTAL 0.7. * * @param string $classname - * @param bool|string $repository Subdirectory where we keep template files - * @param bool|string $cache_dir * @return QuickTemplate * @private */ - function setupTemplate( $classname, $repository = false, $cache_dir = false ) { + function setupTemplate( $classname ) { return new $classname( $this->getConfig() ); } @@ -179,7 +177,7 @@ class SkinTemplate extends Skin { $user = $this->getUser(); $title = $this->getTitle(); - $tpl = $this->setupTemplate( $this->template, 'skins' ); + $tpl = $this->setupTemplate( $this->template ); $this->thispage = $title->getPrefixedDBkey(); $this->titletxt = $title->getPrefixedText(); @@ -587,6 +585,7 @@ class SkinTemplate extends Skin { $request = $this->getRequest(); $pageurl = $title->getLocalURL(); $authManager = AuthManager::singleton(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); /* set up the default links for the personal toolbar */ $personal_urls = []; @@ -706,7 +705,7 @@ class SkinTemplate extends Skin { ]; // No need to show Talk and Contributions to anons if they can't contribute! - if ( User::groupHasPermission( '*', 'edit' ) ) { + if ( $permissionManager->groupHasPermission( '*', 'edit' ) ) { // Because of caching, we can't link directly to the IP talk and // contributions pages. Instead we use the special page shortcuts // (which work correctly regardless of caching). This means we can't @@ -734,7 +733,7 @@ class SkinTemplate extends Skin { } if ( $authManager->canAuthenticateNow() ) { - $key = User::groupHasPermission( '*', 'read' ) + $key = $permissionManager->groupHasPermission( '*', 'read' ) ? 'login' : 'login-private'; $personal_urls[$key] = $login_url; @@ -1083,7 +1082,10 @@ class SkinTemplate extends Skin { } // Checks if the user is logged in - if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) { + if ( $this->loggedin && MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasAllRights( $user, 'viewmywatchlist', 'editmywatchlist' ) + ) { /** * The following actions use messages which, if made particular to * the any specific skins, would break the Ajax code which makes this