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 "selenium: Remove deprecated legacy methods"
[lhc/web/wiklou.git]
/
includes
/
Autopromote.php
diff --git
a/includes/Autopromote.php
b/includes/Autopromote.php
index
b17f1ab
..
f8f3c24
100644
(file)
--- a/
includes/Autopromote.php
+++ b/
includes/Autopromote.php
@@
-21,6
+21,8
@@
* @file
*/
* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* This class checks if user can get extra rights
* because of conditions specified in $wgAutopromote
/**
* This class checks if user can get extra rights
* because of conditions specified in $wgAutopromote
@@
-185,10
+187,10
@@
class Autopromote {
}
return $user->getEditCount() >= $reqEditCount;
case APCOND_AGE:
}
return $user->getEditCount() >= $reqEditCount;
case APCOND_AGE:
- $age = time() - wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
+ $age = time() -
(int)
wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
return $age >= $cond[1];
case APCOND_AGE_FROM_EDIT:
return $age >= $cond[1];
case APCOND_AGE_FROM_EDIT:
- $age = time() - wfTimestampOrNull( TS_UNIX, $user->getFirstEditTimestamp() );
+ $age = time() -
(int)
wfTimestampOrNull( TS_UNIX, $user->getFirstEditTimestamp() );
return $age >= $cond[1];
case APCOND_INGROUPS:
$groups = array_slice( $cond, 1 );
return $age >= $cond[1];
case APCOND_INGROUPS:
$groups = array_slice( $cond, 1 );
@@
-200,7
+202,9
@@
class Autopromote {
case APCOND_BLOCKED:
return $user->getBlock() && $user->getBlock()->isSitewide();
case APCOND_ISBOT:
case APCOND_BLOCKED:
return $user->getBlock() && $user->getBlock()->isSitewide();
case APCOND_ISBOT:
- return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) );
+ return in_array( 'bot', MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->getGroupPermissions( $user->getGroups() ) );
default:
$result = null;
Hooks::run( 'AutopromoteCondition', [ $cond[0],
default:
$result = null;
Hooks::run( 'AutopromoteCondition', [ $cond[0],