1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
##@file
# Slave common functions
##@class
# Slave common functions
package Lemonldap::NG::Portal::_Slave;
use Exporter;
use base qw(Exporter);
use strict;
our @EXPORT = qw(checkIP);
our $VERSION = '1.2.0';
## @method Lemonldap::NG::Portal::_Slave checkIP()
# @return true if remote IP is accredited in LL::NG conf
sub checkIP {
my $self = shift;
my $remoteIP = $self->remote_addr;
return 1
if (!$self->{slaveMasterIP}
|| $self->{slaveMasterIP} =~ /\b$remoteIP\b/ );
$self->_sub( 'userError', "Client IP not accredited for Slave module" );
return 0;
}
1;
|