summaryrefslogtreecommitdiff
path: root/includes/SpecialUserrights.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/SpecialUserrights.php')
-rw-r--r--includes/SpecialUserrights.php35
1 files changed, 15 insertions, 20 deletions
diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php
index b17cc4aa..99abd7a7 100644
--- a/includes/SpecialUserrights.php
+++ b/includes/SpecialUserrights.php
@@ -1,11 +1,11 @@
<?php
+
/**
- * Provide an administration interface
- * DO NOT USE: INSECURE.
+ * Special page to allow managing user group membership
*
- * TODO : remove everything related to group editing (SpecialGrouplevels.php)
* @package MediaWiki
- * @subpackage SpecialPage
+ * @subpackage Special pages
+ * @todo This code is disgusting and needs a total rewrite
*/
/** */
@@ -34,7 +34,7 @@ class UserrightsForm extends HTMLForm {
$this->mRequest =& $request;
$this->mName = 'userrights';
- $titleObj = Title::makeTitle( NS_SPECIAL, 'Userrights' );
+ $titleObj = SpecialPage::getTitleFor( 'Userrights' );
$this->action = $titleObj->escapeLocalURL();
}
@@ -89,7 +89,6 @@ class UserrightsForm extends HTMLForm {
$oldGroups = $u->getGroups();
$newGroups = $oldGroups;
- $logcomment = ' ';
// remove then add groups
if(isset($removegroup)) {
$newGroups = array_diff($newGroups, $removegroup);
@@ -119,22 +118,18 @@ class UserrightsForm extends HTMLForm {
}
/**
- * The entry form
- * It allows a user to look for a username and edit its groups membership
+ * Output a form to allow searching for a user
*/
function switchForm() {
- global $wgOut;
-
- // user selection
- $wgOut->addHTML( "<form name=\"uluser\" action=\"$this->action\" method=\"post\">\n" );
- $wgOut->addHTML( $this->fieldset( 'lookup-user',
- $this->textbox( 'user-editname' ) .
- wfElement( 'input', array(
- 'type' => 'submit',
- 'name' => 'ssearchuser',
- 'value' => wfMsg( 'editusergroup' ) ) )
- ));
- $wgOut->addHTML( "</form>\n" );
+ global $wgOut, $wgRequest;
+ $username = $wgRequest->getText( 'user-editname' );
+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'uluser' ) );
+ $form .= '<fieldset><legend>' . wfMsgHtml( 'userrights-lookup-user' ) . '</legend>';
+ $form .= '<p>' . Xml::inputLabel( wfMsg( 'userrights-user-editname' ), 'user-editname', 'username', 30, $username ) . '</p>';
+ $form .= '<p>' . Xml::submitButton( wfMsg( 'editusergroup' ), array( 'name' => 'ssearchuser' ) ) . '</p>';
+ $form .= '</fieldset>';
+ $form .= '</form>';
+ $wgOut->addHTML( $form );
}
/**