Hello,
I need to insert about 500 users into MODx (Evo 1.4) as web users from an existing csv table (previous website), including usernames and passwords. The 500 users then will get a notice with their web user name and password, so they don’t need to register any more. I dont’t know how to handle this in order to get the passwords correctly transferred into the right format (md5?).
Thanks for any hints!
-
☆ A M B ☆
- 24,524 Posts
When I do something like this, I write a (relatively) simple .php script to read and convert the .csv file to sql insert instructions. Then I can just import the .sql file the script generates. Here’s an example you can modify
http://www.codewalkers.com/c/a/Database-Code/CSV-to-SQL-convertor/
Thanks very much for your quick reply and the csv2sql-script link.
Is it correct to encrypt the predefined passwords into the modx_web_users table using md5($password), do I need the $raw_output parameter for the md5 function? Thanks again!
-
☆ A M B ☆
- 24,524 Posts
I always just use md5($password) in the loop to generate the insert line.