There was a bulk inport procedure/script in Yfi MAnager but not such a thing in RadiusDesk, or atleast I can't find any tutorial on that. So, can someone point me to a way to import users into the system. I need "username" with "password" added to a "plan/profile"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks again for your kind reply. Lot's of activity in the forum today, I was losing hope, but we are(the forum) alive :). I can read php code, but I'm not a developoer for sure. I'll look at it, but basicly I want to know the short way -- some SQL command or json import script as in Yfi Manager is the right way to go. I want to import som 10000 users(students) to the system, just username, password and attach to them a plan/profile.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need some hint how to use this PHP file/api. Where should I run this php file from? How to serve my usernames to this file? Where to past it, should I run It from bash or invoke It from a browser? Let's hope I'm not too pushy but I need this for my migration from Yfi to RADIUSdesk, if I can't import my users all at once, I'm stuck to the old Yfi Manager. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm hoping to format my CentOS server with Yfi and put RADIUSdesk onto it and import all the students and flash all my NanoStation M2 AP (about 15) this weekend and introduce RADIUSdesk on monday. But It's not by no means critical, I have time.
I tested running the php from a browser with just one user defined to the variables and it is working fine.
By the way -- Greetings from Bulgaria and want to thank you for the perfect job You have done, both with Yfi and RADIUSdesk.
Regards
Nikolay Naumov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Works like a charm with small number of users. I'll make some modifications to the php script, just to put "name" an "surname" in csv file and change the "cap" to "hard", and on Monday I'll test the script with 14000 users.
One question I have to ask, I want to do tracking so I want "RADIUS authentication" and "RADIUS accounting" checked in RD. So, What are the permitted values of "*track_acct" variable in the API for adding users (I believe this is for "RADIUS accounting" tracking) and is there a variable for "RADIUS authentication"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After some debugging error tracing, I found out that the "password" is INCORRECT. When I open the "radcheck" table I can see that the column with the value of the password is ill formatted. It's slightly bigger than the other password fields which were created in web interface, I think the script puts some kind of TAB or Newline special character in the column. When I change the password of the user via the web interface tool called "Password Manager" and just type it the same and press SAVE everything is fine and the "select * from radcheck" shows all the password columns with the same (right) width.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[FIX]
I've managed to fix the problem by changing the function on line 76 in the of the file BulkPermanentUserShell.php.
I replaced the line that says:
$items = explode(',',$i);
with this one:
$items = preg_split ('/[,\s]+/', $i);
and then from terminal I run the command:
su -s /bin/sh apache -c "/var/www/html/cake2/rd_cake/Console/cake -app /var/www/html/cake2/rd_cake bulkPermanentUser"
[Offtopic] P.S. Sorry for my bad text formatting in this forum, but I can't understand how to use Formatting Help button
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for late reply, U dont't need to download It, It's in the RADIUSdesk, you just need to edit It to suit your needs. The location of the file is in: /your_web_document_root/cake2/rd_cake/Console/Command/BulkPermanentUserShell.php
And then from the server cli you shoul run the following command to run tha import:
su -s /bin/sh apache -c "/var/www/html/cake2/rd_cake/Console/cake -app /var/www/html/cake2/rd_cake bulkPermanentUser"
Note: I'm on a CentoOS 6.7 and apache web server, and I'm a bit off dated ;-) using cake2. Take a look at your BulkPermanentUserShell.php and edit accordingly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the clear explanation. I managed to import some testing users using BulkPermanentUserShell.php, and as you said, I need to edit line 76 to make the authentication works.
Also we have another requirement, we have around 500 users and each user have different expiration date. How if we want to import all 500 users using csv file that contains also expiration date?
Your help is highly appreciated.
Thank You.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi dny!
just add these 2 parameters to the post data:
from_date, to_date.
from_date can be a static string. to_date needs to be acquired from csv, so add an item in the parsing section.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi, just wish to know the root password for radiusdesk when in the shell i.e when you need to change from and ordinary user to a root user. thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@dvdwalt, I have deployed radiusdesk in Ubuntu 18.04. I can't import bulk user from CSV, it gives the following error. Can you please give me some hint to solve the issue. Thanks in advance.
Error: [Cake\Controller\Exception\MissingActionException] Action VouchersController::addCsv() could not be found, or is not accessible.Exception Attributes: array ( 'controller' => 'VouchersController', 'action' => 'addCsv', 'prefix' => '', 'plugin' => false,)
There was a bulk inport procedure/script in Yfi MAnager but not such a thing in RadiusDesk, or atleast I can't find any tutorial on that. So, can someone point me to a way to import users into the system. I need "username" with "password" added to a "plan/profile"
Hi,
Have a look at this write-up:
http://www.radiusdesk.com/developers_corner/api
If you know a bit of PHP it should get you going, but if you get stuck; let us know where you battle.
Kind regards
Thanks again for your kind reply. Lot's of activity in the forum today, I was losing hope, but we are(the forum) alive :). I can read php code, but I'm not a developoer for sure. I'll look at it, but basicly I want to know the short way -- some SQL command or json import script as in Yfi Manager is the right way to go. I want to import som 10000 users(students) to the system, just username, password and attach to them a plan/profile.
Hi Dirk, I can't open the link. It says "This topic does not exist yet". I need to import around 300 users, your help is appreciated.
I need some hint how to use this PHP file/api. Where should I run this php file from? How to serve my usernames to this file? Where to past it, should I run It from bash or invoke It from a browser? Let's hope I'm not too pushy but I need this for my migration from Yfi to RADIUSdesk, if I can't import my users all at once, I'm stuck to the old Yfi Manager. Thanks!
Hi,
By when is the latest that you want this? I can slap together something that will read username and password combinations from file.
Regards
I'm hoping to format my CentOS server with Yfi and put RADIUSdesk onto it and import all the students and flash all my NanoStation M2 AP (about 15) this weekend and introduce RADIUSdesk on monday. But It's not by no means critical, I have time.
I tested running the php from a browser with just one user defined to the variables and it is working fine.
By the way -- Greetings from Bulgaria and want to thank you for the perfect job You have done, both with Yfi and RADIUSdesk.
Regards
Nikolay Naumov
Hi Nikolay
Rather late than never. The latest SVN has a Shell script which you can use. (You will run this from a terminal)
It is important to run this script as user www-data.
Then also check where the Shell script is situated. If you run Nginx the path has to change (usr/share/nginx/www instead of /var/www).
The following is the output from my dev machine running Apache:
Let us know if you have problems or if something is unclear to you.
Cheers
Solve: Sorry , nginx was listening on other port. Works perfectly.
Thanks.
Last edit: Victor Ors 2016-11-23
PS here's a snippet of the users.csv file
Works like a charm with small number of users. I'll make some modifications to the php script, just to put "name" an "surname" in csv file and change the "cap" to "hard", and on Monday I'll test the script with 14000 users.
One question I have to ask, I want to do tracking so I want "RADIUS authentication" and "RADIUS accounting" checked in RD. So, What are the permitted values of "*track_acct" variable in the API for adding users (I believe this is for "RADIUS accounting" tracking) and is there a variable for "RADIUS authentication"?
Just find out that the creation of the user is ok, but no radius respond for the user. When I test It via RADIUS client in RD I get the following:
Request Attributes
User-Name = nikonaum1
User-Password = parola1
Reply Attributes is in red and nothing shows under It.
After some debugging error tracing, I found out that the "password" is INCORRECT. When I open the "radcheck" table I can see that the column with the value of the password is ill formatted. It's slightly bigger than the other password fields which were created in web interface, I think the script puts some kind of TAB or Newline special character in the column. When I change the password of the user via the web interface tool called "Password Manager" and just type it the same and press SAVE everything is fine and the "select * from radcheck" shows all the password columns with the same (right) width.
+------+-----------+--------------------+----+---------+
| id | username | attribute | op | value |
+------+-----------+--------------------+----+---------+
| 8481 | dvdwalt | Cleartext-Password | := | dvdwalt |
| 8573 | rviljoen | Cleartext-Password | := | koos |
| 8588 | 000001 | Cleartext-Password | := | bN3 |
| 8597 | 000002 | Cleartext-Password | := | wxs |
| 8601 | 000003 | Cleartext-Password | := | GzD |
| 8605 | 000004 | Cleartext-Password | := | f57 |
| 8609 | 000005 | Cleartext-Password | := | jf3 |
| 8613 | 000006 | Cleartext-Password | := | Hp0 |
| 8617 | 000007 | Cleartext-Password | := | Tx7 |
| 8621 | 000008 | Cleartext-Password | := | j9T |
| 8625 | 000009 | Cleartext-Password | := | vJ3 |
| 8629 | 000010 | Cleartext-Password | := | 16k |
| 8633 | 000011 | Cleartext-Password | := | PFs |
| 8637 | 000012 | Cleartext-Password | := | hwP |
| 8641 | 000013 | Cleartext-Password | := | 61N |
| 8651 | 000014 | Cleartext-Password | := | gonow |
| 8652 | koos | Cleartext-Password | := | koos |
| 8667 | 000015 | Cleartext-Password | := | z3s |
| 8672 | user1 | Cleartext-Password | := | user1 |
| 8685 | user2 | Cleartext-Password | := | user2 |
| 8738 | nikonaum | Cleartext-Password | := | parola |
| 8784 | nikonaum1 | Cleartext-Password | := | parola1 |
| 8785 | naum40 | Cleartext-Password | := | naum40
|
| 8793 | niko1 | Cleartext-Password | := | niko1
|
| 8801 | niko5 | Cleartext-Password | := | niko5
|
| 8809 | niko6 | Cleartext-Password | := | niko6
|
The last 4 records are those imported by the script and not working due to: [pap] Passwords don't match message in radiusd
[FIX]
I've managed to fix the problem by changing the function on line 76 in the of the file BulkPermanentUserShell.php.
I replaced the line that says:
$items = explode(',',$i);
with this one:
$items = preg_split ('/[,\s]+/', $i);
and then from terminal I run the command:
su -s /bin/sh apache -c "/var/www/html/cake2/rd_cake/Console/cake -app /var/www/html/cake2/rd_cake bulkPermanentUser"
[Offtopic] P.S. Sorry for my bad text formatting in this forum, but I can't understand how to use Formatting Help button
Hi nikonaum,
Where can I download this BulkPermanentUserShell.php script? And all script that needed to do bulk import users to Radius Desk?
Sorry for late reply, U dont't need to download It, It's in the RADIUSdesk, you just need to edit It to suit your needs. The location of the file is in: /your_web_document_root/cake2/rd_cake/Console/Command/BulkPermanentUserShell.php
And then from the server cli you shoul run the following command to run tha import:
su -s /bin/sh apache -c "/var/www/html/cake2/rd_cake/Console/cake -app /var/www/html/cake2/rd_cake bulkPermanentUser"
Note: I'm on a CentoOS 6.7 and apache web server, and I'm a bit off dated ;-) using cake2. Take a look at your BulkPermanentUserShell.php and edit accordingly.
Hi nikonaum,
Thanks for the clear explanation. I managed to import some testing users using BulkPermanentUserShell.php, and as you said, I need to edit line 76 to make the authentication works.
Also we have another requirement, we have around 500 users and each user have different expiration date. How if we want to import all 500 users using csv file that contains also expiration date?
Your help is highly appreciated.
Thank You.
hi dny!
just add these 2 parameters to the post data:
from_date, to_date.
from_date can be a static string. to_date needs to be acquired from csv, so add an item in the parsing section.
Regards
hi, just wish to know the root password for radiusdesk when in the shell i.e when you need to change from and ordinary user to a root user. thanks in advance
@dvdwalt, I have deployed radiusdesk in Ubuntu 18.04. I can't import bulk user from CSV, it gives the following error. Can you please give me some hint to solve the issue. Thanks in advance.
Last edit: Md. Abu Noman 2020-01-18