Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change a user's Email address in MediaWiki

Tags:

mediawiki

With access sysop and database access how do I change the Email address associated with a user?

The user table in the database has everything encoded as BLOBs. If I can decode and encode those values presumably I can just update user.user_email.

like image 210
feetwet Avatar asked Jan 11 '15 17:01

feetwet


2 Answers

MaxSem's answer did not work for me, but here is a MediaWiki maintenance script (introduced in v1.27) that'll do the trick: https://www.mediawiki.org/wiki/Manual:ResetUserEmail.php

Go to the base directory of your wiki, and type something like this:
php maintenance/resetUserEmail.php uuuu [email protected]
to change user uuuu's email address to [email protected]. By default, this will change the user's password so that the user has to reset it, which can usually be done on the wiki website. You might need to add user name and password for database access, e.g.:
php maintenance/resetUserEmail.php --dbuser myuser --dbpass wordpass uuuu [email protected]

like image 80
TTT Avatar answered Sep 22 '22 13:09

TTT


UPDATE user SET user_email='[email protected]' WHERE user_id=... should just work. However, if you need to also set the confirmed flag, see instructions here (replace the mwscript line with php maintenance/eval.php). If you need to set their email only so that they could reset their password, see https://www.mediawiki.org/wiki/Manual:Resetting_passwords

You can get a current list of users and emails like this (i.e. decode):

SELECT Cast(user_name AS CHAR), Cast(User_Email AS CHAR) FROM user;
like image 26
MaxSem Avatar answered Sep 22 '22 13:09

MaxSem