LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   help needed for a mysql freeradius simple management (https://www.linuxquestions.org/questions/programming-9/help-needed-for-a-mysql-freeradius-simple-management-645159/)

tanoatlq 05-27-2008 03:42 PM

help needed for a mysql freeradius simple management
 
Hello,
I am developing a small project to manage accounts provided by a captive
portal solution chillispot-freeradius-mysql, and I need help about working with
sql tables to do those few tasks the web interface should provide to admin users.
I need to know how to:

- add an account

- remove an account

- show all accounts with the total time of all their connections

From what I understand, add an account is simple, all I have to do is add a record
to radcheck table like after checked that the username is not already present:
(I think that perhaps I have to check even also if the username is not present
in radacct, to not confuse with old users that work in past sessions)

mysql> select username from radcheck where username = 'John Doe';

..

(if 0 rows returned, continue)

mysql> select username from radacct where username = 'John Doe';

..

(if 0 rows returned, continue)

mysql> insert into radcheck (username, attribute, value, op) values ('John Doe', 'User-Password', 'x2jadfds', ':=');


However in an example from the oreilly book that the op is left as the default value ('=='),
while in another software that do a task like what I what should like to do (phpmyprepaid),
the attribute is "User-Password", and the op is ":=". What difference?

To remove an account, I should delete all the records in radcheck that have the username
I want to remove, so:

mysql> delete from radcheck where username = 'John Doe';

But I would like to know, if the user has currently a session active, i.e.
it is connected to the service provided, it is immediately disconnected or
the session continue?

And moreover, I have some problems with radacct.
How to do the last task?
On the web I found few resources about manage freeradius with mysql.
Suggestions? Links?
Thanks,
tano


All times are GMT -5. The time now is 01:51 PM.