Login User From Specific NAS
mohammed Erheem
mohammed059 at gmail.com
Thu Feb 12 14:31:43 CET 2015
Hello
I need some users to login from specific nas
this is my query
if ("%{sql: SELECT count(nas.id) FROM users_table JOIN users_routers_table
ON users_table.user_create_by = users_routers_table.cpanel_id JOIN nas on
users_routers_table.nas_id = nas.id WHERE users_table.user_name =
'%{User-Name}'" > 0 && "%{sql: SELECT count(nas.id) FROM users_table JOIN
users_routers_table ON users_table.user_create_by =
users_routers_table.cpanel_id JOIN nas on users_routers_table.nas_id =
nas.id WHERE users_table.user_name = '%{User-Name}' AND nas.nasname =
'%{NAS-IP-Address}'" == 0) {
reject
}
this structure of table
+----------------+-----------+--------+
| user_router_id | cpanel_id | nas_id |
+----------------+-----------+--------+
| 15 | 1 | 109 |
+----------------+-----------+--------+
when i add row in users_router_table from cpanel with id 1 and the user was
created by cpanel user with id 1
the user login form any nas
what the problem in if statement
More information about the Freeradius-Users
mailing list