X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserrights.php;h=a6b36024e82a32b766968da1c324231dc4e1862d;hb=c18fe7511db2cdb2cd8bdd83ae86ac6c6d389164;hp=26923f745c8448e237c0ebc4b7b708abbbc180eb;hpb=4b4c6f0815a0fb4bfaecc0d58722ac1a2aa4c0de;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 26923f745c..a6b36024e8 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -152,6 +152,10 @@ class UserrightsPage extends SpecialPage { } $targetUser = $status->value; + if ( $targetUser instanceof User ) { // UserRightsProxy doesn't have this method (bug 61252) + $targetUser->clearInstanceCache(); // bug 38989 + } + if ( $request->getVal( 'conflictcheck-originalgroups' ) !== implode( ',', $targetUser->getGroups() ) ) { $out->addWikiMsg( 'userrights-conflict' ); @@ -174,7 +178,7 @@ class UserrightsPage extends SpecialPage { } function getSuccessURL() { - return $this->getTitle( $this->mTarget )->getFullURL( array( 'success' => 1 ) ); + return $this->getPageTitle( $this->mTarget )->getFullURL( array( 'success' => 1 ) ); } /** @@ -405,7 +409,7 @@ class UserrightsPage extends SpecialPage { global $wgScript; $this->getOutput()->addHTML( Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . + Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) . Xml::fieldset( $this->msg( 'userrights-lookup-user' )->text() ) . Xml::inputLabel( $this->msg( 'userrights-user-editname' )->text(), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ), array( 'autofocus' => true ) ) . ' ' . Xml::submitButton( $this->msg( 'editusergroup' )->text() ) . @@ -490,7 +494,7 @@ class UserrightsPage extends SpecialPage { ); $this->getOutput()->addHTML( - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) . + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) . Html::hidden( 'user', $this->mTarget ) . Html::hidden( 'wpEditToken', $this->getUser()->getEditToken( $this->mTarget ) ) . Html::hidden( 'conflictcheck-originalgroups', implode( ',', $user->getGroups() ) ) . // Conflict detection @@ -563,17 +567,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 ) ) ); @@ -591,14 +595,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; } - // Give grep a chance to find the usages: userrights-changeable-col, userrights-unchangeable-col + // Messages: userrights-changeable-col, userrights-unchangeable-col $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() ); } $ret .= "\n\n"; @@ -635,8 +639,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'] ) ); }