The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

VUser::Radius::SQL - SQL support for the VUser::Radius vuser extension

DESCRIPTION

Adds support for storing RADIUS user information in a SQL database.

CONFIGURATION

 [vuser]
 extensions = Radius::SQL
 
 [Extension Radius::SQL]
 # Database driver to use.
 # The DBD::<driver> must exist or vuser will not be able to connect
 # to your database.
 # See perldoc DBD::<driver> for the format of this string for your database.
 dsn = DBI:mysql:database=database_name;host=localhost;post=3306

 # Database user name
 username = user
 
 # Database password
 # The password may not end with whitespace.
 password = secret
 
 ## SQL Queries
 # Here you define the queries used to add, modify and delete users and
 # attributes. There are a few predefined macros that you can use in your
 # SQL. The values will be quoted and escaped before being inserted into
 # the SQL.
 #  %u => username
 #  %p => password
 #  %r => realm
 #  %a => attribute name
 #  %v => attribute value
 #  %-option => This will be replaced by the value of --option passed in
 #              when vuser is run.
 
 # Add a RADIUS account
 adduser_query = INSERT into user set user = %u, password = %p, realm = %r
 
 # Delete a RADIUS account
 rmuser_query = DELETE from user where user = %s and realm = %r
 
 # Change a user's password
 moduser_password_query = UPDATE user set ...
 
 # Change an account's realm only
 moduser_realm_query = UPDATE user set ...
 
 # Change an account's username only
 moduser_username_query = UPDATE user set ...
 
 # Change both the username and the realm
 moduser_userrealm_query = UPDATE user set ...
 
 # Here, we need a way to map columns to values
 # Fixed columns:
 #   1 username
 #   2 realm
 listusers_query = SELECT username, realm from user
 
 # Here, we need a way to map columns to values
 # Fixed columns:
 #   1 username
 #   2 realm
 #   3 password
 userinfo_query = SELECT * from user where user = %s and realm = %r
 
 addattrib_check_query = INSERT into ...
 rmattrib_check_query  = DELETE from ...
 modattrib_check_query = UPDATE ...
 listattrib_check_query = SELECT ...
 
 addattrib_reply_query = INSERT into ...
 rmattrib_reply_query  = DELETE from ...
 modattrib_reply_query = UPDATE ...
 listattrib_reply_query = SELECT ...

AUTHOR

Randy Smith <perlstalker@vuser.org>

LICENSE

 This file is part of vuser.
 
 vuser is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
 vuser is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with vuser; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA