2

How do I take a plaintext password and insert an entry in the MySQL database that MediaWiki uses, that would comply to MediaWiki's password rules?

I found this article on how they store their passwords, but I can't seem to figure out how I can create my own passwords in PHP to then upload them to the database using their "pbkdf2" hashing stuff.

I have my own PHP user registration script, which authenticates my users into multiple applications and I want to copy everyone's hash and paste it into all their accounts, so all their passwords would be the same on all the applications.

Eliter
  • 153
  • 2
  • 10

1 Answers1

1

Look at User::setPasswordInternal(), you can do something similar. Or use changePassword.php. Although ideally you should just create an authentication provider that looks up the password in your central database instead of the MediaWiki database. Otherwise you run into trouble when the password rules for MediaWiki do not match that of other applications, the user changes passwords in MediaWiki, etc.

Tgr
  • 27,442
  • 12
  • 81
  • 118