Extension:EditUser

Usage
This extension displays a preferences form (like the one in Special:Preferences) that allows editing the preferences of other users. You can call the page via Special:EditUser/username to directly edit a user, or Special:EditUser to display a search form.

Download instructions
Please cut and paste the code found below and place it in the respective files. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

addHTML( ' ' . wfMsg( 'textboxsize' ) . ' 			 ' .				wfInputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows ) .				' ' .				wfInputLabel( wfMsg( 'columns' ), 'wpCols', 'wpCols', 3, $this->mCols ) .			" " .			$this->getToggles( array(				'editsection',				'editsectiononrightclick',				'editondblclick',				'editwidth',				'showtoolbar',				'previewonfirst',				'previewontop',				'minordefault',				'externaleditor',				'externaldiff',				$wgLivePreview ? 'uselivepreview' : false,				'forceeditsummary',			) ) . ' '		);

# Recent changes $wgOut->addHtml( ' ' . wfMsgHtml( 'prefs-rc' ) . ' ' ); $rc = ' '; $wgOut->addHtml( $rc ); $wgOut->addHtml( ' ' ); $toggles[] = 'hideminor'; if( $wgRCShowWatchingUsers ) $toggles[] = 'shownumberswatching'; $toggles[] = 'usenewrc'; $wgOut->addHtml( $this->getToggles( $toggles ) );

$wgOut->addHtml( ' ' );

# Watchlist $wgOut->addHtml( ' ' . wfMsgHtml( 'prefs-watchlist' ) . ' ' ); $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) ); $wgOut->addHtml( '

' );

$wgOut->addHtml( $this->getToggle( 'extendwatchlist' ) ); $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) ); $wgOut->addHtml( '

' );

$wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'watchlisthideminor' ) ) ); if( $this->user->isAllowed( 'createpage' ) || $this->user->isAllowed( 'createtalk' ) ) $wgOut->addHtml( $this->getToggle( 'watchcreations' ) ); foreach( array( 'edit' => 'watchdefault', 'move' => 'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) { if( $this->user->isAllowed( $action ) ) $wgOut->addHtml( $this->getToggle( $toggle ) ); }		$this->mUsedToggles['watchcreations'] = true; $this->mUsedToggles['watchdefault'] = true; $this->mUsedToggles['watchmoves'] = true; $this->mUsedToggles['watchdeletion'] = true; $wgOut->addHtml( ' ' );

# Search $ajaxsearch = $wgAjaxSearch ? $this->addRow(				wfLabel( wfMsg( 'useajaxsearch' ), 'wpUseAjaxSearch' ),				wfCheck( 'wpUseAjaxSearch', $this->mUseAjaxSearch, array( 'id' => 'wpUseAjaxSearch' ) )			) : ''; $wgOut->addHTML( ' ' . wfMsg( 'searchresultshead' ) . '   " . wfMsg( 'defaultns' ) . " $ps  " );

# Misc #		$wgOut->addHTML(' ' . wfMsg('prefs-misc') . ' '); $wgOut->addHtml( '' . wfMsg( 'stub-threshold' ) . ' ' ); $wgOut->addHtml( Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) ); $msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) ); $msgUnderlinenever = htmlspecialchars( wfMsg ( 'underline-never' ) ); $msgUnderlinealways = htmlspecialchars( wfMsg ( 'underline-always' ) ); $msgUnderlinedefault = htmlspecialchars( wfMsg ( 'underline-default' ) ); $uopt = $this->user->getOption("underline"); $s0 = $uopt == 0 ? ' selected="selected"' : ''; $s1 = $uopt == 1 ? ' selected="selected"' : ''; $s2 = $uopt == 2 ? ' selected="selected"' : ''; $wgOut->addHTML(" $msgUnderline  $msgUnderlinenever $msgUnderlinealways $msgUnderlinedefault  ");

foreach ( $togs as $tname ) { if( !array_key_exists( $tname, $this->mUsedToggles ) ) { $wgOut->addHTML( $this->getToggle( $tname ) ); }		}		$wgOut->addHTML( ' ' );

wfRunHooks( 'RenderPreferencesForm', array( $this, $wgOut ) ); global $wgUser; $token = htmlspecialchars( $wgUser->editToken ); $skin = $wgUser->getSkin; $wgOut->addHTML( "		tooltipAndAccesskey('save')." />				

 target}\" /> \n" );

$wgOut->addHtml( Xml::tags( 'div', array( 'class' => "prefcache" ), wfMsgExt( 'clearyourcache', 'parseinline' ) )		);

}	function makeSearchForm { $thisTitle = Title::makeTitle( NS_SPECIAL, $this->getName ); $form = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl ) ); $form .= wfElement( 'label', array( 'for' => 'username' ), wfMsg( 'edituser-username' ) ). ' ';		$form .= wfElement( 'input', array( 'type' => 'text', 'name' => 'username', 'id' => 'username', 'value' => $this->target ) ). ' ';		$form .= wfElement( 'input', array( 'type' => 'submit', 'name' => 'dosearch', 'value' => wfMsg( 'edituser-dosearch' ) ) ); $form .= wfElement( 'input', array( 'type' => 'hidden', 'name' => 'issearch', 'value' => '1' ) ); $form .= wfCloseElement( 'form' ); return $form; } }

EditUser.i18n.php
-->