rpms/mediawiki-Renameuser/F-10 LICENSE.fedora, NONE, 1.1 README.fedora, NONE, 1.1 RenameUserJob.php, NONE, 1.1 SpecialRenameuser.alias.php, NONE, 1.1 SpecialRenameuser.i18n.php, NONE, 1.1 SpecialRenameuser.php, NONE, 1.1 SpecialRenameuser_body.php, NONE, 1.1 mediawiki-Renameuser.spec, NONE, 1.1

John T. Guthrie III guthrie at fedoraproject.org
Fri Jun 26 05:28:24 UTC 2009


Author: guthrie

Update of /cvs/extras/rpms/mediawiki-Renameuser/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3194/F-10

Added Files:
	LICENSE.fedora README.fedora RenameUserJob.php 
	SpecialRenameuser.alias.php SpecialRenameuser.i18n.php 
	SpecialRenameuser.php SpecialRenameuser_body.php 
	mediawiki-Renameuser.spec 
Log Message:
Initial import of the mediawiki-Renameuser package into the F-10 and F-11
branches.



--- NEW FILE LICENSE.fedora ---
>From guthrie at counterexample.org  Tue Apr 21 18:40:12 2009
Return-Path: <guthrie at counterexample.org>
Date: Tue, 21 Apr 2009 18:39:55 -0400
From: "John T. Guthrie III" <guthrie at counterexample.org>
Message-Id: <200904212239.n3LMdtUG026077 at gauss.counterexample.org>
To: avarab at gmail.com
Subject: Question about licensing for the Renameuser mediawiki extension
Cc: guthrie at counterexample.org

Ævar,

I was wondering how the Renameuser extension for mediawiki is licensed.  I am
trying to pcakage it for Fedora, and the licensing is not very clear.  The
home page for the extension says that there is no license specified, and only
one of the files has a licensing comment in it.  (SpecialRenameuser.php where it
says that the license is GPL 2.0 or greater.)  I would like to verify that that
license is accurate for all of the files.

Thanks.

John Guthrie
guthrie at counterexample.org

>From avarab at gmail.com  Wed Apr 22 03:24:53 2009
Return-Path: <avarab at gmail.com>
MIME-Version: 1.0
In-Reply-To: <200904212239.n3LMdtUG026077 at gauss.counterexample.org>
References: <200904212239.n3LMdtUG026077 at gauss.counterexample.org>
Date: Wed, 22 Apr 2009 01:55:25 +0000
Message-ID: <51dd1af80904211855u7fbd61c8kdc61b4a6d02eafcb at mail.gmail.com>
Subject: Re: Question about licensing for the Renameuser mediawiki extension
From: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= <avarab at gmail.com>
To: "John T. Guthrie III" <guthrie at counterexample.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 21, 2009 at 10:39 PM, John T. Guthrie III
<guthrie at counterexample.org> wrote:
> =C3=86var,
>
> I was wondering how the Renameuser extension for mediawiki is licensed. =
=C2=A0I am
> trying to pcakage it for Fedora, and the licensing is not very clear. =C2=
=A0The
> home page for the extension says that there is no license specified, and =
only
> one of the files has a licensing comment in it. =C2=A0(SpecialRenameuser.=
php where it
> says that the license is GPL 2.0 or greater.) =C2=A0I would like to verif=
y that that
> license is accurate for all of the files.

(I haven't maintained it in years)

When I initially wrote it it was GPL 2.0 or later, since then it seems
to have been split into multiple files as you've noted.

Some of these (e.g. SpecialRenameuser_body.php) are obviously derived
work and under GPLv2 or later too, but other parts like
RenameUserJob.php I did not write at all. So I can't speak for those,
or whether all of this is considered one program and therefore under
GPLv2 or later.

>From guthrie at counterexample.org  Thu Apr 23 00:21:13 2009
Return-Path: <guthrie at counterexample.org>
Date: Thu, 23 Apr 2009 00:21:00 -0400
From: "John T. Guthrie III" <guthrie at counterexample.org>
Message-Id: <200904230421.n3N4L0kn020641 at gauss.counterexample.org>
To: jschulz_4587 at msn.com
Subject: Question regarding Renameuser licensing
Cc: guthrie at counterexample.org

Aaron,

My name is John Guthrie, and I am in the process of packaging the RenameUser
mediawiki extension for Fedora Linux.  I am wondering about how some of the
files in the package are licensed.  I am contacting you because you are listed
as one of the authors for the package according to the $wgExtensionCredits
variable in the SpecialRenameuser.php file.

I have talked to the other listed author, Aevar Bjarmson, who, if I understand
correctly, first created the extension.  He has said that when he first created
the extension, that he placed the code under GPLv2 and later.  Later on, the
extension was split into multiple files.  Several of those files, namely
the one of the form Special*, seem to be derived from the original
SpecialRenameUser.php file, and therefore are also covered under the same
license.

However, Aevar said that he had never touched the RenameUserJob.php file.  Since
you were the other listed author for the extension, and since you seem to have
made the most commits by far to the RenameUserJob.php file, I thought that
I would ask you about the licensing of that file.  Do you know anything about
the history or licensing about that file?  Do you have any other comments
regarding the licensing of the other files as well?

Thank you very much.

Sincerely,

John Guthrie
guthrie at counterexample.org

>From jschulz_4587 at msn.com  Thu Apr 23 13:43:12 2009
Return-Path: <jschulz_4587 at msn.com>
X-Originating-IP: [164.107.218.33]
X-Originating-Email: [jschulz_4587 at msn.com]
Message-ID: <SNT106-DS8217A1205D8E65071235BE5750 at phx.gbl>
From: "Aaron Schulz" <JSchulz_4587 at msn.com>
In-Reply-To: <200904230421.n3N4L0kn020641 at gauss.counterexample.org>
To: "John T. Guthrie III" <guthrie at counterexample.org>
References: <200904230421.n3N4L0kn020641 at gauss.counterexample.org>
Subject: Re: Question regarding Renameuser licensing
Date: Thu, 23 Apr 2009 03:15:49 -0400
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit

I guess I could put it on there, but it is "GNU General Public License 2.0 
or later". Often just the main extension entry point file has the license, 
and anything with it that's not specified to be otherwise is meant to be the 
same.

-Aaron

--------------------------------------------------
From: "John T. Guthrie III" <guthrie at counterexample.org>
Sent: Thursday, April 23, 2009 12:21 AM
To: <jschulz_4587 at msn.com>
Cc: <guthrie at counterexample.org>
Subject: Question regarding Renameuser licensing

> Aaron,
>
> My name is John Guthrie, and I am in the process of packaging the 
> RenameUser
> mediawiki extension for Fedora Linux.  I am wondering about how some of 
> the
> files in the package are licensed.  I am contacting you because you are 
> listed
> as one of the authors for the package according to the $wgExtensionCredits
> variable in the SpecialRenameuser.php file.
>
> I have talked to the other listed author, Aevar Bjarmson, who, if I 
> understand
> correctly, first created the extension.  He has said that when he first 
> created
> the extension, that he placed the code under GPLv2 and later.  Later on, 
> the
> extension was split into multiple files.  Several of those files, namely
> the one of the form Special*, seem to be derived from the original
> SpecialRenameUser.php file, and therefore are also covered under the same
> license.
>
> However, Aevar said that he had never touched the RenameUserJob.php file. 
> Since
> you were the other listed author for the extension, and since you seem to 
> have
> made the most commits by far to the RenameUserJob.php file, I thought that
> I would ask you about the licensing of that file.  Do you know anything 
> about
> the history or licensing about that file?  Do you have any other comments
> regarding the licensing of the other files as well?
>
> Thank you very much.
>
> Sincerely,
>
> John Guthrie
> guthrie at counterexample.org
> 

>From guthrie at counterexample.org  Thu Apr 23 14:06:18 2009
Return-Path: <guthrie at counterexample.org>
From: "John T. Guthrie III" <guthrie at counterexample.org>
Message-Id: <200904231805.n3NI5IMe004335 at gauss.counterexample.org>
Subject: Re: Question regarding Renameuser licensing
To: JSchulz_4587 at msn.com (Aaron Schulz)
Date: Thu, 23 Apr 2009 14:05:18 -0400 (EDT)
Cc: guthrie at counterexample.org (John Guthrie)
In-Reply-To: <SNT106-DS8217A1205D8E65071235BE5750 at phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Would it be possible to place it in the "License" field on the extension web
page,

http://www.mediawiki.org/wiki/Extension:Renameuser

The license there is listed as "No license specified", and I think that
is contributing to the confusion.  (Or I could do it myself as well.)

Thank you very much.

John Guthrie
guthrie at counterexample.org

Aaron Schulz <jschulz_4587 at msn.com> wrote:
> I guess I could put it on there, but it is "GNU General Public License 2.0 
> or later". Often just the main extension entry point file has the license, 
> and anything with it that's not specified to be otherwise is meant to be the 
> same.
> 
> -Aaron
> 
> --------------------------------------------------
> From: "John T. Guthrie III" <guthrie at counterexample.org>
> Sent: Thursday, April 23, 2009 12:21 AM
> To: <jschulz_4587 at msn.com>
> Cc: <guthrie at counterexample.org>
> Subject: Question regarding Renameuser licensing
> 
> > Aaron,
> >
> > My name is John Guthrie, and I am in the process of packaging the 
> > RenameUser
> > mediawiki extension for Fedora Linux.  I am wondering about how some of 
> > the
> > files in the package are licensed.  I am contacting you because you are 
> > listed
> > as one of the authors for the package according to the $wgExtensionCredits
> > variable in the SpecialRenameuser.php file.
> >
> > I have talked to the other listed author, Aevar Bjarmson, who, if I 
> > understand
> > correctly, first created the extension.  He has said that when he first 
> > created
> > the extension, that he placed the code under GPLv2 and later.  Later on, 
> > the
> > extension was split into multiple files.  Several of those files, namely
> > the one of the form Special*, seem to be derived from the original
> > SpecialRenameUser.php file, and therefore are also covered under the same
> > license.
> >
> > However, Aevar said that he had never touched the RenameUserJob.php file. 
> > Since
> > you were the other listed author for the extension, and since you seem to 
> > have
> > made the most commits by far to the RenameUserJob.php file, I thought that
> > I would ask you about the licensing of that file.  Do you know anything 
> > about
> > the history or licensing about that file?  Do you have any other comments
> > regarding the licensing of the other files as well?
> >
> > Thank you very much.
> >
> > Sincerely,
> >
> > John Guthrie
> > guthrie at counterexample.org

>From jschulz_4587 at msn.com  Thu Apr 23 16:52:27 2009
Return-Path: <jschulz_4587 at msn.com>
X-Originating-IP: [164.107.218.33]
X-Originating-Email: [jschulz_4587 at msn.com]
Message-ID: <SNT106-DS1385380100492953308312E5750 at phx.gbl>
From: "Aaron Schulz" <JSchulz_4587 at msn.com>
In-Reply-To: <200904231805.n3NI5IMe004335 at gauss.counterexample.org>
To: "John T. Guthrie III" <guthrie at counterexample.org>
References: <200904231805.n3NI5IMe004335 at gauss.counterexample.org>
Subject: Re: Question regarding Renameuser licensing
Date: Thu, 23 Apr 2009 14:28:05 -0400
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit

Yes, it is a wiki :)

-Aaron

--------------------------------------------------
From: "John T. Guthrie III" <guthrie at counterexample.org>
Sent: Thursday, April 23, 2009 2:05 PM
To: "Aaron Schulz" <JSchulz_4587 at msn.com>
Cc: "John Guthrie" <guthrie at counterexample.org>
Subject: Re: Question regarding Renameuser licensing

> Would it be possible to place it in the "License" field on the extension 
> web
> page,
>
> http://www.mediawiki.org/wiki/Extension:Renameuser
>
> The license there is listed as "No license specified", and I think that
> is contributing to the confusion.  (Or I could do it myself as well.)
>
> Thank you very much.
>
> John Guthrie
> guthrie at counterexample.org
>
> Aaron Schulz <jschulz_4587 at msn.com> wrote:
>> I guess I could put it on there, but it is "GNU General Public License 
>> 2.0
>> or later". Often just the main extension entry point file has the 
>> license,
>> and anything with it that's not specified to be otherwise is meant to be 
>> the
>> same.
>>
>> -Aaron
>>
>> --------------------------------------------------
>> From: "John T. Guthrie III" <guthrie at counterexample.org>
>> Sent: Thursday, April 23, 2009 12:21 AM
>> To: <jschulz_4587 at msn.com>
>> Cc: <guthrie at counterexample.org>
>> Subject: Question regarding Renameuser licensing
>>
>> > Aaron,
>> >
>> > My name is John Guthrie, and I am in the process of packaging the
>> > RenameUser
>> > mediawiki extension for Fedora Linux.  I am wondering about how some of
>> > the
>> > files in the package are licensed.  I am contacting you because you are
>> > listed
>> > as one of the authors for the package according to the 
>> > $wgExtensionCredits
>> > variable in the SpecialRenameuser.php file.
>> >
>> > I have talked to the other listed author, Aevar Bjarmson, who, if I
>> > understand
>> > correctly, first created the extension.  He has said that when he first
>> > created
>> > the extension, that he placed the code under GPLv2 and later.  Later 
>> > on,
>> > the
>> > extension was split into multiple files.  Several of those files, 
>> > namely
>> > the one of the form Special*, seem to be derived from the original
>> > SpecialRenameUser.php file, and therefore are also covered under the 
>> > same
>> > license.
>> >
>> > However, Aevar said that he had never touched the RenameUserJob.php 
>> > file.
>> > Since
>> > you were the other listed author for the extension, and since you seem 
>> > to
>> > have
>> > made the most commits by far to the RenameUserJob.php file, I thought 
>> > that
>> > I would ask you about the licensing of that file.  Do you know anything
>> > about
>> > the history or licensing about that file?  Do you have any other 
>> > comments
>> > regarding the licensing of the other files as well?
>> >
>> > Thank you very much.
>> >
>> > Sincerely,
>> >
>> > John Guthrie
>> > guthrie at counterexample.org
> 

>From guthrie at counterexample.org  Tue May  5 02:22:32 2009
Return-Path: <guthrie at counterexample.org>
From: "John T. Guthrie III" <guthrie at counterexample.org>
Message-Id: <200905050622.n456MU8K016884 at gauss.counterexample.org>
Subject: Re: Question regarding Renameuser licensing
To: JSchulz_4587 at msn.com (Aaron Schulz), avarab at gmail.com
Date: Tue, 5 May 2009 02:22:29 -0400 (EDT)
Cc: guthrie at counterexample.org (John Guthrie)
In-Reply-To: <SNT106-DS1385380100492953308312E5750 at phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Aaron and Aevar,

Just as an FYI, I have set the "license" field to GPLv2.0+ in the infobox
on the Renameuser extension page,
http://www.mediawiki.org/wiki/Extension:Renameuser.  Feel free to revert
if this was not a good thing to do.

John Guthrie
guthrie at counterexample.org

Aaron Schulz <JSchulz_4587 at msn.com> wrote:
> Yes, it is a wiki :)
> 
> -Aaron
> 
> --------------------------------------------------
> From: "John T. Guthrie III" <guthrie at counterexample.org>
> Sent: Thursday, April 23, 2009 2:05 PM
> To: "Aaron Schulz" <JSchulz_4587 at msn.com>
> Cc: "John Guthrie" <guthrie at counterexample.org>
> Subject: Re: Question regarding Renameuser licensing
> 
> > Would it be possible to place it in the "License" field on the extension 
> > web
> > page,
> >
> > http://www.mediawiki.org/wiki/Extension:Renameuser
> >
> > The license there is listed as "No license specified", and I think that
> > is contributing to the confusion.  (Or I could do it myself as well.)
> >
> > Thank you very much.
> >
> > John Guthrie
> > guthrie at counterexample.org
> >
> > Aaron Schulz <jschulz_4587 at msn.com> wrote:
> >> I guess I could put it on there, but it is "GNU General Public License 
> >> 2.0
> >> or later". Often just the main extension entry point file has the 
> >> license,
> >> and anything with it that's not specified to be otherwise is meant to be 
> >> the
> >> same.
> >>
> >> -Aaron



--- NEW FILE README.fedora ---
To complete installation of Renameuser, add the following line to
LocalSettings.php:

  require_once "$IP/extensions/Renameuser/SpecialRenameuser.php";

for each MediaWiki instance you wish to install Renameuser on.

This extension creates a Special:Renameuser page which will allow you to change
a user's name and move their talk pages and subpages as desired.


--- NEW FILE RenameUserJob.php ---
<?php

/**
 * Custom job to perform updates on tables in busier environments
 */
class RenameUserJob extends Job {

	/**
	 * Constructor
	 *
	 * @param Title $title Associated title
	 * @param array $params Job parameters
	 */
	public function __construct( $title, $params ) {
		parent::__construct( 'renameUser', $title, $params );
	}

	/**
	 * Execute the job
	 *
	 * @return bool
	 */
	public function run() {
		$dbw = wfGetDB( DB_MASTER );
		extract( $this->params );
		# Conditions like "*_user_text = 'x'
		$conds = array( $column => $oldname );
		# If user ID given, add that to condition to avoid rename collisions.
		if( isset($userID) ) {
			$conds[$uidColumn] = $userID;
		}
		# Bound by timestamp if given
		if( isset($timestampColumn) ) {
			$conds[] = "$timestampColumn >= '$minTimestamp'";
			$conds[] = "$timestampColumn <= '$maxTimestamp'";
		# Otherwise, bound by key (B/C)
		} else if( isset($uniqueKey) ) {
			$conds[$uniqueKey] = $keyId;
		} else {
			wfDebug( 'RenameUserJob::run - invalid job row given' ); // this shouldn't happen
			return false;
		}
		# Update a chuck of rows!
		$dbw->update( $table,
			array( $column => $newname ),
			$conds,
			__METHOD__
		);
		# Special case: revisions may be deleted while renaming...
		if( $table == 'revision' && isset($timestampColumn) ) {
			$actual = $dbw->affectedRows();
			# If some revisions were not renamed, they may have been deleted.
			# Do a pass on the archive table to get these straglers...
			if( $actual < $count ) {
				$dbw->update( 'archive',
					array( 'ar_user_text' => $newname ),
					array( 'ar_user_text' => $oldname,
						'ar_user' => $userID,
						// No user,rev_id index, so use timestamp to bound
						// the rows. This can use the user,timestamp index.
						"ar_timestamp >= '$minTimestamp'",
						"ar_timestamp <= '$maxTimestamp'"),
					__METHOD__
				);
			}
		}
		# Special case: revisions may be restored while renaming...
		if( $table == 'archive' && isset($timestampColumn) ) {
			$actual = $dbw->affectedRows();
			# If some revisions were not renamed, they may have been restored.
			# Do a pass on the revision table to get these straglers...
			if( $actual < $count ) {
				$dbw->update( 'revision',
					array( 'rev_user_text' => $newname ),
					array( 'rev_user_text' => $oldname,
						'rev_user' => $userID,
						// No user,rev_id index, so use timestamp to bound
						// the rows. This can use the user,timestamp index.
						"rev_timestamp >= '$minTimestamp'",
						"rev_timestamp <= '$maxTimestamp'"),
					__METHOD__
				);
			}
		}
		return true;
	}

}

--- NEW FILE SpecialRenameuser.alias.php ---
<?php
/**
 * Aliases for Special:Renameuser
 *
 * @addtogroup Extensions
 */

$aliases = array();

/** English
 * @author Jon Harald Søby
 */
$aliases['en'] = array(
    'Renameuser' => array( 'RenameUser' ),
);

/** Arabic (العربية)
 * @author Meno25
 */
$aliases['ar'] = array(
	'Renameuser' => array( 'إعادة_تسمية_مستخدم' ),
);

/** Egyptian Spoken Arabic (مصرى)
 * @author Meno25
 */
$aliases['arz'] = array(
	'Renameuser' => array( 'إعادة_تسمية_مستخدم' ),
);

/** Bosnian (Bosanski) */
$aliases['bs'] = array(
	'Renameuser' => array( 'PreimenovanjeKorisnika' ),
);

/** Catalan (Català) */
$aliases['ca'] = array(
	'Renameuser' => array( 'Reanomena usuari' ),
);

/** German (Deutsch)
 * @author Raimond Spekking
 */
$aliases['de'] = array(
	'Renameuser' => array( 'Benutzer umbenennen' ),
);

/** Lower Sorbian (Dolnoserbski) */
$aliases['dsb'] = array(
	'Renameuser' => array( 'Wužywarja pśemjeniś' ),
);

/** Divehi (ދިވެހިބަސް) */
$aliases['dv'] = array(
	'Renameuser' => array( 'މެމްބަރުގެ ނަން ބަދަލު ކުރައްވާ' ),
);

/** Spanish (Español) */
$aliases['es'] = array(
	'Renameuser' => array( 'Cambiar_el_nombre_de_usuario', 'Renombrar_usuario', 'Cambiar_nombre_usuario' ),
);

/** Finnish (Suomi) */
$aliases['fi'] = array(
	'Renameuser' => array( 'Käyttäjätunnusten nimeäminen' ),
);

/** French (Français) */
$aliases['fr'] = array(
	'Renameuser' => array( 'Renommer utilisateur', 'RenommerUtilisateur', 'Renommer Utilisateur' ),
);

/** Franco-Provençal (Arpetan) */
$aliases['frp'] = array(
	'Renameuser' => array( "Renomar l'utilisator", 'RenomarLUtilisator' ),
);

/** Galician (Galego) */
$aliases['gl'] = array(
	'Renameuser' => array( 'Renomear usuario' ),
);

/** Swiss German (Alemannisch) */
$aliases['gsw'] = array(
	'Renameuser' => array( 'Benutzer e andre Name gee' ),
);

/** Hebrew (עברית)
 * @author Rotem Liss
 */
$aliases['he'] = array(
	'Renameuser' => array( 'שינוי_שם_משתמש' ),
);

/** Croatian (Hrvatski) */
$aliases['hr'] = array(
	'Renameuser' => array( 'Preimenuj_suradnika' ),
);

/** Upper Sorbian (Hornjoserbsce) */
$aliases['hsb'] = array(
	'Renameuser' => array( 'Wužiwarja přemjenować' ),
);

/** Haitian (Kreyòl ayisyen) */
$aliases['ht'] = array(
	'Renameuser' => array( 'RenonmeItilizatè' ),
);

/** Hungarian (Magyar) */
$aliases['hu'] = array(
	'Renameuser' => array( 'Szerkesztő átnevezése' ),
);

/** Interlingua (Interlingua) */
$aliases['ia'] = array(
	'Renameuser' => array( 'Renominar usator' ),
);

/** Indonesian (Bahasa Indonesia) */
$aliases['id'] = array(
	'Renameuser' => array( 'Ganti nama pengguna' ),
);

/** Italian (Italiano) */
$aliases['it'] = array(
	'Renameuser' => array( 'RinominaUtente' ),
);

/** Japanese (日本語) */
$aliases['ja'] = array(
	'Renameuser' => array( '利用者名の変更' ),
);

/** Khmer (ភាសាខ្មែរ) */
$aliases['km'] = array(
	'Renameuser' => array( 'ប្ដូរឈ្មោះអ្នកប្រើប្រាស់' ),
);

/** Korean (한국어) */
$aliases['ko'] = array(
	'Renameuser' => array( '이름바꾸기', '계정이름바꾸기', '사용자이름바꾸기' ),
);

/** Ripoarisch (Ripoarisch) */
$aliases['ksh'] = array(
	'Renameuser' => array( 'Metmaacher ömnänne', 'Medmaacher ömnänne', 'Metmaacher ömnenne', 'Medmaacher ömnenne', 'Metmaacher ömdäufe', 'Medmaacher ömdäufe' ),
);

/** Latin (Latina) */
$aliases['la'] = array(
	'Renameuser' => array( 'Usorem renominare' ),
);

/** Luxembourgish (Lëtzebuergesch) */
$aliases['lb'] = array(
	'Renameuser' => array( 'Benotzer ëmbenennen' ),
);

/** Macedonian (Македонски) */
$aliases['mk'] = array(
	'Renameuser' => array( 'ПреименувајКорисник' ),
);

/** Malay (Bahasa Melayu) */
$aliases['ms'] = array(
	'Renameuser' => array( 'Tukar nama pengguna' ),
);

/** Nedersaksisch (Nedersaksisch) */
$aliases['nds-nl'] = array(
	'Renameuser' => array( 'Gebruker_herneumen' ),
);

/** Dutch (Nederlands) */
$aliases['nl'] = array(
	'Renameuser' => array( 'GebruikerHernoemen' ),
);

/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
 * @author Jon Harald Søby
 */
$aliases['no'] = array(
	'Renameuser' => array( 'Gi en bruker nytt navn' ),
);

/** Occitan (Occitan) */
$aliases['oc'] = array(
	'Renameuser' => array( 'TornarNomenarUtilizaire', 'Tornar nomenar Utilizaire' ),
);

/** Polish (Polski) */
$aliases['pl'] = array(
	'Renameuser' => array( 'Zmiana nazwy użytkownika' ),
);

/** Pashto (پښتو) */
$aliases['ps'] = array(
	'Renameuser' => array( 'دکارونکي نوم بدلون' ),
);

/** Portuguese (Português) */
$aliases['pt'] = array(
	'Renameuser' => array( 'Renomear utilizador', 'Renomear usuário' ),
);

/** Brazilian Portuguese (Português do Brasil) */
$aliases['pt-br'] = array(
	'Renameuser' => array( 'Renomear utilizador', 'Renomear usuário' ),
);

/** Romanian (Română) */
$aliases['ro'] = array(
	'Renameuser' => array( 'Redenumire utilizator' ),
);

/** Albanian (Shqip) */
$aliases['sq'] = array(
	'Renameuser' => array( 'RiemërtoPërdorues' ),
);

/** Swedish (Svenska) */
$aliases['sv'] = array(
	'Renameuser' => array( 'Användarnamnbyte' ),
);

/** Swahili (Kiswahili) */
$aliases['sw'] = array(
	'Renameuser' => array( 'BadilishajinalaMtumiaji' ),
);

/** Thai (ไทย) */
$aliases['th'] = array(
	'Renameuser' => array( 'เปลี่ยนชื่อผู้ใช้' ),
);

/** Tagalog (Tagalog) */
$aliases['tl'] = array(
	'Renameuser' => array( 'Muling pangalan ang tagagamit' ),
);



--- NEW FILE SpecialRenameuser.i18n.php ---
<?php
/**
 * Internationalisation file for extension Renameuser.
 *
 * @addtogroup Extensions
*/

$messages = array();

$messages['en'] = array(
	'renameuser'          => 'Rename user',
	'renameuser-desc'     => 'Adds a [[Special:Renameuser|special page]] to rename a user (need \'\'renameuser\'\' right)',
	'renameuser-summary' => '', # do not translate or duplicate this message to other languages
	'renameuserold'       => 'Current username:',
	'renameusernew'       => 'New username:',
	'renameuserreason'    => 'Reason for rename:',
	'renameusermove'      => 'Move user and talk pages (and their subpages) to new name',
	'renameuserreserve'   => 'Block the old username from future use',
	'renameuserwarnings'  => 'Warnings:',
	'renameuserconfirm'   => 'Yes, rename the user',
	'renameusersubmit'    => 'Submit',

	'renameusererrordoesnotexist' => 'The user "<nowiki>$1</nowiki>" does not exist.',
	'renameusererrorexists'       => 'The user "<nowiki>$1</nowiki>" already exists.',
	'renameusererrorinvalid'      => 'The username "<nowiki>$1</nowiki>" is invalid.',
	'renameusererrortoomany'      => 'The user "<nowiki>$1</nowiki>" has $2 {{PLURAL:$2|contribution|contributions}}, renaming a user with more than $3 {{PLURAL:$3|contribution|contributions}} could adversely affect site performance.',
	'renameuser-error-request'    => 'There was a problem with receiving the request.
Please go back and try again.',
	'renameuser-error-same-user'  => 'You cannot rename a user to the same thing as before.',
	'renameusersuccess'           => 'The user "<nowiki>$1</nowiki>" has been renamed to "<nowiki>$2</nowiki>".',

	'renameuser-page-exists'  => 'The page $1 already exists and cannot be automatically overwritten.',
	'renameuser-page-moved'   => 'The page $1 has been moved to $2.',
	'renameuser-page-unmoved' => 'The page $1 could not be moved to $2.',

	'renameuserlogpage'     => 'User rename log',
	'renameuserlogpagetext' => 'This is a log of changes to user names.',
	'renameuserlogentry'    => 'renamed $1 to "$2"',
	'renameuser-log'        => '{{PLURAL:$1|1 edit|$1 edits}}. Reason: $2',
	'renameuser-move-log'   => 'Automatically moved page while renaming the user "[[User:$1|$1]]" to "[[User:$2|$2]]"',

	'right-renameuser'      => 'Rename users',
);

/** Message documentation (Message documentation)
 * @author Jon Harald Søby
 * @author Meno25
 * @author SPQRobin
 */
$messages['qqq'] = array(
	'renameuser-desc' => 'Short description of the Renameuser extension, shown on [[Special:Version]]. Do not translate or change links.',
	'renameuserreserve' => 'Option to block the old username (after it has been renamed) from being used again.',
	'renameusersubmit' => '{{Identical|Submit}}',
	'renameuserlogentry' => 'Used in [[Special:Log/renameuser]].
* Parameter $1 is the original username
* Parameter $2 is the new username',
	'right-renameuser' => '{{doc-right}}',
);

/** Afrikaans (Afrikaans)
 * @author Naudefj
 * @author SPQRobin
 */
$messages['af'] = array(
	'renameuser' => 'Hernoem gebruiker',
	'renameuser-desc' => "Herdoop gebruikers (benodig ''renameuser'' regte)",
	'renameuserold' => 'Huidige gebruikersnaam:',
	'renameusernew' => 'Nuwe gebruikersnaam:',
	'renameuserreason' => 'Rede vir hernoeming:',
	'renameuserwarnings' => 'Waarskuwings:',
	'renameusersubmit' => 'Hernoem',
	'renameusererrordoesnotexist' => 'Die gebruiker "<nowiki>$1</nowiki>" bestaan nie',
	'renameusererrorexists' => 'Die gebruiker "<nowiki>$1</nowiki>" bestaan reeds',
	'renameusererrorinvalid' => '"<nowiki>$1</nowiki>" is \'n ongeldige gebruikernaam',
	'renameusersuccess' => 'Die gebruiker "<nowiki>$1</nowiki>" is hernoem na "<nowiki>$2</nowiki>".',
	'renameuserlogpage' => 'Logboek van gebruikershernoemings',
	'right-renameuser' => 'Hernoem gebruikers',
);

/** Aragonese (Aragonés)
 * @author Juanpabl
 * @author SMP
 */
$messages['an'] = array(
	'renameuser' => 'Renombrar un usuario',
	'renameuser-desc' => "Renombrar un usuario (amenista os dreitos de ''renameuser'')",
	'renameuserold' => 'Nombre autual:',
	'renameusernew' => 'Nombre nuebo:',
	'renameuserreason' => "Razón d'o cambeo de nombre:",
	'renameusermove' => "Tresladar as pachinas d'usuario y de descusión (y as suyas sozpachinas) ta o nuebo nombre",
	'renameuserwarnings' => 'Albertenzias:',
	'renameuserconfirm' => "Sí, quiero cambiar o nombre de l'usuario",
	'renameusersubmit' => 'Nimbiar',
	'renameusererrordoesnotexist' => 'L\'usuario "<nowiki>$1</nowiki>" no esiste.',
	'renameusererrorexists' => 'L\'usuario "<nowiki>$1</nowiki>" ya esiste.',
	'renameusererrorinvalid' => 'O nombre d\'usuario "<nowiki>$1</nowiki>" no ye conforme.',
	'renameusererrortoomany' => 'L\'usuario "<nowiki>$1</nowiki>" tiene $2 {{PLURAL:$2|contrebuzión|contrebuzions}}. Si renombra un usuario con más de $3 {{PLURAL:$3|contrebuzión|contrebuzions}} podría afeutar ta o funzionamiento d\'o sitio.',
	'renameuser-error-request' => 'Bi abió un problema reculliendo a demanda. Por fabor, torne entazaga y prebe una atra begada.',
	'renameuser-error-same-user' => 'No puede renombrar un usuario con o mesmo nombre que ya teneba.',
	'renameusersuccess' => 'S\'ha renombrau l\'usuario "<nowiki>$1</nowiki>" como "<nowiki>$2</nowiki>".',
	'renameuser-page-exists' => 'A pachina $1 ya esiste y no puede estar sustituyita automaticament.',
	'renameuser-page-moved' => "S'ha tresladato a pachina $1 ta $2.",
	'renameuser-page-unmoved' => "A pachina $1 no s'ha puesto tresladar ta $2.",
	'renameuserlogpage' => "Rechistro de cambios de nombre d'usuarios",
	'renameuserlogpagetext' => "Isto ye un rechistro de cambios de nombres d'usuarios",
	'renameuserlogentry' => 'Renombrato $1 como "$2"',
	'renameuser-log' => '{{PLURAL:$1|1 edizión|$1 edizions}}. Razón: $2',
	'renameuser-move-log' => 'Pachina tresladata automaticament en renombrar o usuario "[[User:$1|$1]]" como "[[User:$2|$2]]"',
	'right-renameuser' => 'Renombrar usuarios',
);

/** Old English (Anglo-Saxon)
 * @author Spacebirdy
 */
$messages['ang'] = array(
	'renameuser' => 'Ednemnan brūcend',
);

/** Arabic (العربية)
 * @author Meno25
 * @author Mido
 */
$messages['ar'] = array(
	'renameuser' => 'إعادة تسمية مستخدم',
	'renameuser-desc' => "يضيف [[Special:Renameuser|صفحة خاصة]] لإعادة تسمية مستخدم (يحتاج إلى صلاحية ''renameuser'')",
	'renameuserold' => 'اسم المستخدم الحالي:',
	'renameusernew' => 'الاسم الجديد:',
	'renameuserreason' => 'السبب لإعادة التسمية:',
	'renameusermove' => 'انقل صفحات المستخدم ونقاشه (بالصفحات الفرعية) إلى الاسم الجديد',
	'renameuserreserve' => 'احفظ اسم المستخدم القديم ضد الاستخدام',
	'renameuserwarnings' => 'التحذيرات:',
	'renameuserconfirm' => 'نعم، أعد تسمية المستخدم',
	'renameusersubmit' => 'تنفيذ',
	'renameusererrordoesnotexist' => 'لا يوجد مستخدم بالاسم "<nowiki>$1</nowiki>"',
	'renameusererrorexists' => 'المستخدم "<nowiki>$1</nowiki>" موجود بالفعل',
	'renameusererrorinvalid' => 'اسم المستخدم "<nowiki>$1</nowiki>" غير صحيح',
	'renameusererrortoomany' => 'المستخدم "<nowiki>$1</nowiki>" لديه $2 {{PLURAL:$2|مساهمة|مساهمة}}، إعادة تسمية مستخدم لديه أكثر من $3 {{PLURAL:$3|مساهمة|مساهمة}} يمكن أن تؤثر سلبا على أداء الموقع.',
	'renameuser-error-request' => 'حدثت مشكلة أثناء استقبال الطلب.
من فضلك عد وحاول مرة ثانية.',
	'renameuser-error-same-user' => 'لا يمكنك إعادة تسمية مستخدم بنفس الاسم كما كان من قبل.',
	'renameusersuccess' => 'تمت إعادة تسمية المستخدم "<nowiki>$1</nowiki>" إلى "<nowiki>$2</nowiki>"',
	'renameuser-page-exists' => 'الصفحة $1 موجودة بالفعل ولا يمكن إنشاء أخرى مكانها أوتوماتيكيا.',
	'renameuser-page-moved' => 'تم نقل الصفحة $1 إلى $2.',
	'renameuser-page-unmoved' => 'لم يتمكن من نقل الصفحة $1 إلى $2.',
	'renameuserlogpage' => 'سجل إعادة تسمية المستخدمين',
	'renameuserlogpagetext' => 'هذا سجل بالتغييرات في أسماء المستخدمين',
	'renameuserlogentry' => 'أعاد تسمية $1 باسم "$2"',
	'renameuser-log' => '{{PLURAL:$1|1 تعديل|$1 تعديل}}. السبب: $2',
	'renameuser-move-log' => 'نقل الصفحة تلقائيا خلال إعادة تسمية المستخدم من "[[User:$1|$1]]" إلى "[[User:$2|$2]]"',
	'right-renameuser' => 'إعادة تسمية المستخدمين',
);

/** Aramaic (ܐܪܡܝܐ) */
$messages['arc'] = array(
	'renameusersubmit' => 'ܡܨܝܘܬܐ',
);

/** Egyptian Spoken Arabic (مصرى)
 * @author Ghaly
 * @author Meno25
 * @author Ramsis II
 */
$messages['arz'] = array(
	'renameuser' => 'تغيير تسمية يوزر',
	'renameuser-desc' => "بيضيف [[Special:Renameuser|صفحة مخصوصة]] علشان تغير اسم يوزر(محتاج صلاحية ''renameuser'')",
	'renameuserold' => 'اسم اليوزر الحالي:',
	'renameusernew' => 'اسم اليوزر الجديد:',
	'renameuserreason' => 'السبب لإعادة التسميه:',
	'renameusermove' => 'انقل صفحات اليوزر و مناقشاته (بالصفحات الفرعية)للاسم الجديد.',
	'renameuserreserve' => 'احفظ اسم اليوزر القديم ضد الاستخدام',
	'renameuserwarnings' => 'التحذيرات:',
	'renameuserconfirm' => 'ايوه،سمى اليوزر دا من تاني',
	'renameusersubmit' => 'تقديم',
	'renameusererrordoesnotexist' => 'اليوزر"<nowiki>$1</nowiki>" مالوش وجود.',
	'renameusererrorexists' => 'اليوزر "<nowiki>$1</nowiki>" موجود من قبل كدا.',
	'renameusererrorinvalid' => 'اسم اليوزر "<nowiki>$1</nowiki>"مش صحيح.',
	'renameusererrortoomany' => 'اليوزر "<nowiki>$1</nowiki>" عنده {{PLURAL:$2|مساهمة|مساهمة}}, تغيير اسم يوزر عنده اكتر من {{PLURAL:$3|مساهمة|مساهمة}}  ممكن يأثر على اداء الموقع تاثير سلبي.',
	'renameuser-error-request' => 'حصلت مشكلة فى استلام الطلب.
لو سمحت ارجع لورا و حاول تاني.',
	'renameuser-error-same-user' => 'ما ينفعش تغير اسم اليوزر لنفس الاسم من تاني.',
	'renameusersuccess' => 'اليوزر "<nowiki>$1</nowiki>" اتغير اسمه لـ"<nowiki>$2</nowiki>".',
	'renameuser-page-exists' => 'الصفحة $1 موجودة من قبل كدا و ماينفعش يتكتب عليها اوتوماتيكي.',
	'renameuser-page-moved' => 'تم نقل الصفحه $1 ل $2.',
	'renameuser-page-unmoved' => 'الصفحة $1 مانفعش تتنقل لـ$2.',
	'renameuserlogpage' => 'سجل تغيير تسمية اليوزرز',
	'renameuserlogpagetext' => 'دا سجل بالتغييرات فى أسامى اليوزرز',
	'renameuserlogentry' => 'اتغيرت تسمية$1 لـ "$2"',
	'renameuser-log' => '{{PLURAL:$1|1 تعديل|$1 تعديل}}. علشان: $2',
	'renameuser-move-log' => 'الصفحة اتنقلت اوتوماتيكى لما اليوزر  "[[User:$1|$1]]" اتغير اسمه لـ "[[User:$2|$2]]"',
	'right-renameuser' => 'غير اسم اليوزرز',
);

/** Asturian (Asturianu)
 * @author Esbardu
 */
$messages['ast'] = array(
	'renameuser' => 'Renomar usuariu',
	'renameuser-desc' => "Renoma un usuariu (necesita'l permisu ''renameuser'')",
	'renameuserold' => "Nome d'usuariu actual:",
[...2835 lines suppressed...]
$messages['vi'] = array(
	'renameuser' => 'Đổi tên thành viên',
	'renameuser-desc' => "Đổi tên thành viên (cần có quyền ''renameuser'')",
	'renameuserold' => 'Tên hiệu hiện nay:',
	'renameusernew' => 'Tên hiệu mới:',
	'renameuserreason' => 'Lý do đổi tên:',
	'renameusermove' => 'Di chuyển trang thành viên và thảo luận thành viên (cùng với trang con của nó) sang tên mới',
	'renameuserreserve' => 'Không cho phép ai lấy tên cũ',
	'renameuserwarnings' => 'Cảnh báo:',
	'renameuserconfirm' => 'Đổi tên người dùng',
	'renameusersubmit' => 'Thực hiện',
	'renameusererrordoesnotexist' => 'Thành viên “<nowiki>$1</nowiki>” không tồn tại.',
	'renameusererrorexists' => 'Thành viên “<nowiki>$1</nowiki>” đã hiện hữu.',
	'renameusererrorinvalid' => 'Tên thành viên “<nowiki>$1</nowiki>” không hợp lệ.',
	'renameusererrortoomany' => 'Thành viên “<nowiki>$1</nowiki>” có $2 đóng góp, đổi tên thành viên có hơn $3 đóng góp có thể ảnh hưởng xấu đến hiệu năng của trang.',
	'renameuser-error-request' => 'Có trục trặc trong tiếp nhận yêu cầu. Xin hãy quay lại và thử lần nữa.',
	'renameuser-error-same-user' => 'Bạn không thể đổi tên thành viên sang tên y hệt như vậy.',
	'renameusersuccess' => 'Thành viên “<nowiki>$1</nowiki>” đã được đổi tên thành “<nowiki>$2</nowiki>”.',
	'renameuser-page-exists' => 'Trang $1 đã tồn tại và không thể bị tự động ghi đè.',
	'renameuser-page-moved' => 'Trang $1 đã được di chuyển đến $2.',
	'renameuser-page-unmoved' => 'Trang $1 không thể di chuyển đến $2.',
	'renameuserlogpage' => 'Nhật trình đổi tên thành viên',
	'renameuserlogpagetext' => 'Đây là nhật trình ghi lại các thay đổi đối với tên thành viên',
	'renameuserlogentry' => 'đã đổi tên $1 thành “$2”',
	'renameuser-log' => 'Đã có {{PLURAL:$1|1 sửa đổi|$1 sửa đổi}}. Lý do: $2',
	'renameuser-move-log' => 'Đã tự động di chuyển trang khi đổi tên thành viên “[[User:$1|$1]]” thành “[[User:$2|$2]]”',
	'right-renameuser' => 'Đổi tên thành viên',
);

/** Volapük (Volapük)
 * @author Malafaya
 * @author Smeira
 */
$messages['vo'] = array(
	'renameuser' => 'Votanemön gebani',
	'renameuser-desc' => "Votanemön gebani (gität: ''renameuser'' zesüdon)",
	'renameuserold' => 'Gebananem anuik:',
	'renameusernew' => 'Gebananem nulik:',
	'renameuserreason' => 'Kod votanemama:',
	'renameusermove' => 'Topätükön padi e bespikapadi gebana (e donapadis onsik) ad nem nulik',
	'renameuserreserve' => 'Neletön gebananemi rigik (pos votanemam) ad pagebön ün fütür',
	'renameuserwarnings' => 'Nuneds:',
	'renameuserconfirm' => 'Si, votanemolös gebani',
	'renameusersubmit' => 'Sedön',
	'renameusererrordoesnotexist' => 'Geban: "<nowiki>$1</nowiki>" no dabinon.',
	'renameusererrorexists' => 'Geban: "<nowiki>$1</nowiki>" ya dabinon.',
	'renameusererrorinvalid' => 'Gebananem: "<nowiki>$1</nowiki>" no lonöfon.',
	'renameusererrortoomany' => 'Geban: "<nowiki>$1</nowiki>" labon {{PLURAL:$2|keblünoti|keblünotis}} $2. Votanemam gebana labü {{PLURAL:$3|keblünot|keblünots}} plu $3 ba oflunon negudiko jäfidi bevüresodatopäda at.',
	'renameuser-error-request' => 'Ädabinon säkäd pö daget bega. Geikolös, begö! e steifülolös dönu.',
	'renameuser-error-same-user' => 'No kanol votanemön gebani ad nem ot.',
	'renameusersuccess' => 'Geban: "<nowiki>$1</nowiki>" pevotanemon ad "<nowiki>$2</nowiki>".',
	'renameuser-page-exists' => 'Pad: $1 ya dabinon e no kanon pamoükön itjäfidiko.',
	'renameuser-page-moved' => 'Pad: $1 petopätükon ad pad: $2.',
	'renameuser-page-unmoved' => 'No eplöpos ad topätükön padi: $1 ad pad: $2.',
	'renameuserlogpage' => 'Jenotalised votanemamas',
	'renameuserlogpagetext' => 'Is palisedons votükams gebananemas.',
	'renameuserlogentry' => 'evotanemon eli $1 ad "$2"',
	'renameuser-log' => '{{PLURAL:$1|redakam 1|redakams $1}}. Kod: $2',
	'renameuser-move-log' => 'Pad petopätükon itjäfidiko dü votanemama gebana: "[[User:$1|$1]]" ad "[[User:$2|$2]]"',
	'right-renameuser' => 'Votanemön gebanis',
);

/** Walloon (Walon)
 * @author Srtxg
 */
$messages['wa'] = array(
	'renameuser' => 'Rilomer èn uzeu',
	'renameuserold' => "No d' elodjaedje pol moumint:",
	'renameusernew' => "Novea no d' elodjaedje:",
	'renameuserreason' => 'RÃ¥jhon pol rilomaedje:',
	'renameusermove' => "Displaecî les pådjes d' uzeu et d' copene (eyet leus dzo-pådjes) viè l' novea no",
	'renameusersubmit' => 'Evoye',
	'renameusererrordoesnotexist' => "L' uzeu «<nowiki>$1</nowiki>» n' egzistêye nén",
	'renameusererrorexists' => "L' uzeu «<nowiki>$1</nowiki>» egzistêye dedja",
	'renameusererrorinvalid' => "Li no d' elodjaedje «<nowiki>$1</nowiki>» n' est nén on no valide",
	'renameusererrortoomany' => "L' uzeu «<nowiki>$1</nowiki>» a $2 contribouwaedjes, rilomer èn uzeu avou pus di $3 contribouwaedjes pout aveur des consecwinces sol performance del waibe",
	'renameusersuccess' => "L' uzeu «<nowiki>$1</nowiki>» a stî rlomé a «<nowiki>$2</nowiki>»",
	'renameuser-page-exists' => "Li pådje $1 egzistêye dedja et n' pout nén esse otomaticmint spotcheye.",
	'renameuser-page-moved' => 'Li pådje $1 a stî displaeceye viè $2.',
	'renameuser-page-unmoved' => 'Li pådje $1 èn pout nén esse displaeceye viè $2.',
	'renameuserlogpage' => "Djournå des candjmints d' no d' uzeus",
	'renameuserlogpagetext' => "Chal pa dzo c' est ene djivêye des uzeus k' ont candjî leu no d' elodjaedje.",
	'renameuser-log' => "k' aveut ddja fwait $1 candjmints. $2",
	'renameuser-move-log' => "Pådje displaeceye otomaticmint tot rlomant l' uzeu «[[User:$1|$1]]» viè «[[User:$2|$2]]»",
);

/** Yiddish (ייִדיש)
 * @author פוילישער
 */
$messages['yi'] = array(
	'renameuser' => 'בײַטן באַניצער נאָמען',
	'renameuserold' => 'לויפיגער באניצער-נאמען:',
	'renameusernew' => 'נייער באניצער-נאמען',
	'renameusererrordoesnotexist' => 'דער באניצער "<nowiki>$1</nowiki>" עקסיסטירט נישט.',
	'renameusererrorexists' => 'דער באניצער  "<nowiki>$1</nowiki>" עקסיסטירט שוין.',
	'renameusererrorinvalid' => 'דער באניצער נאמען  "<nowiki>$1</nowiki>" איז נישט גילטיק.',
	'renameuserlogpage' => 'באַניצער נאָמען-טויש לאָג-בוך',
);

/** Yue (粵語) */
$messages['yue'] = array(
	'renameuser' => '改用戶名',
	'renameuser-desc' => "幫用戶改名 (需要 ''renameuser'' 權限)",
	'renameuserold' => '現時嘅用戶名:',
	'renameusernew' => '新嘅用戶名:',
	'renameuserreason' => '改名嘅原因:',
	'renameusermove' => '搬用戶頁同埋佢嘅對話頁(同埋佢哋嘅細頁)到新名',
	'renameuserwarnings' => '警告:',
	'renameuserconfirm' => '係,改呢個用戶名',
	'renameusersubmit' => '遞交',
	'renameusererrordoesnotexist' => '用戶"<nowiki>$1</nowiki>"唔存在',
	'renameusererrorexists' => '用戶"<nowiki>$1</nowiki>"已經存在',
	'renameusererrorinvalid' => '用戶名"<nowiki>$1</nowiki>"唔正確',
	'renameusererrortoomany' => '用戶"<nowiki>$1</nowiki>"貢獻咗$2次,對改一個超過$3次的用戶名嘅用戶可能會影響網站嘅效能',
	'renameuser-error-request' => '響收到請求嗰陣出咗問題。
請返去再試過。',
	'renameuser-error-same-user' => '你唔可以改一位用戶係同之前嘅嘢一樣。',
	'renameusersuccess' => '用戶"<nowiki>$1</nowiki>"已經改咗名做"<nowiki>$2</nowiki>"',
	'renameuser-page-exists' => '$1呢一版已經存在,唔可以自動重寫。',
	'renameuser-page-moved' => '$1呢一版已經搬到去$2。',
	'renameuser-page-unmoved' => '$1呢一版唔能夠搬到去$2。',
	'renameuserlogpage' => '用戶改名日誌',
	'renameuserlogpagetext' => '呢個係改用戶名嘅日誌',
	'renameuserlogentry' => '已經幫 $1 改咗名做 "$2"',
	'renameuser-log' => '擁有$1次編輯。 原因: $2',
	'renameuser-move-log' => '當由"[[User:$1|$1]]"改名做"[[User:$2|$2]]"嗰陣已經自動搬咗用戶頁',
	'right-renameuser' => '改用戶名',
);

/** Simplified Chinese (‪中文(简体)‬)
 * @author Gzdavidwong
 */
$messages['zh-hans'] = array(
	'renameuser' => '用户重命名',
	'renameuser-desc' => "为用户重命名 (需要 ''renameuser'' 权限)",
	'renameuserold' => '当前用户名:',
	'renameusernew' => '新用户名:',
	'renameuserreason' => '重命名的原因:',
	'renameusermove' => '移动用户页及其对话页(包括各子页)到新的名字',
	'renameuserreserve' => '封禁旧用户名,使之不能在日后使用',
	'renameuserwarnings' => '警告:',
	'renameuserconfirm' => '是,为用户重命名',
	'renameusersubmit' => '提交',
	'renameusererrordoesnotexist' => '用户"<nowiki>$1</nowiki>"不存在',
	'renameusererrorexists' => '用户"<nowiki>$1</nowiki>"已存在',
	'renameusererrorinvalid' => '用户名"<nowiki>$1</nowiki>"不可用',
	'renameusererrortoomany' => '用户"<nowiki>$1</nowiki>"贡献了$2次,重命名一个超过$3次的用户会影响站点性能',
	'renameuser-error-request' => '在收到请求时出现问题。
请回去重试。',
	'renameuser-error-same-user' => '您不可以更改一位用户是跟之前的东西一样。',
	'renameusersuccess' => '用户"<nowiki>$1</nowiki>"已经更名为"<nowiki>$2</nowiki>"',
	'renameuser-page-exists' => '$1这一页己经存在,不能自动覆写。',
	'renameuser-page-moved' => '$1这一页已经移动到$2。',
	'renameuser-page-unmoved' => '$1这一页不能移动到$2。',
	'renameuserlogpage' => '用户名变更日志',
	'renameuserlogpagetext' => '这是用户名更改的日志',
	'renameuserlogentry' => '已经把 $1 重命名为 "$2"',
	'renameuser-log' => '拥有$1次编辑。 理由: $2',
	'renameuser-move-log' => '当由"[[User:$1|$1]]"重命名作"[[User:$2|$2]]"时已经自动移动用户页',
	'right-renameuser' => '重新命名用户',
);

/** Traditional Chinese (‪中文(繁體)‬)
 * @author Wrightbus
 */
$messages['zh-hant'] = array(
	'renameuser' => '用戶重新命名',
	'renameuser-desc' => "為用戶重新命名 (需要 ''renameuser'' 權限)",
	'renameuserold' => '現時用戶名:',
	'renameusernew' => '新用戶名:',
	'renameuserreason' => '重新命名的原因:',
	'renameusermove' => '移動用戶頁及其對話頁(包括各子頁)到新的名字',
	'renameuserreserve' => '封禁舊使用者名稱,使之不能在日後使用',
	'renameuserwarnings' => '警告:',
	'renameuserconfirm' => '是,為用戶重新命名',
	'renameusersubmit' => '提交',
	'renameusererrordoesnotexist' => '用戶"<nowiki>$1</nowiki>"不存在',
	'renameusererrorexists' => '用戶"<nowiki>$1</nowiki>"已存在',
	'renameusererrorinvalid' => '用戶名"<nowiki>$1</nowiki>"不可用',
	'renameusererrortoomany' => '用戶"<nowiki>$1</nowiki>"貢獻了$2次,重新命名一個超過$3次的用戶會影響網站效能',
	'renameuser-error-request' => '在收到請求時出現問題。
請回去重試。',
	'renameuser-error-same-user' => '您不可以更改一位用戶是跟之前的東西一樣。',
	'renameusersuccess' => '用戶"<nowiki>$1</nowiki>"已經更名為"<nowiki>$2</nowiki>"',
	'renameuser-page-exists' => '$1這一頁己經存在,不能自動覆寫。',
	'renameuser-page-moved' => '$1這一頁已經移動到$2。',
	'renameuser-page-unmoved' => '$1這一頁不能移動到$2。',
	'renameuserlogpage' => '用戶名變更日誌',
	'renameuserlogpagetext' => '這是用戶名更改的日誌',
	'renameuserlogentry' => '已經把 $1 重新命名為 "$2"',
	'renameuser-log' => '擁有$1次編輯。 理由: $2',
	'renameuser-move-log' => '當由"[[User:$1|$1]]"重新命名作"[[User:$2|$2]]"時已經自動移動用戶頁',
	'right-renameuser' => '重新命名用戶',
);

/** Zulu (isiZulu) */
$messages['zu'] = array(
	'renameusersubmit' => 'Yisa',
);



--- NEW FILE SpecialRenameuser.php ---
<?php
if (!defined('MEDIAWIKI')) die();
/**
 * A Special Page extension to rename users, runnable by users with renameuser
 * righs
 *
 * @addtogroup Extensions
 *
 * @author Ævar Arnfjörð Bjarmason <avarab at gmail.com>
 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 */

$wgAvailableRights[] = 'renameuser';
$wgGroupPermissions['bureaucrat']['renameuser'] = true;

$wgExtensionCredits['specialpage'][] = array(
	'path' => __FILE__,
	'name' => 'Renameuser',
	'author'         => array( 'Ævar Arnfjörð Bjarmason', 'Aaron Schulz' ),
	'url'            => 'http://www.mediawiki.org/wiki/Extension:Renameuser',
	'description'    => 'Rename a user (need \'\'renameuser\'\' right)',
	'descriptionmsg' => 'renameuser-desc',
);

# Internationalisation file
$dir = dirname(__FILE__) . '/';
$wgExtensionMessagesFiles['Renameuser'] = $dir . 'SpecialRenameuser.i18n.php';
$wgExtensionAliasesFiles['Renameuser'] = $dir . 'SpecialRenameuser.alias.php';

/**
 * The maximum number of edits a user can have and still be allowed renaming,
 * set it to 0 to disable the limit.
 */
define( 'RENAMEUSER_CONTRIBLIMIT', 1000000 );
define( 'RENAMEUSER_CONTRIBJOB', 5000 );

# Add a new log type
global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
$wgLogTypes[]                          = 'renameuser';
$wgLogNames['renameuser']              = 'renameuserlogpage';
$wgLogHeaders['renameuser']            = 'renameuserlogpagetext';
#$wgLogActions['renameuser/renameuser'] = 'renameuserlogentry';
$wgLogActionsHandlers['renameuser/renameuser'] = 'wfRenameUserLogActionText'; // deal with old breakage

function wfRenameUserLogActionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) {
	if( !$title || $title->getNamespace() !== NS_USER ) {
		$rv = ''; // handled in comment, the old way
	} else {
		$titleLink = $skin ? 
			$skin->makeLinkObj( $title, htmlspecialchars( $title->getPrefixedText() ) ) : $title->getText();
		# Add title to params
		array_unshift( $params, $titleLink );
		$rv = wfMsgReal( 'renameuserlogentry', $params );
	}
	return $rv;
}

$wgAutoloadClasses['SpecialRenameuser'] = dirname( __FILE__ ) . '/SpecialRenameuser_body.php';
$wgAutoloadClasses['RenameUserJob'] = dirname(__FILE__) . '/RenameUserJob.php';
$wgSpecialPages['Renameuser'] = 'SpecialRenameuser';
$wgSpecialPageGroups['Renameuser'] = 'users';
$wgJobClasses['renameUser'] = 'RenameUserJob';


--- NEW FILE SpecialRenameuser_body.php ---
<?php

if ( !defined( 'MEDIAWIKI' ) ) {
	echo "RenameUser extension\n";
	exit( 1 );
}

# Add messages
wfLoadExtensionMessages( 'Renameuser' );

/**
 * Special page allows authorised users to rename
 * user accounts
 */
class SpecialRenameuser extends SpecialPage {

	/**
	 * Constructor
	 */
	public function __construct() {
		parent::__construct( 'Renameuser', 'renameuser' );
	}

	/**
	 * Show the special page
	 *
	 * @param mixed $par Parameter passed to the page
	 */
	public function execute( $par ) {
		global $wgOut, $wgUser, $wgRequest, $wgContLang, $wgLang;
		global $wgVersion, $wgMaxNameChars, $wgCapitalLinks;

		$this->setHeaders();
		$wgOut->addWikiMsg( 'renameuser-summary' );

		if( !$wgUser->isAllowed( 'renameuser' ) ) {
			$wgOut->permissionRequired( 'renameuser' );
			return;
		}
		if( wfReadOnly() ) {
			$wgOut->readOnlyPage();
			return;
		}

		$showBlockLog = $wgRequest->getBool( 'submit-showBlockLog' );
		$oldnamePar = trim( str_replace( '_', ' ', $wgRequest->getText( 'oldusername' ) ) );
		$oldusername = Title::makeTitle( NS_USER, $oldnamePar );
		// Force uppercase of newusername, otherwise wikis with wgCapitalLinks=false can create lc usernames
		$newusername = Title::makeTitleSafe( NS_USER, $wgContLang->ucfirst( $wgRequest->getText( 'newusername' ) ) );
		$oun = is_object( $oldusername ) ? $oldusername->getText() : '';
		$nun = is_object( $newusername ) ? $newusername->getText() : '';
		$token = $wgUser->editToken();
		$reason = $wgRequest->getText( 'reason' );
		// If nothing given for these flags, assume they are checked
		// unless this is a POST submission.
		$move_checked = true;
		if( $wgRequest->wasPosted() ) {
			if( !$wgRequest->getCheck( 'movepages' ) ) {
				$move_checked = false;
			}
		}
		$warnings = array();
		if( $oun && $nun && !$wgRequest->getCheck( 'confirmaction' )  ) {
			wfRunHooks( 'RenameUserWarning', array( $oun, $nun, &$warnings ) );
		}

		$wgOut->addHTML( "
			<!-- Current contributions limit is " . RENAMEUSER_CONTRIBLIMIT . " -->" .
			Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) .
			Xml::openElement( 'fieldset' ) .
			Xml::element( 'legend', null, wfMsg( 'renameuser' ) ) .
			Xml::openElement( 'table', array( 'id' => 'mw-renameuser-table' ) ) .
			"<tr>
				<td class='mw-label'>" .
					Xml::label( wfMsg( 'renameuserold' ), 'oldusername' ) .
				"</td>
				<td class='mw-input'>" .
					Xml::input( 'oldusername', 20, $oun, array( 'type' => 'text', 'tabindex' => '1' ) ) . ' ' .
				"</td>
			</tr>
			<tr>
				<td class='mw-label'>" .
					Xml::label( wfMsg( 'renameusernew' ), 'newusername' ) .
				"</td>
				<td class='mw-input'>" .
					Xml::input( 'newusername', 20, $nun, array( 'type' => 'text', 'tabindex' => '2' ) ) .
				"</td>
			</tr>
			<tr>
				<td class='mw-label'>" .
					Xml::label( wfMsg( 'renameuserreason' ), 'reason' ) .
				"</td>
				<td class='mw-input'>" .
					Xml::input( 'reason', 40, $reason, array( 'type' => 'text', 'tabindex' => '3', 'maxlength' => 255 ) ) .
				"</td>
			</tr>"
		);
		if( $wgUser->isAllowed( 'move' ) ) {
			$wgOut->addHTML( "
				<tr>
					<td> 
					</td>
					<td class='mw-input'>" .
						Xml::checkLabel( wfMsg( 'renameusermove' ), 'movepages', 'movepages', 
							$move_checked, array( 'tabindex' => '4' ) ) .
					"</td>
				</tr>"
			);
		}
		if( $warnings ) {
			$warningsHtml = array();
			foreach( $warnings as $warning )
				$warningsHtml[] = is_array( $warning ) ?
					call_user_func_array( 'wfMsgWikiHtml', $warning ) :
					wfMsgHtml( $warning );
			$wgOut->addHTML( "
				<tr>
					<td class='mw-label'>" . wfMsgWikiHtml( 'renameuserwarnings' ) . "
					</td>
					<td class='mw-input'>" .
						'<ul style="color: red; font-weight: bold"><li>'.
							implode( '</li><li>', $warningsHtml ).'</li></ul>'.
					"</td>
				</tr>"
			);
			$wgOut->addHTML( "
				<tr>
					<td> 
					</td>
					<td class='mw-input'>" .
						Xml::checkLabel( wfMsg( 'renameuserconfirm' ), 'confirmaction', 'confirmaction', 
							false, array( 'tabindex' => '6' ) ) .
					"</td>
				</tr>"
			);
		}
		$wgOut->addHTML( "
			<tr>
				<td> 
				</td>
				<td class='mw-submit'>" .
					Xml::submitButton( wfMsg( 'renameusersubmit' ), array( 'name' => 'submit', 
						'tabindex' => '7', 'id' => 'submit' ) ) .
					' ' .
					Xml::submitButton( wfMsg( 'blocklogpage' ), array ( 'name' => 'submit-showBlockLog', 
						'id' => 'submit-showBlockLog', 'tabindex' => '8' ) ) .
				"</td>
			</tr>" .
			Xml::closeElement( 'table' ) .
			Xml::closeElement( 'fieldset' ) .
			Xml::hidden( 'token', $token ) .
			Xml::closeElement( 'form' ) . "\n"
		);

		// Show block log if requested
		if( $showBlockLog && is_object( $oldusername ) ) {
			$this->showLogExtract( $oldusername, 'block', $wgOut ) ;
			return;
		}

		if( $wgRequest->getText( 'token' ) === '' ) {
			# They probably haven't even submitted the form, so don't go further.
			return;
		} elseif( $warnings ) {
			# Let user read warnings
			return;
		} elseif( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameuser-error-request' ) . "</div>" );
			return;
		} elseif( !is_object( $oldusername ) ) {
			$wgOut->addWikiText(
				"<div class=\"errorbox\">"
				. wfMsg( 'renameusererrorinvalid', $wgRequest->getText( 'oldusername' ) )
				. "</div>"
			);
			return;
		} elseif( !is_object( $newusername ) ) {
			$wgOut->addWikiText(
				"<div class=\"errorbox\">"
				. wfMsg( 'renameusererrorinvalid', $wgRequest->getText( 'newusername' ) )
				. "</div>"
			);
			return;
		} elseif( $oldusername->getText() == $newusername->getText() ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameuser-error-same-user' ) . "</div>" );
			return;
		}

		// Suppress username validation of old username
		$olduser = User::newFromName( $oldusername->getText(), false );
		$newuser = User::newFromName( $newusername->getText(), 'creatable' );

		// It won't be an object if for instance "|" is supplied as a value
		if( !is_object( $olduser ) ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorinvalid', 
				$oldusername->getText() ) . "</div>" );
			return;
		}
		if( !is_object( $newuser ) || !User::isCreatableName( $newuser->getName() ) ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorinvalid', 
				$newusername->getText() ) . "</div>" );
			return;
		}

		// Check for the existence of lowercase oldusername in database.
		// Until r19631 it was possible to rename a user to a name with first character as lowercase
		if( $oldusername->getText() !== $wgContLang->ucfirst( $oldusername->getText() ) ) {
			// oldusername was entered as lowercase -> check for existence in table 'user'
			$dbr = wfGetDB( DB_SLAVE );
			$uid = $dbr->selectField( 'user', 'user_id', 
				array( 'user_name' => $oldusername->getText() ), 
				__METHOD__ );
			if( $uid === false ) {
				if( !$wgCapitalLinks ) {
					$uid = 0; // We are on a lowercase wiki but lowercase username does not exists
				} else {
					// We are on a standard uppercase wiki, use normal
					$uid = $olduser->idForName();
					$oldusername = Title::makeTitleSafe( NS_USER, $olduser->getName() );
				}
			}
		} else {
			// oldusername was entered as upperase -> standard procedure
			$uid = $olduser->idForName();
		}

		if( $uid == 0 ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrordoesnotexist' , 
				$oldusername->getText() ) . "</div>" );
			return;
		}

		if( $newuser->idForName() != 0 ) {
			$wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorexists', 
				$newusername->getText() ) . "</div>" );
			return;
		}

		// Always get the edits count, it will be used for the log message
		$contribs = User::edits( $uid );

		// Check edit count
		if( !$wgUser->isAllowed( 'siteadmin' ) ) {
			if ( RENAMEUSER_CONTRIBLIMIT != 0 && $contribs > RENAMEUSER_CONTRIBLIMIT ) {
				$wgOut->addWikiText( "<div class=\"errorbox\">" . 
					wfMsg( 'renameusererrortoomany',
						$oldusername->getText(),
						$wgLang->formatNum( $contribs ),
						$wgLang->formatNum( RENAMEUSER_CONTRIBLIMIT )
					)
				 . "</div>" );
				return;
			}
		}

		// Give other affected extensions a chance to validate or abort
		if( !wfRunHooks( 'RenameUserAbort', array( $uid, $oldusername->getText(), $newusername->getText() ) ) ) {
			return;
		}

		// Do the heavy lifting...
		$rename = new RenameuserSQL( $oldusername->getText(), $newusername->getText(), $uid );
		if( !$rename->rename() ) {
			return;
		}
		
		// If this user is renaming his/herself, make sure that Title::moveTo()
		// doesn't make a bunch of null move edits under the old name!
		if( $wgUser->getId() == $uid ) {
			$wgUser->setName( $newusername->getText() );
		}

		// Log this rename
		$log = new LogPage( 'renameuser' );
		$log->addEntry( 'renameuser', $oldusername, wfMsgExt( 'renameuser-log', array( 'parsemag', 'content' ), 
			$wgContLang->formatNum( $contribs ), $reason ), $newusername->getText() );

		// Move any user pages
		if( $wgRequest->getCheck( 'movepages' ) && $wgUser->isAllowed( 'move' ) ) {
			$dbr = wfGetDB( DB_SLAVE );
			$oldkey = $oldusername->getDBkey();
			$pages = $dbr->select(
				'page',
				array( 'page_namespace', 'page_title' ),
				array(
					'page_namespace IN (' . NS_USER . ',' . NS_USER_TALK . ')',
					'(page_title LIKE ' . 
						$dbr->addQuotes( $dbr->escapeLike( $oldusername->getDBkey() ) . '/%' ) . 
						' OR page_title = ' . $dbr->addQuotes( $oldusername->getDBkey() ) . ')'
				),
				__METHOD__
			);

			$output = '';
			$skin =& $wgUser->getSkin();
			while ( $row = $dbr->fetchObject( $pages ) ) {
				$oldPage = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
				$newPage = Title::makeTitleSafe( $row->page_namespace, 
					preg_replace( '!^[^/]+!', $newusername->getDBkey(), $row->page_title ) );
				# Do not autodelete or anything, title must not exist
				if ( $newPage->exists() && !$oldPage->isValidMoveTarget( $newPage ) ) {
					$link = $skin->makeKnownLinkObj( $newPage );
					$output .= '<li class="mw-renameuser-pe">' . wfMsgHtml( 'renameuser-page-exists', $link ) . '</li>';
				} else {
					$success = $oldPage->moveTo( $newPage, false, wfMsgForContent( 'renameuser-move-log', 
						$oldusername->getText(), $newusername->getText() ) );
					if( $success === true ) {
						$oldLink = $skin->makeKnownLinkObj( $oldPage, '', 'redirect=no' );
						$newLink = $skin->makeKnownLinkObj( $newPage );
						$output .= '<li class="mw-renameuser-pm">' . wfMsgHtml( 'renameuser-page-moved', $oldLink, $newLink ) . '</li>';
					} else {
						$oldLink = $skin->makeKnownLinkObj( $oldPage );
						$newLink = $skin->makeLinkObj( $newPage );
						$output .= '<li class="mw-renameuser-pu">' . wfMsgHtml( 'renameuser-page-unmoved', $oldLink, $newLink ) . '</li>';
					}
				}
			}
			if( $output )
				$wgOut->addHTML( '<ul>' . $output . '</ul>' );
		}
		
		// Output success message stuff :)
		$wgOut->addWikiText( "<div class=\"successbox\">" . wfMsg( 'renameusersuccess', $oldusername->getText(), 
		$newusername->getText() ) . "</div><br style=\"clear:both\" />" );
	}

	function showLogExtract( $username, $type, &$out ) {
		# Show relevant lines from the logs:
		$out->addHTML( Xml::element( 'h2', null, LogPage::logName( $type ) ) . "\n" );
		LogEventsList::showLogExtract( $out, $type, $username->getPrefixedText() );
	}
}

class RenameuserSQL {
	
	/**
	  * The old username
	  *
	  * @var string
	  * @access private
	  */
	var $old;

	/**
	  * The new username
	  *
	  * @var string
	  * @access private
	  */
	var $new;

	/**
	  * The user ID
	  *
	  * @var integer
	  * @access private
	  */
	var $uid;

	/**
	  * The the tables => fields to be updated
	  *
	  * @var array
	  * @access private
	  */
	var $tables;

	/**
	 * Constructor
	 *
	 * @param string $old The old username
	 * @param string $new The new username
	 */
	function RenameuserSQL($old, $new, $uid) {
		$this->old = $old;
		$this->new = $new;
		$this->uid = $uid;
		
		$this->tables = array(); // Immediate updates
		$this->tables['image'] = array('img_user_text','img_user');
		$this->tables['oldimage'] = array('oi_user_text','oi_user');
		# FIXME: $this->tables['filearchive'] = array('fa_user_text','fa_user'); (not indexed yet)
		$this->tablesJob = array(); // Slow updates
		// If this user has a large number of edits, use the jobqueue
		if( User::edits($this->uid) > RENAMEUSER_CONTRIBJOB ) {
			$this->tablesJob['revision'] = array('rev_user_text','rev_user','rev_timestamp');
			$this->tablesJob['archive'] = array('ar_user_text','ar_user','ar_timestamp');
		} else {
			$this->tables['revision'] = array('rev_user_text','rev_user');
			$this->tables['archive'] = array('ar_user_text','ar_user');
		}
		// Recent changes is pretty hot, deadlocks occur if done all at once
		if( wfQueriesMustScale() ) {
			$this->tablesJob['recentchanges'] = array('rc_user_text','rc_user','rc_timestamp');
		} else {
			$this->tables['recentchanges'] = array('rc_user_text','rc_user');
		}
	}

	/**
	 * Do the rename operation
	 */
	function rename() {
		global $wgMemc, $wgDBname, $wgAuth;

		wfProfileIn( __METHOD__ );

		wfRunHooks( 'RenameUserPreRename', array( $this->uid, $this->old, $this->new ) );

		$dbw = wfGetDB( DB_MASTER );
		// Rename and touch the user before re-attributing edits,
		// this avoids users still being logged in and making new edits while
		// being renamed, which leaves edits at the old name.
		$dbw->update( 'user',
			array( 'user_name' => $this->new, 'user_touched' => $dbw->timestamp() ), 
			array( 'user_name' => $this->old ),
			__METHOD__
		);
		if( !$dbw->affectedRows() ) {
			return false;
		}
		// Reset token to break login with central auth systems.
		// Again, avoids user being logged in with old name.
		$user = User::newFromId( $this->uid );
		$authUser = $wgAuth->getUserInstance( $user );
		$authUser->resetAuthToken();

		// Delete from memcached.
		global $wgMemc;
		$wgMemc->delete( wfMemcKey( 'user', 'id', $this->uid ) );

		// Update ipblock list if this user has a block in there.
		$dbw->update( 'ipblocks',
			array( 'ipb_address' => $this->new ),
			array( 'ipb_user' => $this->uid, 'ipb_address' => $this->old ),
			__METHOD__ );
		// Update this users block/rights log. Ideally, the logs would be historical,
		// but it is really annoying when users have "clean" block logs by virtue of
		// being renamed, which makes admin tasks more of a pain...
		$oldTitle = Title::makeTitle( NS_USER, $this->old );
		$newTitle = Title::makeTitle( NS_USER, $this->new );
		$dbw->update( 'logging',
			array( 'log_title' => $newTitle->getDBKey() ),
			array( 'log_type' => array( 'block', 'rights' ),
				'log_namespace' => NS_USER,
				'log_title' => $oldTitle->getDBKey() ),
			__METHOD__ );
		// Do immediate updates!
		foreach( $this->tables as $table => $fieldSet ) {
			list($nameCol,$userCol) = $fieldSet;
			$dbw->update( $table,
				array( $nameCol => $this->new ),
				array( $nameCol => $this->old, $userCol => $this->uid ),
				__METHOD__
			);
		}
		// Construct jobqueue updates...
		// FIXME: if a bureaucrat renames a user in error, he/she
		// must be careful to wait until the rename finishes before
		// renaming back. This is due to the fact the the job "queue"
		// is not really FIFO, so we might end up with a bunch of edits
		// randomly mixed between the two new names. Some sort of rename
		// lock might be in order...
		foreach( $this->tablesJob as $table => $params ) {
			$userTextC = $params[0]; // some *_user_text column
			$userIDC = $params[1]; // some *_user column
			$timestampC = $params[2]; // some *_timestamp column

			$res = $dbw->select( $table,
				array( $userTextC, $timestampC ),
				array( $userTextC => $this->old, $userIDC => $this->uid ),
				__METHOD__,
				array( 'ORDER BY' => "$timestampC ASC" )
			);

			global $wgUpdateRowsPerJob;

			$batchSize = 500; // Lets not flood the job table!
			$jobSize = $wgUpdateRowsPerJob; // How many rows per job?

			$jobParams = array();
			$jobParams['table'] = $table;
			$jobParams['column'] = $userTextC;
			$jobParams['uidColumn'] = $userIDC;
			$jobParams['timestampColumn'] = $timestampC;
			$jobParams['oldname'] = $this->old;
			$jobParams['newname'] = $this->new;
			$jobParams['userID'] = $this->uid;
			// Timestamp column data for index optimizations
			$jobParams['minTimestamp'] = '0';
			$jobParams['maxTimestamp'] = '0';
			$jobParams['count'] = 0;
			
			// Insert into queue!
			$jobRows = 0;
			$done = false;
			while ( !$done ) {
				$jobs = array();
				for ( $i = 0; $i < $batchSize; $i++ ) {
					$row = $dbw->fetchObject( $res );
					if ( !$row ) {
						# If there are any job rows left, add it to the queue as one job
						if( $jobRows > 0 ) {
							$jobParams['count'] = $jobRows;
							$jobs[] = Job::factory( 'renameUser', $oldTitle, $jobParams );
							$jobParams['minTimestamp'] = '0';
							$jobParams['maxTimestamp'] = '0';
							$jobParams['count'] = 0;
							$jobRows = 0;
						}
						$done = true;
						break;
					}
					# If we are adding the first item, since the ORDER BY is ASC, set
					# the min timestamp
					if( $jobRows == 0 ) {
						$jobParams['minTimestamp'] = $row->$timestampC;
					}
					# Keep updating the last timestamp, so it should be correct when the last item is added.
					$jobParams['maxTimestamp'] = $row->$timestampC;
					# Update nice counter
					$jobRows++;
					# Once a job has $jobSize rows, add it to the queue
					if( $jobRows >= $jobSize ) {
						$jobParams['count'] = $jobRows;
						$jobs[] = Job::factory( 'renameUser', $oldTitle, $jobParams );
						$jobParams['minTimestamp'] = '0';
						$jobParams['maxTimestamp'] = '0';
						$jobParams['count'] = 0;
						$jobRows = 0;
					}
				}
				Job::batchInsert( $jobs );
			}
			$dbw->freeResult( $res );
		}

		// Commit the transaction
		$dbw->commit();

		// Delete from memcached again to make sure
		global $wgMemc;
		$wgMemc->delete( wfMemcKey( 'user', 'id', $this->uid ) );

		// Clear caches and inform authentication plugins
		$user = User::newFromId( $this->uid );
		$wgAuth->updateExternalDB( $user );
		wfRunHooks( 'RenameUserComplete', array( $this->uid, $this->old, $this->new ) );

		wfProfileOut( __METHOD__ );
		return true;
	}
}


--- NEW FILE mediawiki-Renameuser.spec ---
Name:		mediawiki-Renameuser
Version:	0
Release:	0.5.20090505svn%{?dist}
Summary:	An extension that provides a special page for renaming user accounts

Group:		Applications/Internet
License:	GPLv2+
URL:		http://www.mediawiki.org/wiki/Extension:Renameuser
# http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Renameuser/RenameUserJob.php?revision=50213
Source0:	RenameUserJob.php
# http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Renameuser/SpecialRenameuser.alias.php?revision=50213
Source1:	SpecialRenameuser.alias.php
# http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Renameuser/SpecialRenameuser.i18n.php?revision=50213
Source2:	SpecialRenameuser.i18n.php
# http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Renameuser/SpecialRenameuser.php?revision=50213
Source3:	SpecialRenameuser.php
# http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Renameuser/SpecialRenameuser_body.php?revision=50213
Source4:	SpecialRenameuser_body.php
Source5:	README.fedora
Source6:	LICENSE.fedora
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:	noarch

Requires:	mediawiki >= 1.14

%description
Renameuser provides a special page which allows authorised users to rename user
accounts. This will cause page histories, etc. to be updated.

%prep

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mediawiki/extensions/Renameuser
install -pm 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/mediawiki/extensions/Renameuser

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
install -pm 644 %{SOURCE6} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_datadir}/mediawiki/extensions/Renameuser
%doc %{_docdir}/%{name}-%{version}/README.fedora
%doc %{_docdir}/%{name}-%{version}/LICENSE.fedora

%changelog
* Thu Jun 25 2009 John Guthrie <guthrie at counterexample.org> - 0-0.5.20090505svn
- Corrected UTF8 problems with the LICENSE.fedora file.

* Mon Jun 22 2009 John Guthrie <guthrie at counterexample.org> - 0-0.4.20090505svn
- Added in the LICENSE.fedora file.

* Mon May 18 2009 John Guthrie <guthrie at counterexample.org> - 0-0.3.20090505svn
- Fixed README.fedora file so that it contained information on the correct
  MediaWiki extension.

* Tue May 05 2009 John Guthrie <guthrie at counterexample.org> - 0-0.2.20090505svn
- Fixed source code download URLs.
- Corrected license field.
- Downloaded latest version of code from subversion.
- Corrected URL tag.

* Tue Mar 31 2009 John Guthrie <guthrie at counterexample.org> - 0-0.1.20090331svn
- Initial package build.




More information about the fedora-extras-commits mailing list