dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add SearchResultTrait"
[lhc/web/wiklou.git]
/
includes
/
skins
/
SkinTemplate.php
diff --git
a/includes/skins/SkinTemplate.php
b/includes/skins/SkinTemplate.php
index
af7ec29
..
f348135
100644
(file)
--- a/
includes/skins/SkinTemplate.php
+++ b/
includes/skins/SkinTemplate.php
@@
-371,7
+371,7
@@
class SkinTemplate extends Skin {
$tpl->set( 'credits', false );
$tpl->set( 'numberofwatchingusers', false );
if ( $title->exists() ) {
$tpl->set( 'credits', false );
$tpl->set( 'numberofwatchingusers', false );
if ( $title->exists() ) {
- if ( $out->isArticle() && $
this
->isRevisionCurrent() ) {
+ if ( $out->isArticle() && $
out
->isRevisionCurrent() ) {
if ( $wgMaxCredits != 0 ) {
/** @var CreditsAction $action */
$action = Action::factory(
if ( $wgMaxCredits != 0 ) {
/** @var CreditsAction $action */
$action = Action::factory(
@@
-585,6
+585,7
@@
class SkinTemplate extends Skin {
$request = $this->getRequest();
$pageurl = $title->getLocalURL();
$authManager = AuthManager::singleton();
$request = $this->getRequest();
$pageurl = $title->getLocalURL();
$authManager = AuthManager::singleton();
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
/* set up the default links for the personal toolbar */
$personal_urls = [];
/* set up the default links for the personal toolbar */
$personal_urls = [];
@@
-704,7
+705,7
@@
class SkinTemplate extends Skin {
];
// No need to show Talk and Contributions to anons if they can't contribute!
];
// 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
// 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
@@
-732,7
+733,7
@@
class SkinTemplate extends Skin {
}
if ( $authManager->canAuthenticateNow() ) {
}
if ( $authManager->canAuthenticateNow() ) {
- $key =
User::
groupHasPermission( '*', 'read' )
+ $key =
$permissionManager->
groupHasPermission( '*', 'read' )
? 'login'
: 'login-private';
$personal_urls[$key] = $login_url;
? 'login'
: 'login-private';
$personal_urls[$key] = $login_url;
@@
-974,7
+975,7
@@
class SkinTemplate extends Skin {
// Whether to show the "Add a new section" tab
// Checks if this is a current rev of talk page and is not forced to be hidden
$showNewSection = !$out->forceHideNewSectionLink()
// Whether to show the "Add a new section" tab
// Checks if this is a current rev of talk page and is not forced to be hidden
$showNewSection = !$out->forceHideNewSectionLink()
- && ( ( $isTalk && $
this
->isRevisionCurrent() ) || $out->showNewSectionLink() );
+ && ( ( $isTalk && $
out
->isRevisionCurrent() ) || $out->showNewSectionLink() );
$section = $request->getVal( 'section' );
if ( $title->exists()
$section = $request->getVal( 'section' );
if ( $title->exists()
@@
-1068,8
+1069,8
@@
class SkinTemplate extends Skin {
}
if ( $title->quickUserCan( 'protect', $user ) && $title->getRestrictionTypes() &&
}
if ( $title->quickUserCan( 'protect', $user ) && $title->getRestrictionTypes() &&
- MediaWikiServices::getInstance()->get
NamespaceInfo()->
-
get
RestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
+ MediaWikiServices::getInstance()->get
PermissionManager()
+
->getNamespace
RestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
) {
$mode = $title->isProtected() ? 'unprotect' : 'protect';
$content_navigation['actions'][$mode] = [
) {
$mode = $title->isProtected() ? 'unprotect' : 'protect';
$content_navigation['actions'][$mode] = [
@@
-1081,7
+1082,10
@@
class SkinTemplate extends Skin {
}
// Checks if the user is logged in
}
// 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
/**
* The following actions use messages which, if made particular to
* the any specific skins, would break the Ajax code which makes this
@@
-1291,7
+1295,7
@@
class SkinTemplate extends Skin {
if ( $out->isArticle() ) {
// Also add a "permalink" while we're at it
if ( $out->isArticle() ) {
// Also add a "permalink" while we're at it
- $revid = $this->getRevisionId();
+ $revid = $this->get
Output()->get
RevisionId();
if ( $revid ) {
$nav_urls['permalink'] = [
'text' => $this->msg( 'permalink' )->text(),
if ( $revid ) {
$nav_urls['permalink'] = [
'text' => $this->msg( 'permalink' )->text(),