Skip to content
Snippets Groups Projects
Commit a446e73a authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Added SQL userdb framework

parent 5d41d053
No related branches found
No related tags found
No related merge requests found
# SQL user database support
#
# Copyright (C) 2008, AllWorldIT
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
package mod_sql_test;
use strict;
use warnings;
# Modules we need
use smradius::constants;
# Exporter stuff
require Exporter;
our (@ISA,@EXPORT,@EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT = qw(
);
@EXPORT_OK = qw(
);
# Plugin info
our $pluginInfo = {
Name => "SQL User Database",
Init => \&init,
# User database
User_find => \&find,
User_get => \&get,
};
## @internal
# Initialize module
sub init
{
my $server = shift;
}
## @find
# Try find a user
#
# @param server Server object
# @param user User
# @param packet Radius packet
#
# @return Result
sub find
{
my ($server,$user,$packet) = @_;
# TODO: Query database and see if this user exists
return MOD_RES_SKIP;
}
## @get
# Try to get a user
#
# @param server Server object
# @param user User
# @param packet Radius packet
#
# @return Result
sub get
{
my ($server,$user,$packet) = @_;
# TODO: Query user and get attributes, return in $userDetails hash
return $userDetails;
}
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment