Bulk Import of Permanent Users
- As of SVN version 485 you can now with ease import users in bulk into YFi.
- Simply make use of the 3rd Party API.
-
Remember to create an Access Provider specially for this purpose (by default you should call it 3rd_sms to be the same as that specified in the 3rd_parties_controller's code):
$this->layout = 'ajax'; //To send JSON from the web server
$key_master = '123456789';
$access_provider= '3rd_sms'; //The name of the Access Provider that this will be made the creator of
-
Use the attached Perl script and Dummy CSV file on this page as a guidline to do the mass import.
- If you have problems, suggestions or need extra help, add it to this thread on the forum: https://sourceforge.net/projects/hotcakes/forums/forum/728131/topic/4663413/
HOWTO
- Set up a YFi Hotspot Manager server using the latest SVN version of the software. (https://sourceforge.net/apps/trac/hotcakes/wiki/yfi_setup_svn)
- Download the file bulk_import.pl (which is attached to this page) onto the server where you just installed the YFi Hotspot Manager on.
-
Make sure it is executable by changing directory to where the file is and running the following command there:
chmod 755 ./bulk_import.pl
-
The file bulk_import.pl expects that there will be a file called dummy.csv in the same directory where it is located where the bulk of the users is defined.
- It expects the users to be in CSV format and in the following order: <surname>,<name>,<user_id>,<email>,<telephone number> e.g. van der Walt,Dirk,dvdwalt,dvanderwalt@‌,012-804-1234.
- See to it that the file dummy.csv is in that format and contains all your users.
- bulk_import.pl will use the user_id for the password as well as the username.
- The 3rd Party API requires that an Access Provider with the name of 3rd_sms be created and be assigned to the realm specified in bulk_import.pl. Be sure it exists before attempting to import the users.
There are also some values that can be tweaked in bulk_import.pl:
- The realm a user will be part of ($realm).
- The profile a user will belong to ($profile).
- The name and location of the CSV file ($csv_file).
- The type of cap ($cap).
When any of the values you want to specify for these variables have a space in, replace the space with a plus sign, eg Residence Inn will be specified as Residence+Inn.
When all is set-up you can run the following command in the directory where bulk_import.pl is: