| 
0
 | 
     1 use strict;
 | 
| 
 | 
     2 package Security;
 | 
| 
 | 
     3 
 | 
| 
 | 
     4 use constant {
 | 
| 
 | 
     5     AUTH_FAILED =>      0,
 | 
| 
 | 
     6     AUTH_SUCCESS =>     1,
 | 
| 
 | 
     7     AUTH_INCOMPLETE =>  2,
 | 
| 
 | 
     8     AUTH_NOAUTH =>      3
 | 
| 
 | 
     9 };
 | 
| 
 | 
    10 
 | 
| 
 | 
    11 my $CurrentSession;
 | 
| 
 | 
    12 
 | 
| 
 | 
    13 sub CurrentSession {
 | 
| 
 | 
    14     my ($class,$newSession) = @_;
 | 
| 
 | 
    15     
 | 
| 
 | 
    16     $CurrentSession = $newSession if @_>=2;
 | 
| 
 | 
    17     return $CurrentSession;
 | 
| 
 | 
    18 }
 | 
| 
 | 
    19 
 | 
| 
 | 
    20 package Security::AuthResult;
 | 
| 
 | 
    21 use Common;
 | 
| 
 | 
    22 our @ISA = qw(Object);
 | 
| 
 | 
    23 
 | 
| 
 | 
    24 BEGIN {
 | 
| 
 | 
    25     DeclareProperty State => ACCESS_READ;
 | 
| 
 | 
    26     DeclareProperty Session => ACCESS_READ;
 | 
| 
 | 
    27     DeclareProperty ClientSecData => ACCESS_READ;
 | 
| 
 | 
    28     DeclareProperty AuthMod => ACCESS_READ;
 | 
| 
 | 
    29 }
 | 
| 
 | 
    30 
 | 
| 
 | 
    31 sub isSuccess {
 | 
| 
 | 
    32     my ($this) = @_;
 | 
| 
 | 
    33     return $this->{$State} == Security::AUTH_SUCCESS;
 | 
| 
 | 
    34 }
 | 
| 
 | 
    35 
 | 
| 
 | 
    36 
 | 
| 
 | 
    37 1;
 | 
| 
 | 
    38 
 |