X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fskins%2FSkinTemplate.php;h=cde419777c20a8be92e1af5cefa5a758d44cf641;hp=70df73bc21322601ab7648b5e82ca3d9b4dcf2dc;hb=43fe3f21d48075ebbabcf0825b1520804ca9175e;hpb=e9c6bf46518a09b8fef1f3d0035a9e2e9489a119 diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 70df73bc21..cde419777c 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -595,7 +595,7 @@ class SkinTemplate extends Skin { # $this->getTitle() will just give Special:Badtitle, which is # not especially useful as a returnto parameter. Use the title # from the request instead, if there was one. - if ( $this->getUser()->isAllowed( 'read' ) ) { + if ( $permissionManager->userHasRight( $this->getUser(), 'read' ) ) { $page = $this->getTitle(); } else { $page = Title::newFromText( $request->getVal( 'title', '' ) ); @@ -636,7 +636,7 @@ class SkinTemplate extends Skin { 'active' => ( $href == $pageurl ) ]; - if ( $this->getUser()->isAllowed( 'viewmywatchlist' ) ) { + if ( $permissionManager->userHasRight( $this->getUser(), 'viewmywatchlist' ) ) { $href = self::makeSpecialUrl( 'Watchlist' ); $personal_urls['watchlist'] = [ 'text' => $this->msg( 'mywatchlist' )->text(), @@ -675,6 +675,7 @@ class SkinTemplate extends Skin { if ( $request->getSession()->canSetUser() ) { $personal_urls['logout'] = [ 'text' => $this->msg( 'pt-userlogout' )->text(), + 'data-mw' => 'interface', 'href' => self::makeSpecialUrl( 'Userlogout', // Note: userlogout link must always contain an & character, otherwise we might not be able // to detect a buggy precaching proxy (T19790) @@ -689,9 +690,8 @@ class SkinTemplate extends Skin { $useCombinedLoginLink = false; } - $loginlink = $this->getUser()->isAllowed( 'createaccount' ) && $useCombinedLoginLink - ? 'nav-login-createaccount' - : 'pt-login'; + $loginlink = $permissionManager->userHasRight( $this->getUser(), 'createaccount' ) + && $useCombinedLoginLink ? 'nav-login-createaccount' : 'pt-login'; $login_url = [ 'text' => $this->msg( $loginlink )->text(), @@ -727,7 +727,7 @@ class SkinTemplate extends Skin { if ( $authManager->canCreateAccounts() - && $this->getUser()->isAllowed( 'createaccount' ) + && $permissionManager->userHasRight( $this->getUser(), 'createaccount' ) && !$useCombinedLoginLink ) { $personal_urls['createaccount'] = $createaccount_url; @@ -1074,8 +1074,7 @@ class SkinTemplate extends Skin { if ( $permissionManager->quickUserCan( 'protect', $user, $title ) && $title->getRestrictionTypes() && - $permissionManager->getNamespaceRestrictionLevels( $title->getNamespace(), - $user ) !== [ '' ] + $permissionManager->getNamespaceRestrictionLevels( $title->getNamespace(), $user ) !== [ '' ] ) { $mode = $title->isProtected() ? 'unprotect' : 'protect'; $content_navigation['actions'][$mode] = [ @@ -1345,7 +1344,10 @@ class SkinTemplate extends Skin { 'href' => self::makeSpecialUrlSubpage( 'Log', $rootUser ) ]; - if ( $this->getUser()->isAllowed( 'block' ) ) { + if ( MediawikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->getUser(), 'block' ) + ) { $nav_urls['blockip'] = [ 'text' => $this->msg( 'blockip', $rootUser )->text(), 'href' => self::makeSpecialUrlSubpage( 'Block', $rootUser )