Commit 5392fb50 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Make perl critic happy

parent cd86ab1d
......@@ -24,9 +24,8 @@ use strict;
use warnings;
# Exporter stuff
require Exporter;
our (@ISA,@EXPORT);
@ISA = qw(Exporter);
use base qw(Exporter);
our (@EXPORT);
@EXPORT = qw(
addAttribute
checkAuthAttribute
......@@ -135,7 +134,7 @@ sub addAttribute
}
# Process the item incase its a config attribute
processConfigAttribute($server,$user,$attribute);
return processConfigAttribute($server,$user,$attribute);
}
......@@ -758,6 +757,8 @@ sub addAttributeConditionalVariable
print(STDERR "CONDITIONAL VARIABLE: $name => $value\n");
$user->{'AttributeConditionalVariables'}->{$name} = [ $value ];
return;
}
......@@ -787,7 +788,7 @@ sub processConditional
# Create the environment
my @error;
my $mathEnv = new Math::Expression(
my $mathEnv = Math::Expression->new(
'PrintErrFunc' => sub { @error = @_ },
'VarHash' => $user->{'AttributeConditionalVariables'}
);
......
......@@ -24,9 +24,8 @@ use strict;
use warnings;
# Exporter stuff
require Exporter;
our (@ISA,@EXPORT);
@ISA = qw(Exporter);
use base qw(Exporter);
our (@EXPORT);
@EXPORT = qw(
);
......@@ -68,7 +67,7 @@ sub Init
} else {
$server->{'smradius'}{'event_timezone'} = "GMT";
}
# Should we use the packet timestamp?
if (defined($config->{'radius'}{'use_packet_timestamp'})) {
if ($config->{'radius'}{'use_packet_timestamp'} =~ /^\s*(yes|true|1)\s*$/i) {
......@@ -81,7 +80,7 @@ sub Init
} else {
$server->{'smradius'}{'use_packet_timestamp'} = 0;
}
# Should we use abuse prevention?
if (defined($config->{'radius'}{'use_abuse_prevention'})) {
if ($config->{'radius'}{'use_abuse_prevention'} =~ /^\s*(yes|true|1)\s*$/i) {
......@@ -112,13 +111,15 @@ sub Init
} else {
$server->{'smradius'}{'accounting_request_abuse_threshold'} = 5;
}
$server->log(LOG_NOTICE,"smradius/config.pm: Using ". ( $server->{'smradius'}{'use_packet_timestamp'} ? 'packet' : 'server' ) ." timestamp");
$server->log(LOG_NOTICE,"smradius/config.pm: Using timezone '".$server->{'smradius'}{'event_timezone'}."'");
$server->log(LOG_NOTICE,"smradius/config.pm: Abuse prevention ".( $server->{'smradius'}{'use_abuse_prevention'} ?
'active (access-threshold = '.$server->{'smradius'}{'access_request_abuse_threshold'}.
', accounting-threshold = '.$server->{'smradius'}{'accounting_request_abuse_threshold'}.')'
: 'inactive'));
return;
}
......
......@@ -22,15 +22,17 @@
package smradius::constants;
use strict;
use warnings;
# Exporter stuff
require Exporter;
our (@ISA,@EXPORT,@EXPORT_OK);
@ISA = qw(Exporter);
use base qw(Exporter);
our (@EXPORT,@EXPORT_OK);
@EXPORT = qw(
RES_OK
RES_ERROR
MOD_RES_ACK
MOD_RES_NACK
MOD_RES_SKIP
......@@ -47,7 +49,7 @@ use constant {
MOD_RES_SKIP => 0,
MOD_RES_ACK => 1,
MOD_RES_NACK => 2,
UINT_MAX => 2**32
};
......
......@@ -15,7 +15,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
package smradius::smradius::modules::mod_config_test;
package smradius::smradius::modules::system::mod_config_test;
use strict;
use warnings;
......
......@@ -94,7 +94,7 @@ sub isBoolean
# Check if we're defined
if (!defined($var)) {
return undef;
return;
}
# Nuke whitespaces
......@@ -109,7 +109,7 @@ sub isBoolean
}
# Invalid or unknown
return undef;
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment