[Mediawiki-l] How to change a user password external script

Joshua Oreman oremanj at gmail.com
Sun Dec 18 05:23:59 UTC 2005


On 12/16/05, Piyush Varma <pvarma at inventures.com> wrote:
> Hi,
>
> I have tried to change the user_password value for a user_name value of a particular user using PHP md5("password_value") function. But, it does not work.
>
> I have also tried to use a 2-step process:
>
> 1: $p = md5( $password);
> 2: return md5( "{$userid}-{$p}" );    # to get the hashed password
>
> The hashed password value does not match with the value in MySql user table.
>
> The value of $password = "123qweA" and the user.user_password table value is fce34f65fd0acb4c716bc2305e47f7c2
>
> While the value I derive using above 1 and 2 lines is 8021331ef9a813b4713630fb1c3ca0fc using $userid = "pvarma"

userid is a number, the user *ID*.  (The name is called, surprisingly
enough, the user name.)

>
> What should I do to change a user's password outside the MediaWiki web interface please?

The above looks good, you just need the numeric ID as listed in the user table.

HTH
-- Josh

>
> Thank you,
>
> Piyush
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>



More information about the MediaWiki-l mailing list