Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • smradius/smradius
  • centiva-shail/smradius
  • nkukard/smradius
3 results
Show changes
# SQL user database support for mac authentication # SQL user database support for mac authentication
# Copyright (C) 2007-2011, AllWorldIT # Copyright (C) 2007-2016, AllWorldIT
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License along # 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
...@@ -21,13 +21,13 @@ use strict; ...@@ -21,13 +21,13 @@ use strict;
use warnings; use warnings;
# Modules we need # Modules we need
use smradius::constants;
use AWITPT::Cache; use AWITPT::Cache;
use smradius::logging;
use AWITPT::DB::DBLayer; use AWITPT::DB::DBLayer;
use AWITPT::Util; use AWITPT::Util;
use smradius::util;
use smradius::attributes; use smradius::attributes;
use smradius::constants;
use smradius::logging;
use smradius::util;
# Exporter stuff # Exporter stuff
require Exporter; require Exporter;
...@@ -70,7 +70,7 @@ sub init ...@@ -70,7 +70,7 @@ sub init
# Default configs... # Default configs...
$config->{'userdb_macauth_find_query'} = ' $config->{'userdb_macauth_find_query'} = '
SELECT SELECT
user_attributes.ID, user_attributes.ID,
user_attributes.Operator, user_attributes.Disabled, user_attributes.Operator, user_attributes.Disabled,
users.Username, users.Disabled AS UserDisabled users.Username, users.Disabled AS UserDisabled
FROM FROM
...@@ -130,7 +130,8 @@ sub find ...@@ -130,7 +130,8 @@ sub find
foreach my $attr ($packet->attributes) { foreach my $attr ($packet->attributes) {
$template->{'request'}->{$attr} = $packet->rawattr($attr) $template->{'request'}->{$attr} = $packet->rawattr($attr)
} }
$template->{'user'} = $user;
# Add MAC address details
$template->{'user'}->{'MACAddress'} = $macAddress; $template->{'user'}->{'MACAddress'} = $macAddress;
# Replace template entries # Replace template entries
...@@ -138,7 +139,7 @@ sub find ...@@ -138,7 +139,7 @@ sub find
my $sth = DBSelect(@dbDoParams); my $sth = DBSelect(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"[MOD_USERDB_MACAUTH_SQL] Failed to find data for MAC address: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"[MOD_USERDB_MACAUTH_SQL] Failed to find data for MAC address: ".AWITPT::DB::DBLayer::error());
return MOD_RES_SKIP; return MOD_RES_SKIP;
} }
......
# SQL user database support # SQL user database support
# Copyright (C) 2007-2011, AllWorldIT # Copyright (C) 2007-2016, AllWorldIT
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License along # 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
...@@ -21,13 +21,13 @@ use strict; ...@@ -21,13 +21,13 @@ use strict;
use warnings; use warnings;
# Modules we need # Modules we need
use smradius::constants;
use AWITPT::Cache; use AWITPT::Cache;
use smradius::logging;
use AWITPT::DB::DBLayer; use AWITPT::DB::DBLayer;
use AWITPT::Util; use AWITPT::Util;
use smradius::util;
use smradius::attributes; use smradius::attributes;
use smradius::constants;
use smradius::logging;
use smradius::util;
# Exporter stuff # Exporter stuff
require Exporter; require Exporter;
...@@ -91,7 +91,7 @@ sub init ...@@ -91,7 +91,7 @@ sub init
FROM FROM
@TP@group_attributes, @TP@users_to_groups @TP@group_attributes, @TP@users_to_groups
WHERE WHERE
@TP@users_to_groups.UserID = %{userdb.ID} @TP@users_to_groups.UserID = %{user.ID}
AND @TP@group_attributes.GroupID = @TP@users_to_groups.GroupID AND @TP@group_attributes.GroupID = @TP@users_to_groups.GroupID
AND @TP@group_attributes.Disabled = 0 AND @TP@group_attributes.Disabled = 0
'; ';
...@@ -102,22 +102,22 @@ sub init ...@@ -102,22 +102,22 @@ sub init
FROM FROM
@TP@user_attributes @TP@user_attributes
WHERE WHERE
UserID = %{userdb.ID} UserID = %{user.ID}
AND Disabled = 0 AND Disabled = 0
'; ';
$config->{'users_data_set_query'} = ' $config->{'users_data_set_query'} = '
INSERT INTO INSERT INTO
@TP@users_data (UserID, LastUpdated, Name, Value) @TP@users_data (UserID, LastUpdated, Name, Value)
VALUES VALUES
( (
%{userdb.ID}, %{user.ID},
%{query.LastUpdated}, %{query.LastUpdated},
%{query.Name}, %{query.Name},
%{query.Value} %{query.Value}
) )
'; ';
$config->{'users_data_update_query'} = ' $config->{'users_data_update_query'} = '
UPDATE UPDATE
@TP@users_data @TP@users_data
...@@ -125,25 +125,25 @@ sub init ...@@ -125,25 +125,25 @@ sub init
LastUpdated = %{query.LastUpdated}, LastUpdated = %{query.LastUpdated},
Value = %{query.Value} Value = %{query.Value}
WHERE WHERE
UserID = %{userdb.ID} UserID = %{user.ID}
AND Name = %{query.Name} AND Name = %{query.Name}
'; ';
$config->{'users_data_get_query'} = ' $config->{'users_data_get_query'} = '
SELECT SELECT
LastUpdated, Name, Value LastUpdated, Name, Value
FROM FROM
@TP@users_data @TP@users_data
WHERE WHERE
UserID = %{userdb.ID} UserID = %{user.ID}
AND Name = %{query.Name} AND Name = %{query.Name}
'; ';
$config->{'users_data_delete_query'} = ' $config->{'users_data_delete_query'} = '
DELETE FROM DELETE FROM
@TP@users_data @TP@users_data
WHERE WHERE
UserID = %{userdb.ID} UserID = %{user.ID}
AND Name = %{query.Name} AND Name = %{query.Name}
'; ';
...@@ -165,10 +165,10 @@ sub init ...@@ -165,10 +165,10 @@ sub init
if (defined($scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}) && if (defined($scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}) &&
$scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'} ne "") { $scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'} ne "") {
if (ref($scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}) eq "ARRAY") { if (ref($scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}) eq "ARRAY") {
$config->{'userdb_get_group_attributes_query'} = join(' ', $config->{'userdb_get_group_attributes_query'} = join(' ',
@{$scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}}); @{$scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}});
} else { } else {
$config->{'userdb_get_group_attributes_query'} = $config->{'userdb_get_group_attributes_query'} =
$scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'}; $scfg->{'mod_userdb_sql'}->{'userdb_get_group_attributes_query'};
} }
} }
...@@ -179,7 +179,7 @@ sub init ...@@ -179,7 +179,7 @@ sub init
$config->{'userdb_get_user_attributes_query'} = join(' ', $config->{'userdb_get_user_attributes_query'} = join(' ',
@{$scfg->{'mod_userdb_sql'}->{'userdb_get_user_attributes_query'}}); @{$scfg->{'mod_userdb_sql'}->{'userdb_get_user_attributes_query'}});
} else { } else {
$config->{'userdb_get_user_attributes_query'} = $config->{'userdb_get_user_attributes_query'} =
$scfg->{'mod_userdb_sql'}->{'userdb_get_user_attributes_query'}; $scfg->{'mod_userdb_sql'}->{'userdb_get_user_attributes_query'};
} }
} }
...@@ -225,10 +225,14 @@ sub init ...@@ -225,10 +225,14 @@ sub init
} }
if (defined($scfg->{'mod_userdb_sql'}->{'userdb_data_cache_time'})) { if (defined($scfg->{'mod_userdb_sql'}->{'userdb_data_cache_time'})) {
if ($scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'} =~ /^\s*(yes|true|1)\s*$/i) { if (defined(my $val = isBoolean($scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'}))) {
# Default? # If val is true, we default to the default anyway
} elsif ($scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'} =~ /^\s*(no|false|0)\s*$/i) {
$config->{'userdb_data_cache_time'} = undef; # We're disabled
if (!$val) {
$config->{'userdb_data_cache_time'} = undef;
}
# We *could* have a value...
} elsif ($scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'} =~ /^[0-9]+$/) { } elsif ($scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'} =~ /^[0-9]+$/) {
$config->{'userdb_data_cache_time'} = $scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'}; $config->{'userdb_data_cache_time'} = $scfg->{'mod_userdb_sql'}{'userdb_data_cache_time'};
} else { } else {
...@@ -264,14 +268,16 @@ sub find ...@@ -264,14 +268,16 @@ sub find
foreach my $attr ($packet->attributes) { foreach my $attr ($packet->attributes) {
$template->{'request'}->{$attr} = $packet->rawattr($attr) $template->{'request'}->{$attr} = $packet->rawattr($attr)
} }
$template->{'user'} = $user;
# Add user details, not user ID is available here as thats what we are retrieving
$template->{'user'}->{'Username'} = $user->{'Username'};
# Replace template entries # Replace template entries
my @dbDoParams = templateReplace($config->{'userdb_find_query'},$template); my @dbDoParams = templateReplace($config->{'userdb_find_query'},$template);
my $sth = DBSelect(@dbDoParams); my $sth = DBSelect(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"[MOD_USERDB_SQL] Failed to find user data: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"[MOD_USERDB_SQL] Failed to find user data: ".AWITPT::DB::DBLayer::error());
return MOD_RES_SKIP; return MOD_RES_SKIP;
} }
...@@ -320,6 +326,11 @@ sub get ...@@ -320,6 +326,11 @@ sub get
foreach my $attr ($packet->attributes) { foreach my $attr ($packet->attributes) {
$template->{'request'}->{$attr} = $packet->rawattr($attr) $template->{'request'}->{$attr} = $packet->rawattr($attr)
} }
# Add user details
$template->{'user'}->{'ID'} = $user->{'ID'};
$template->{'user'}->{'Username'} = $user->{'Username'};
# Add in userdb data # Add in userdb data
foreach my $item (keys %{$user->{'_UserDB_Data'}}) { foreach my $item (keys %{$user->{'_UserDB_Data'}}) {
$template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item}; $template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item};
...@@ -331,7 +342,7 @@ sub get ...@@ -331,7 +342,7 @@ sub get
# Query database # Query database
my $sth = DBSelect(@dbDoParams); my $sth = DBSelect(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"Failed to get group attributes: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"Failed to get group attributes: ".AWITPT::DB::DBLayer::error());
return RES_ERROR; return RES_ERROR;
} }
...@@ -349,7 +360,7 @@ sub get ...@@ -349,7 +360,7 @@ sub get
# Query database # Query database
$sth = DBSelect(@dbDoParams); $sth = DBSelect(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"Failed to get user attributes: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"Failed to get user attributes: ".AWITPT::DB::DBLayer::error());
return RES_ERROR; return RES_ERROR;
} }
...@@ -381,23 +392,28 @@ sub data_set ...@@ -381,23 +392,28 @@ sub data_set
# Build template # Build template
my $template; my $template;
# Last updated time would be now
$template->{'query'}->{'LastUpdated'} = $user->{'_Internal'}->{'Timestamp'}; # Add user details
$template->{'query'}->{'Name'} = sprintf('%s/%s',$module,$name); $template->{'user'}->{'ID'} = $user->{'ID'};
$template->{'query'}->{'Value'} = $value; $template->{'user'}->{'Username'} = $user->{'Username'};
# Add in userdb data # Add in userdb data
foreach my $item (keys %{$user->{'_UserDB_Data'}}) { foreach my $item (keys %{$user->{'_UserDB_Data'}}) {
$template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item}; $template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item};
} }
# Last updated time would be now
$template->{'query'}->{'LastUpdated'} = $user->{'_Internal'}->{'Timestamp'};
$template->{'query'}->{'Name'} = sprintf('%s/%s',$module,$name);
$template->{'query'}->{'Value'} = $value;
# Replace template entries # Replace template entries
my @dbDoParams = templateReplace($config->{'users_data_update_query'},$template); my @dbDoParams = templateReplace($config->{'users_data_update_query'},$template);
# Query database # Query database
my $sth = DBDo(@dbDoParams); my $sth = DBDo(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"Failed to update users data: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"Failed to update users data: ".AWITPT::DB::DBLayer::error());
return RES_ERROR; return RES_ERROR;
} }
...@@ -408,7 +424,7 @@ sub data_set ...@@ -408,7 +424,7 @@ sub data_set
# Insert # Insert
$sth = DBDo(@dbDoParams); $sth = DBDo(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"Failed to set users data: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"Failed to set users data: ".AWITPT::DB::DBLayer::error());
return RES_ERROR; return RES_ERROR;
} }
} }
...@@ -422,7 +438,7 @@ sub data_set ...@@ -422,7 +438,7 @@ sub data_set
$data{'Module'} = $module; $data{'Module'} = $module;
$data{'Name'} = $name; $data{'Name'} = $name;
$data{'Value'} = $value; $data{'Value'} = $value;
# Cache the result # Cache the result
cacheStoreComplexKeyPair('mod_userdb_sql(users_data)', cacheStoreComplexKeyPair('mod_userdb_sql(users_data)',
sprintf('%s/%s/%s',$module,$user->{'_UserDB_Data'}->{'ID'},$name), sprintf('%s/%s/%s',$module,$user->{'_UserDB_Data'}->{'ID'},$name),
...@@ -453,13 +469,18 @@ sub data_get ...@@ -453,13 +469,18 @@ sub data_get
# Build template # Build template
my $template; my $template;
$template->{'query'}->{'Name'} = sprintf('%s/%s',$module,$name);
# Add user details
$template->{'user'}->{'ID'} = $user->{'ID'};
$template->{'user'}->{'Username'} = $user->{'Username'};
# Add in userdb data # Add in userdb data
foreach my $item (keys %{$user->{'_UserDB_Data'}}) { foreach my $item (keys %{$user->{'_UserDB_Data'}}) {
$template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item}; $template->{'userdb'}->{$item} = $user->{'_UserDB_Data'}->{$item};
} }
$template->{'query'}->{'Name'} = sprintf('%s/%s',$module,$name);
# If we using caching, check how old the result is # If we using caching, check how old the result is
if (defined($config->{'userdb_data_cache_time'})) { if (defined($config->{'userdb_data_cache_time'})) {
my ($res,$val) = cacheGetComplexKeyPair('mod_userdb_sql(data_get)', my ($res,$val) = cacheGetComplexKeyPair('mod_userdb_sql(data_get)',
...@@ -477,7 +498,7 @@ sub data_get ...@@ -477,7 +498,7 @@ sub data_get
# Query database # Query database
my $sth = DBSelect(@dbDoParams); my $sth = DBSelect(@dbDoParams);
if (!$sth) { if (!$sth) {
$server->log(LOG_ERR,"Failed to get users data: ".AWITPT::DB::DBLayer::Error()); $server->log(LOG_ERR,"Failed to get users data: ".AWITPT::DB::DBLayer::error());
return RES_ERROR; return RES_ERROR;
} }
...@@ -497,7 +518,7 @@ sub data_get ...@@ -497,7 +518,7 @@ sub data_get
# If we using caching and got here, it means that we must cache the result # If we using caching and got here, it means that we must cache the result
if (defined($config->{'userdb_data_cache_time'})) { if (defined($config->{'userdb_data_cache_time'})) {
$data{'CachedUntil'} = $user->{'_Internal'}->{'Timestamp-Unix'} + $config->{'userdb_data_cache_time'}; $data{'CachedUntil'} = $user->{'_Internal'}->{'Timestamp-Unix'} + $config->{'userdb_data_cache_time'};
# Cache the result # Cache the result
cacheStoreComplexKeyPair('mod_userdb_sql(users_data)', cacheStoreComplexKeyPair('mod_userdb_sql(users_data)',
sprintf('%s/%s/%s',$module,$user->{'_UserDB_Data'}->{'ID'},$name), sprintf('%s/%s/%s',$module,$user->{'_UserDB_Data'}->{'ID'},$name),
......
# SMRadius Utility Functions
# Copyright (C) 2007-2016, 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.
=encoding utf8
=head1 NAME
smradius::util - SMRadius utils
=head1 SYNOPSIS
my ($str,@vals) = templateReplace("SELECT * FROM abc WHERE %{abc} = ?",{ 'abc' => "some value" });
my $str = quickTemplateToolkit('someval is "[% someval %]"',{ 'someval' = "hello world" });
=head1 DESCRIPTION
The smradius::util class provides utility classes for SMRadius.
=cut
package smradius::util;
use parent qw(Exporter);
use strict;
use warnings;
our (@EXPORT_OK,@EXPORT);
@EXPORT_OK = qw(
);
@EXPORT = qw(
templateReplace
quickTemplateToolkit
);
use Template;
=head1 METHODS
The following utility methods are available.
=cut
=head2 templateReplace
my ($str,@vals) = templateReplace("SELECT * FROM abc WHERE %{abc} = ?",{ 'abc' => "some value" });
The C<templatereplace> method is used to replace variables with a placeholder. This is very useful for SQL templates. The values
are returned in the second and subsequent array items.
=over
=back
=cut
# Replace hashed variables with placeholders and return an array with the values.
sub templateReplace
{
my ($string,$hashref,$placeholder) = @_;
my @valueArray = ();
$placeholder //= '?';
# Replace blanks
while (my ($entireMacro,$section,$item,$default) = ($string =~ /(\%\{([a-z]+)\.([a-z0-9\-]+)(?:=([^\}]*))?\})/i )) {
# Replace macro with ? or the placeholder if specified
# We also quote the entireMacro
$string =~ s/\Q$entireMacro\E/$placeholder/;
# Get value to substitute
my $value = (defined($hashref->{$section}) && defined($hashref->{$section}->{$item})) ?
$hashref->{$section}->{$item} : $default;
# Add value onto our array
push(@valueArray,$value);
}
return ($string, @valueArray);
}
=head2 quickTemplateToolkit
my $str = quickTemplateToolkit('someval is "[% someval %]"',{ 'someval' = "hello world" });
The C<quickTemplateToolkit> is a quick and easy template toolkit function.
=over
=back
=cut
# Replace hashed variables with placeholders and return an array with the values.
sub quickTemplateToolkit
{
my ($string,$variables) = @_;
# This is the config we're going to pass to Template
my $config = {
# Our include path built below
INCLUDE_PATH => [ ],
};
# Create template engine
my $tt = Template->new($config);
# Process the template and output to our OUTPUT_PATH
my $output = "";
if (!(my $res = $tt->process(\$string, $variables, \$output))) {
return (undef,$tt->error());
}
return $output;
}
1;
__END__
=head1 AUTHORS
Nigel Kukard E<lt>nkukard@lbsd.netE<gt>
=head1 BUGS
All bugs should be reported via the project issue tracker
L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues/>.
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2007-2016, 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 3 of the License, or
(at your option) any later version.
=head1 SEE ALSO
L<Template>.
=cut
# SMRadius version package # SMRadius version package
# Copyright (C) 2007-2015, AllWorldIT # Copyright (C) 2007-2016, AllWorldIT
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License along # 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
...@@ -27,13 +27,19 @@ require Exporter; ...@@ -27,13 +27,19 @@ require Exporter;
our (@ISA,@EXPORT,@EXPORT_OK); our (@ISA,@EXPORT,@EXPORT_OK);
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT = qw( @EXPORT = qw(
$VERSION
VERSION VERSION
); );
@EXPORT_OK = qw(
);
our $VERSION = "1.0.1";
use constant { sub VERSION { return $VERSION };
VERSION => "0.1.x",
};
......
This diff is collapsed.
This diff is collapsed.
# Test harness for module loading
# Copyright (C) 2014-2016, 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.
use Test::More;
use strict;
use warnings;
require_ok("smradius::daemon");
require_ok("smradius::client");
done_testing();
This diff is collapsed.
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
git submodule update --recursive --init git submodule update --recursive --init
pushd awitpt pushd 3rdparty/awitpt
git checkout v0.0.x git checkout v1.0.x
git pull git pull
popd popd
......