Custom MySQL Queries

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

Custom MySQL Queries

JennyBlunt
Hello

What's the best approach regarding custom mysql queries? I'd like to check if a user is blocked whilst authorising..

Have tried to add something like this to my dictionary file:

ATTRIBUTE       User-Disabled-Attr      3002    integer

And then putting a 1 / 0 in to radcheck against the user.

What's the best way to do this kind of request? Is it better to write a lookup somewhere else?

Thanks

J
| Threaded
Open this post in threaded view
|

Re: Custom MySQL Queries

Suman Dash
If you would like to disable a user why not to use the Auth-Type := Reject which is natively available in freeradius. I don't think it is necessary to re-invent the wheel.

Regards
Suman

On Thu, Oct 27, 2011 at 11:07 PM, JennyBlunt <[hidden email]> wrote:
Hello

What's the best approach regarding custom mysql queries? I'd like to check
if a user is blocked whilst authorising..

Have tried to add something like this to my dictionary file:

ATTRIBUTE       User-Disabled-Attr      3002    integer

And then putting a 1 / 0 in to radcheck against the user.

What's the best way to do this kind of request? Is it better to write a
lookup somewhere else?

Thanks

J

--
View this message in context: http://freeradius.1045715.n5.nabble.com/Custom-MySQL-Queries-tp4943692p4943692.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


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

RE: Custom MySQL Queries

Tim Sylvester
In reply to this post by JennyBlunt
I usually add Auth-Type := Reject to the radcheck table to disable a user.
You remove the entry to enable the user.

Tim

> -----Original Message-----
> From: freeradius-users-
> bounces+tim.sylvester=[hidden email]
> [mailto:freeradius-users-
> bounces+tim.sylvester=[hidden email]] On Behalf
> Of JennyBlunt
> Sent: Thursday, October 27, 2011 10:37 AM
> To: [hidden email]
> Subject: Custom MySQL Queries
>
> Hello
>
> What's the best approach regarding custom mysql queries? I'd like to check
if
> a user is blocked whilst authorising..
>
> Have tried to add something like this to my dictionary file:
>
> ATTRIBUTE       User-Disabled-Attr      3002    integer
>
> And then putting a 1 / 0 in to radcheck against the user.
>
> What's the best way to do this kind of request? Is it better to write a
lookup

> somewhere else?
>
> Thanks
>
> J
>
> --
> View this message in context:
> http://freeradius.1045715.n5.nabble.com/Custom-MySQL-Queries-
> tp4943692p4943692.html
> Sent from the FreeRadius - User mailing list archive at Nabble.com.
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html

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

RE: Custom MySQL Queries

JennyBlunt
Hi,

I hadn't realised that was available.

Do I need to modify my query - have added that column to the radcheck table but can still login.

J
| Threaded
Open this post in threaded view
|

RE: Custom MySQL Queries

JennyBlunt
Sorry, my mistake - I had not added as another row in my radcheck table.

Is there a decent online reference for such commands - I find myself wasting a lot of time here and looking through other forums...
| Threaded
Open this post in threaded view
|

Re: Custom MySQL Queries

Bjørn Mork
JennyBlunt <[hidden email]> writes:

> Sorry, my mistake - I had not added as another row in my radcheck table.
>
> Is there a decent online reference for such commands - I find myself wasting
> a lot of time here and looking through other forums...

The Wiki is starting to look very good.  Thanks to everyone who has
contributed!

For e.g. your specific question:
http://wiki.freeradius.org/FAQ#How+do+I+deny+access+to+a+specific+user%2C+or+group+of+users%3F


There is also a whole lot of great documentation and real life examples
in the default configuration files. Although there may seem to be an
overwhelming number of them, I do recommend briefly looking through all
of them from time to time.  You will probably go "hey, that looks like a
useful feature I might need one day!" at least once every time.


The main problem with the documentation and configuration is that
FreeRADIUS is a very powerful and flexible toolbox, being capable of
doing a whole lot of things that you may not need.  The flexibility and
feature set implies that there is a whole lot of documentation to read.
That's work.  There are no shortcuts.

There is of course also the issue that there is a whole lot of
documentation to write... But most of that job is actually done.  Which
makes reading it much more work :-)

And if you still find that your issue wasn't documented, then this *is*
an open source project.  Which means that the source code can and should
be used as a reference as well.  And that anyone is welcome to fix any
shortcoming they find, both in source or documentation.


Bjørn

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

Re: Custom MySQL Queries

JennyBlunt
Hi Bjorn

You're right, it's just overwhelming when you get started - I've worked on numerous apps, platforms etc. over the years and freeradius is possibly the most challenging. Fortunately, not because it's really difficult, but as you say, because there's a lot going on.

It's fantastic the people in this forum help and I can't express thankful I am :)

Have a good weekend

J