[Mediawiki-l] How to export user password from Mediawiki MySQL database to OpenLDAP

Alexis Moinet alexis.moinet at fpms.ac.be
Thu Aug 23 07:28:11 UTC 2007

> Yifan (Eric) Jiang a écrit :
>> Hi all,
>> I am currently working in a project which requires to exporting user
>> information from Mediawiki MySQL database to OpenLDAP directory (with
>> Berkeley database). Everything is fine except the password issue. I am
>> not sure what hash algorithm does Mediawiki use to hash user password,
>> (But I guess it may be MD5). However, I can't get the same hash value by
>> using OpenLDAP slappasswd with {MD5}, {SHA}, {SMD5}, {CRYPT} AND {SSHA}
>> algorithms. Therefore I am wondering if any one has similar experience
>> that can share with me. Any hints, tips would be much appreciated!
>> Thanks
>> Eric Jiang

Here it is :

in includes/GlobalFunctions.php :

function wfEncryptPassword( $userid, $password ) {
	global $wgPasswordSalt;
	$p = md5( $password);

		return md5( "{$userid}-{$p}" );
		return $p;

More information about the MediaWiki-l mailing list