镜像自地址
https://github.com/wikimedia/mediawiki-extensions-CentralAuth
已同步 2024-06-03 02:40:52 +08:00
look up global user rights also for anon users with name set
This allows autocreation of local accounts to work based on global rights. Bug: T316303 Depends-On: I9ffe2d1a59ff8f9b4eb0ab0677c0fdf5200f4b79 Change-Id: I180fe6b197ebd2223f48389b74a40a281d097948
这个提交包含在:
父节点
8ae57d61ce
当前提交
d09f24dcec
|
@ -387,10 +387,15 @@ class CentralAuthHooks implements
|
|||
* @return bool
|
||||
*/
|
||||
public function onUserGetRights( $user, &$rights ) {
|
||||
if ( $user->isRegistered() ) {
|
||||
// checking rights not just for registered users but also for
|
||||
// anon (local) users based on name only will allow autocreation of
|
||||
// local account based on global rights, see T316303
|
||||
$anonUserOK = MediaWikiServices::getInstance()->getMainConfig()->get( 'CentralAuthStrict' );
|
||||
if ( $user->canExist() ) {
|
||||
$centralUser = CentralAuthUser::getInstance( $user );
|
||||
|
||||
if ( $centralUser->exists() && $centralUser->isAttached() ) {
|
||||
if ( $centralUser->exists()
|
||||
&& ( $centralUser->isAttached() || ( $anonUserOK && !$user->isRegistered() ) ) ) {
|
||||
$extraRights = $centralUser->getGlobalRights();
|
||||
|
||||
$rights = array_merge( $extraRights, $rights );
|
||||
|
|
正在加载...
在新工单中引用
屏蔽一个用户