import users whose passwords are hashed with crypt()

Gunstick

Joined: 2007-01-06
Posts: 5
Posted: Sun, 2007-01-07 00:23

Hi

I have a userbase of around 8000 people which I would like to import into gallery2.
Unfortunately, the password file is in unix crypt style which is not md5.

My current idea is to make the 8000 createUser calls and give the crypt string as hashedpassword and pretend it's md5. Then modify the code in modules/core/classes/GalleryUser.class (I guess in isCorrectPassword) so that it also is able to verify crypt type passwords.
Maybe even (if the crypt check is ok) add an automatic call to changePassword to change from crypt to md5.

Opinions?

Georges

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-01-09 16:09

the g2 password hash function isn't configurable / plugable yet.

your plan sounds reasonable. as a long term solution, i envision either a HashMethod field per user or just a global one for the whole gallery.

--------------
Enter the Gallery 2 Theme Contest today!