父节点
eaec02aa57
当前提交
66494b1ae4
|
@ -123,6 +123,13 @@ class PermissionsHook implements
|
|||
|
||||
$rnrsverified_mode1_2 = $this->checkUserVerifyHash($user);
|
||||
$rnrsverified_mode3 = $this->checkUserGroupAndRights($user);
|
||||
$rnrsverified_has_confirmed_group = in_array(
|
||||
$wgRNRSConfirmedGroup,
|
||||
array_merge(
|
||||
$this->userGroupManager->listAllImplicitGroups(),
|
||||
$this->userGroupManager->listAllGroups()
|
||||
)
|
||||
);
|
||||
|
||||
if (!$this->config->has('RNRSExclusiveRights')) {
|
||||
return true;
|
||||
|
@ -130,42 +137,32 @@ class PermissionsHook implements
|
|||
return true;
|
||||
} else if ($this->permissionManager->userHasRight($user, 'rnrsverify-exempt')) {
|
||||
return true;
|
||||
} else {
|
||||
if ($rnrsverified_mode3) {
|
||||
return true;
|
||||
} else if ($rnrsverified_mode1_2) {
|
||||
$rnrsverified_has_confirmed_group = in_array(
|
||||
$wgRNRSConfirmedGroup,
|
||||
array_merge(
|
||||
$this->userGroupManager->listAllImplicitGroups(),
|
||||
$this->userGroupManager->listAllGroups()
|
||||
)
|
||||
);
|
||||
|
||||
if (
|
||||
$rnrsverified_has_confirmed_group &&
|
||||
!in_array($wgRNRSConfirmedGroup, $this->permissionManager->getUserPermissions($user))
|
||||
) {
|
||||
$this->userGroupManager->addUserToGroup($user, 'rnrsverify-confirmed');
|
||||
}
|
||||
return true;
|
||||
} else if (
|
||||
!$rnrsverified_mode1_2 && !$rnrsverified_mode3 &&
|
||||
in_array($action, $this->config->get('RNRSExclusiveRights'))
|
||||
} else if ($rnrsverified_mode1_2) {
|
||||
if (
|
||||
$rnrsverified_has_confirmed_group &&
|
||||
!in_array($wgRNRSConfirmedGroup, $this->permissionManager->getUserPermissions($user))
|
||||
) {
|
||||
$result = 'rnrshook-action-restricted';
|
||||
return false;
|
||||
};
|
||||
}
|
||||
$this->userGroupManager->addUserToGroup($user, 'rnrsverify-confirmed');
|
||||
}
|
||||
return true;
|
||||
} else if ($rnrsverified_mode3) {
|
||||
return true;
|
||||
} else if (
|
||||
!$rnrsverified_mode1_2 && !$rnrsverified_mode3 &&
|
||||
in_array($action, $this->config->get('RNRSExclusiveRights'))
|
||||
) {
|
||||
$result = 'rnrshook-action-restricted';
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $userId
|
||||
* @param User $user
|
||||
* @param SpecialPage $special
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
/**
|
||||
* @param int $userId
|
||||
* @param User $user
|
||||
* @param SpecialPage $special
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onSpecialContributionsBeforeMainOutput($userId, $user, $special)
|
||||
{
|
||||
global $wgRNRSConfirmedGroup;
|
||||
|
|
正在加载...
在新工单中引用