Importing users

Permalink 1 user found helpful
I have an excel file with 300 users I'd like to import into the database. It holds basic accountinformation (username, password etc) and additionally created attributes.

I would like to import this through phpmyadmin, but does anyone have experience with this?

1. How can I encrypt the passwords before / after importing them to the database.

2. How can I import into the right tabels (which tables) and which field-connections do I have to take into consideration?

I hope somebody has some suggestions for this, it would save me a lot of time.

Thank you in advance,

Robert

RobertJNL
 
griebel replied on at Permalink Reply
griebel
Export xls to csv file (you can use OpenOffice), and use PHP to read data from the comma seperated file.

Create a loop and import data with code like this.

$data = array(
    'uName' => 'johndoe',
    'uEmail' => 'johndoe@gmail.com',
    'uPassword' => 'johndoespass'
);
$ui = UserInfo::add($data);


Automatic encryption of password.

Read more at Scripting common Concrete5 tasks..http://www.concrete5.org/help/building_with_concrete5/developers/mv...

Good luck
RobertJNL replied on at Permalink Reply
RobertJNL
Hi Griebel,

thanks for your reply and the code snippet! Gonna play around with it some (not greatly skilled php'er, i read more than i write) but it seems do-able. Thanks for your quick and extensive reply!

Robert