X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserrights.php;h=4501736f43e9a772713cbb02b45e169a7845b3c8;hb=a60fac96a501754b956897ee91c5cc84d4ec6799;hp=e893455127153442316374de146bdbf4e55d7431;hpb=4abdb946e3aff871921c1565cd252ced05782c8f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index e893455127..4501736f43 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -216,6 +216,8 @@ class UserrightsPage extends SpecialPage { * @return Array: Tuple of added, then removed groups */ function doSaveUserGroups( $user, $add, $remove, $reason = '' ) { + global $wgAuth; + // Validate input set... $isself = ( $user->getName() == $this->getUser()->getName() ); $groups = $user->getGroups(); @@ -251,6 +253,9 @@ class UserrightsPage extends SpecialPage { // Ensure that caches are cleared $user->invalidateCache(); + // update groups in external authentication database + $wgAuth->updateExternalDBGroups( $user, $add, $remove ); + wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) ); wfDebug( 'newGroups: ' . print_r( $newGroups, true ) ); wfRunHooks( 'UserRights', array( &$user, $add, $remove ) ); @@ -558,17 +563,17 @@ class UserrightsPage extends SpecialPage { $allgroups = $this->getAllGroups(); $ret = ''; - # Put all column info into an associative array so that extensions can - # more easily manage it. + // Put all column info into an associative array so that extensions can + // more easily manage it. $columns = array( 'unchangeable' => array(), 'changeable' => array() ); foreach ( $allgroups as $group ) { $set = in_array( $group, $usergroups ); - # Should the checkbox be disabled? + // Should the checkbox be disabled? $disabled = !( ( $set && $this->canRemove( $group ) ) || ( !$set && $this->canAdd( $group ) ) ); - # Do we need to point out that this action is irreversible? + // Do we need to point out that this action is irreversible? $irreversible = !$disabled && ( ( $set && !$this->canAdd( $group ) ) || ( !$set && !$this->canRemove( $group ) ) ); @@ -586,13 +591,14 @@ class UserrightsPage extends SpecialPage { } } - # Build the HTML table + // Build the HTML table $ret .= Xml::openElement( 'table', array( 'class' => 'mw-userrights-groups' ) ) . "\n"; foreach ( $columns as $name => $column ) { if ( $column === array() ) { continue; } + // Messages: userrights-changeable-col, userrights-unchangeable-col $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() ); } $ret .= "\n\n"; @@ -629,8 +635,7 @@ class UserrightsPage extends SpecialPage { * @return bool Can we remove the group? */ private function canRemove( $group ) { - // $this->changeableGroups()['remove'] doesn't work, of course. Thanks, - // PHP. + // $this->changeableGroups()['remove'] doesn't work, of course. Thanks, PHP. $groups = $this->changeableGroups(); return in_array( $group, $groups['remove'] ) || ( $this->isself && in_array( $group, $groups['remove-self'] ) ); }