Change SQL Groupcheck Query in Dialup.conf

classic Classic list List threaded Threaded
4 messages Options
| Threaded
Open this post in threaded view
|

Change SQL Groupcheck Query in Dialup.conf

JennyBlunt
I need to change the structure of the radusergroup table so it includes the radcheck_id and radgroupcheck_id's.

Currently it's set to use the username and groupname.

I'm editing the following sections in dialup.conf

          group_membership_query = "SELECT groupname \
          FROM ${usergroup_table} \
          WHERE username = '%{SQL-User-Name}' \
          ORDER BY priority"

However, I need to know if it possible to change SQL-User-Name to use the radcheck id instead?

Is it possible to look up the user id prior to this statement running? Ideally, it would then look like this:


 group_membership_query = "SELECT radgroup_id \
          FROM ${usergroup_table} \
          WHERE username = '%{SQL-User-ID}' \
          ORDER BY priority"

If so, where do I do this?

| Threaded
Open this post in threaded view
|

Re: Change SQL Groupcheck Query in Dialup.conf

Alan DeKok-2
JennyBlunt wrote:
> I need to change the structure of the radusergroup table so it includes the
> radcheck_id and radgroupcheck_id's.

  Why?  And even if there is a good reason, it's just SQL...

> However, I need to know if it possible to change SQL-User-Name to use the
> radcheck id instead?

  Yes.  That's why the queries are editable.  So you can edit them,

> Is it possible to look up the user id prior to this statement running?

  Yes.  It's just another SQL query:

        update request {
                SQL-User-Id := "%{sql: ...}"
        }

> If so, where do I do this?

  In the "authorize" section.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Change SQL Groupcheck Query in Dialup.conf

JennyBlunt
Yes, it's a bit annoying.... Our front end management system is / will be built using ruby on rails.

RoR seems a little funny with join tables when they don't use IDs. Hence the need for a change to the sql. The same went for the attribute column which we needed to alter too.

Have things working fine - thanks for help
| Threaded
Open this post in threaded view
|

Re: Change SQL Groupcheck Query in Dialup.conf

Alan DeKok-2
JennyBlunt wrote:
> Yes, it's a bit annoying.... Our front end management system is / will be
> built using ruby on rails.
>
> RoR seems a little funny with join tables when they don't use IDs. Hence the
> need for a change to the sql. The same went for the attribute column which
> we needed to alter too.

  That's... strange.  The IDs aren't used by FreeRADIUS, and can be
ignored.  The attribute column is just the name of the attribute.  Why
would it change to anything else?

> Have things working fine - thanks for help

  It's what we do.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html