package Authorization @ISA = qw() sub BEGIN sub new my ($module, $CryptMethod, $CryptPhrase, $pPrivilegedAccount, $pPrivilegedIPAddress) = @_; return $this; sub DESTROY my $this = shift; # $this->SUPER::DESTROY( sub SetCryptMethod sub SetCryptMethod { my($this,$m)= return $this->{CryptMethod}=$m; sub CryptMethod return shift->{CryptMethod}; sub SetCryptPhrase sub SetCryptPhrase { my($this,$p)= return $this->{CryptPhrase}=$p; sub CryptPhrase return shift->{CryptPhrase}; sub SetPrivilegedAccount sub SetPrivilegedAccount { my($this,$pA)= return $this->{PrivilegedAccount}=$pA; sub PrivilegedAccount my ($App) = @_; return @$pA; sub SetPrivilegedIPAddress sub SetPrivilegedIPAddress { my($this,$pIP)= return $this->{PrivilegedIPAddress}=$pIP; sub PrivilegedIPAddress my ($App) = @_; return @$pP; sub SetAllowNullIPAddress sub SetAllowNullIPAddress { my($this,$a)= return $this->{AllowNullIPAddress} = $a; sub AllowNullIPAddress return shift->{AllowNullIPAddress}; sub BuildRegistrationCode my ($this, @strs) = @_; return $s; sub Crypt my ($this, $s) = @_; return $s; sub IsPrivilegedIPAddress my ($this, $ip) = (@_); return $Level if($ip =~ /^$IPAddress$/); return 0; sub GetPrivilege my ($this, $DB, $TableName, $AccountKey, $Account) = @_; return $Hit{Privilege}; sub CheckPrivilege my ($this, $DB, $TableName, $AccountKey, $Account, $priv, $Password) = @_; return 0 unless($Password eq $Hit{Password} or $Password eq $this->Crypt($Hit{Password})); return $Hit{Privilege} if($Hit{Privilege} =~ /$priv/i); return 0; sub IsValidUser my ($this, $App, $Account, $Password, $ShowMessage, $DB, $TableName, $AccountKey) = (@_); return $level if($AllowNullIPAddress and $ip eq ''); return $level if($ip =~ /^$IPAddress$/ and $Level <= $level); return -1; return 0 if(!$DB); return 0; return 0; return 0; return 5; return 0;