Improve removal of "hide registered users" option on Special:NewPages
Don't remove the option if anonymous users can create talk pages. Bug: T238483 Change-Id: Ia8e555f18c713259b71ce8b88a109f94902d361a
This commit is contained in:
parent
52d9ddc4f2
commit
9ef34a2f1d
1 changed files with 8 additions and 3 deletions
|
|
@ -188,9 +188,7 @@ class SpecialNewpages extends IncludableSpecialPage {
|
|||
}
|
||||
|
||||
// Disable some if needed
|
||||
if ( !MediaWikiServices::getInstance()->getPermissionManager()
|
||||
->groupHasPermission( '*', 'createpage' )
|
||||
) {
|
||||
if ( !$this->canAnonymousUsersCreatePages() ) {
|
||||
unset( $filters['hideliu'] );
|
||||
}
|
||||
if ( !$this->getUser()->useNPPatrol() ) {
|
||||
|
|
@ -544,6 +542,13 @@ class SpecialNewpages extends IncludableSpecialPage {
|
|||
nl2br( htmlspecialchars( $content->serialize() ) ) . "</div>";
|
||||
}
|
||||
|
||||
private function canAnonymousUsersCreatePages() {
|
||||
$pm = MediaWikiServices::getInstance()->getPermissionManager();
|
||||
return ( $pm->groupHasPermission( '*', 'createpage' ) ||
|
||||
$pm->groupHasPermission( '*', 'createtalk' )
|
||||
);
|
||||
}
|
||||
|
||||
protected function getGroupName() {
|
||||
return 'changes';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue