comparison Lib/Security.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 1c3c3e63a314
comparison
equal deleted inserted replaced
-1:000000000000 0:03e58a454b20
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