* Minor cosmetic changes to Special:Userrights
authorRob Church <robchurch@users.mediawiki.org>
Mon, 25 Dec 2006 04:54:42 +0000 (04:54 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 25 Dec 2006 04:54:42 +0000 (04:54 +0000)
* Earmark for a future rewrite

RELEASE-NOTES
includes/SpecialUserrights.php

index f727b8b..a65e1b9 100644 (file)
@@ -407,6 +407,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   the password never being an obscure value
 * Remove old unused watchlist cache, which was a leftover from the old schema
   where watchlists were more expensive to generate
+* Minor cosmetic changes to Special:Userrights
 
 == Languages updated ==
 
index 0afcb48..2354fcc 100644 (file)
@@ -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 fucking disgusting and needs a total rewrite
  */
 
 /** */
@@ -118,22 +118,19 @@ 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;
+               $self = SpecialPage::getTitleFor( 'Userrights' );
+               $username = $wgRequest->getText( 'user-editname' );
+               $form  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl(), '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 );
        }
 
        /**