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
Replace usages of deprecated User::isAllowed. Step 2.
[lhc/web/wiklou.git]
/
includes
/
specials
/
pagers
/
BlockListPager.php
diff --git
a/includes/specials/pagers/BlockListPager.php
b/includes/specials/pagers/BlockListPager.php
index
77b7326
..
718da6d
100644
(file)
--- a/
includes/specials/pagers/BlockListPager.php
+++ b/
includes/specials/pagers/BlockListPager.php
@@
-70,6
+70,12
@@
class BlockListPager extends TablePager {
return $headers;
}
return $headers;
}
+ /**
+ * @param string $name
+ * @param string $value
+ * @return string
+ * @suppress PhanTypeArraySuspicious
+ */
function formatValue( $name, $value ) {
static $msg = null;
if ( $msg === null ) {
function formatValue( $name, $value ) {
static $msg = null;
if ( $msg === null ) {
@@
-131,7
+137,11
@@
class BlockListPager extends TablePager {
$value,
/* User preference timezone */true
) );
$value,
/* User preference timezone */true
) );
- if ( $this->getUser()->isAllowed( 'block' ) ) {
+ if ( MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->getUser(), 'block' )
+ ) {
+ $links = [];
if ( $row->ipb_auto ) {
$links[] = $linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'Unblock' ),
if ( $row->ipb_auto ) {
$links[] = $linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'Unblock' ),
@@
-259,6
+269,7
@@
class BlockListPager extends TablePager {
switch ( $restriction->getType() ) {
case PageRestriction::TYPE:
switch ( $restriction->getType() ) {
case PageRestriction::TYPE:
+ '@phan-var PageRestriction $restriction';
if ( $restriction->getTitle() ) {
$items[$restriction->getType()][] = Html::rawElement(
'li',
if ( $restriction->getTitle() ) {
$items[$restriction->getType()][] = Html::rawElement(
'li',
@@
-350,7
+361,10
@@
class BlockListPager extends TablePager {
$info['conds'][] = 'ipb_expiry > ' . $db->addQuotes( $db->timestamp() );
# Is the user allowed to see hidden blocks?
$info['conds'][] = 'ipb_expiry > ' . $db->addQuotes( $db->timestamp() );
# Is the user allowed to see hidden blocks?
- if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->getUser(), 'hideuser' )
+ ) {
$info['conds']['ipb_deleted'] = 0;
}
$info['conds']['ipb_deleted'] = 0;
}