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
On Feb 12, 2015, at 8:31 AM, mohammed Erheem <mohammed059@gmail.com> wrote:
I need some users to login from specific nas
Which should be simple enough to do.
this is my query
Which is completely incomprehensible.
what the problem in if statement
It’s impossible to know. Re-write your schema and queries to be simple. Then, debug them. Alan DeKok.
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
It´s possible to use hunt-groups and create an specific group of users for
specifics NAS .
http://wiki.freeradius.org/guide/SQL-Huntgroup-HOWTO
Victor Ors - Agh Sistemas - Servidores, Redes Cableadas y Wifi
Av Alay 3, 29630 Benalmadena Costa, Malaga, Spain
Tel.: +34 952 441 147
Averias 24h.:+34 654 94 86 94
http://www.aghsistemas.com
AVISO LEGAL: CLÁUSULA DE CONFIDENCIALIDAD (AGH SISTEMAS)
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede
contener información confidencial o legalmente protegida (LOPD 15/1999 de
13 de Diciembre), siendo para uso exclusivo del destinatario. No hay
renuncia a la confidencialidad o secreto profesional por cualquier
transmisión defectuosa o errónea, y queda expresamente prohibida su
divulgación, copia o distribución a terceros sin la autorización expresa
del remitente. Si ha recibido este mensaje por error o no desea recibir
información comercial, se ruega lo notifique al remitente enviando un
mensaje al correo electrónico, con el asunto (dar de baja o no deseo
recibir información comercial),wifi@aghsistemas.com <ventas@aghsistemas.com> y
proceda inmediatamente al borrado del mensaje original y de todas sus
copias. Gracias por su colaboración
2015-02-12 16:44 GMT+01:00 Vijay S <vijay.hcr@gmail.com>:
> 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
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
participants (4)
-
Agh Sistemas -
Alan DeKok -
mohammed Erheem -
Vijay S