Hi I believe you want some user's to login from single nas and reject in case it try to login from some other NAS. In that case you can NAS-IP-Address attribute to check against user request. Regards Vijay A. On Feb 12, 2015 7:06 PM, "mohammed Erheem" <mohammed059@gmail.com> wrote:
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 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html