Skip to content

Commit

Permalink
Test if there is something in the access_list
Browse files Browse the repository at this point in the history
  • Loading branch information
fdurand committed Jan 13, 2016
1 parent e9b6fe8 commit ee3c1e2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/pf/Switch/Cisco/Catalyst_2960.pm
Expand Up @@ -504,11 +504,15 @@ sub returnRadiusAccessAccept {
if ( isenabled($self->{_AccessListMap}) && $self->supportsAccessListBasedEnforcement ){
if( defined($args->{'user_role'}) && $args->{'user_role'} ne ""){
my $access_list = $self->getAccessListByName($args->{'user_role'});
while($access_list =~ /([^\n]+)\n?/g){
push(@av_pairs, $self->returnAccessListAttribute."=".$1);
$logger->info("(".$self->{'_id'}.") Adding access list : $1 to the RADIUS reply");
if ($access_list) {
while($access_list =~ /([^\n]+)\n?/g){
push(@av_pairs, $self->returnAccessListAttribute."=".$1);
$logger->info("(".$self->{'_id'}.") Adding access list : $1 to the RADIUS reply");
}
$logger->info("(".$self->{'_id'}.") Added access lists to the RADIUS reply.");
} else {
$logger->info("(".$self->{'_id'}.") No access lists defined for this role ".$args->{'user_role'});
}
$logger->info("(".$self->{'_id'}.") Added access lists to the RADIUS reply.");
}
}

Expand Down

0 comments on commit ee3c1e2

Please sign in to comment.