forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Convertors => Topic started by: Nibbler on April 07, 2005, 06:00:41 pm

Title: Import users from an access database or any csv file.
Post by: Nibbler on April 07, 2005, 06:00:41 pm
As specified here (http://forum.coppermine-gallery.net/index.php?topic=16414.0) this script will import users into the coppermine database from a csv (comma seperated values) file that can be created by most spreadsheet applications. For this the csv file was of the form

Code: [Select]
"Password","UserName","FullName","E-Mail"
with one user per line. (The FullName field was unused)

To use the script, remove the .txt ending, upload into your coppermine directory, login as admin, and browse to the file. It will then prompt you to upload the csv file and display the results. To add users at a later date you can upload a new csv file with the users you wish to add. Any duplicates will be discarded. Usernames must be unique. There is no validation of the details imported.

Designed for unbridged standalone 1.3 but can work with 1.2 or 1.4 with slight modification.

Thanks go to coffejor for funding this mod.
Title: Re: Import users from an access database or any csv file.
Post by: Gary B on January 26, 2006, 10:16:47 pm
What type of modification is needed to work with the current version?
Title: Re: Import users from an access database or any csv file.
Post by: Nibbler on January 26, 2006, 10:18:30 pm
For 1.4, find

Code: [Select]
db_query
change to

Code: [Select]
cpg_db_query
Title: Re: Import users from an access database or any csv file.
Post by: Gary B on January 26, 2006, 10:19:52 pm
Man that was fast! Thanks!
Title: Re: Import users from an access database or any csv file.
Post by: alexr on September 12, 2007, 06:39:28 am
Could you tell me some more info regarding running this script

1) You mention: Upload into your coppermine directory - are you referring to a specific folder at all?

2) After logging in as admin how do you browse to the file?

Thanks,
Alex

Running version 1.4.12
Title: Re: Import users from an access database or any csv file.
Post by: jvt on August 20, 2009, 06:11:31 pm
I came to need this feature, but it didn't seem to work. I had to slightly modify the file:

replace the line:

'password' => $parts[0],

by:

'password' => ($CONFIG['enable_encrypted_passwords'])?md5($parts[0]):$parts[0],

Thanks to the original poster, however, it is easier to modify than to code from scratch...