X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserrights.php;h=127b530e0f72f03addcb4e12164fb3127edda1aa;hb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;hp=b33aa7db321164ec95d804501d7398ba711abd21;hpb=aa3319c4c0e3dab7d4eb9d64e49ccbd403c99b00;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index b33aa7db32..0a712eff21 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -215,7 +215,7 @@ class UserrightsPage extends SpecialPage { * @return bool */ public function canProcessExpiries() { - return !$this->getConfig()->get( 'DisableUserGroupExpiry' ); + return true; } /** @@ -326,8 +326,8 @@ class UserrightsPage extends SpecialPage { * @return array Tuple of added, then removed groups */ function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [], - $groupExpiries = [] ) { - + $groupExpiries = [] + ) { // Validate input set... $isself = $user->getName() == $this->getUser()->getName(); $groups = $user->getGroups(); @@ -344,7 +344,7 @@ class UserrightsPage extends SpecialPage { // UNLESS the user can only add this group (not remove it) and the expiry time // is being brought forward (T156784) $add = array_filter( $add, - function( $group ) use ( $groups, $groupExpiries, $removable, $ugms ) { + function ( $group ) use ( $groups, $groupExpiries, $removable, $ugms ) { if ( isset( $groupExpiries[$group] ) && !in_array( $group, $removable ) && isset( $ugms[$group] ) && @@ -387,7 +387,8 @@ class UserrightsPage extends SpecialPage { $user->invalidateCache(); // update groups in external authentication database - Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(), $reason ] ); + Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(), + $reason, $oldUGMs, $newUGMs ] ); MediaWiki\Auth\AuthManager::callLegacyAuthPlugin( 'updateExternalDBGroups', [ $user, $add, $remove ] ); @@ -432,16 +433,16 @@ class UserrightsPage extends SpecialPage { * @param array $newUGMs Associative array of (group name => UserGroupMembership) */ protected function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, - $oldUGMs, $newUGMs ) { - + $oldUGMs, $newUGMs + ) { // make sure $oldUGMs and $newUGMs are in the same order, and serialise // each UGM object to a simplified array - $oldUGMs = array_map( function( $group ) use ( $oldUGMs ) { + $oldUGMs = array_map( function ( $group ) use ( $oldUGMs ) { return isset( $oldUGMs[$group] ) ? self::serialiseUgmForLog( $oldUGMs[$group] ) : null; }, $oldGroups ); - $newUGMs = array_map( function( $group ) use ( $newUGMs ) { + $newUGMs = array_map( function ( $group ) use ( $newUGMs ) { return isset( $newUGMs[$group] ) ? self::serialiseUgmForLog( $newUGMs[$group] ) : null;