18 Sep
2012
18 Sep
'12
3:56 a.m.
On Tue, Sep 18, 2012 at 2:44 PM, Václav Pernica <vpl@email.cz> wrote:
One more question. Is there some easy way, how to use different SQL queries (authorize_check_query, authorize_reply_query) depending on the user name prefix or suffix.
E.g.: user_name@domain1 -> use SQL queries 1 user_name@domain2 -> use SQL queries 2
If the variant is limited, unlang might be useful. e.g. (untested): authorize { if (%{User-Name} == "user_name@domain1") { sql1 } elsif (%{User-Name} == "user_name@domain2") { sql2 } ... } see "man unlang" for details. Depending on what you need and how you configure your system, you might also be able to use Realm instead of User-Name, or use regex for comparison. -- Fajar