diff Lib/Security.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 1c3c3e63a314
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/Security.pm	Tue Jul 14 12:54:37 2009 +0400
@@ -0,0 +1,38 @@
+use strict;
+package Security;
+
+use constant {
+    AUTH_FAILED =>      0,
+    AUTH_SUCCESS =>     1,
+    AUTH_INCOMPLETE =>  2,
+    AUTH_NOAUTH =>      3
+};
+
+my $CurrentSession;
+
+sub CurrentSession {
+    my ($class,$newSession) = @_;
+    
+    $CurrentSession = $newSession if @_>=2;
+    return $CurrentSession;
+}
+
+package Security::AuthResult;
+use Common;
+our @ISA = qw(Object);
+
+BEGIN {
+    DeclareProperty State => ACCESS_READ;
+    DeclareProperty Session => ACCESS_READ;
+    DeclareProperty ClientSecData => ACCESS_READ;
+    DeclareProperty AuthMod => ACCESS_READ;
+}
+
+sub isSuccess {
+    my ($this) = @_;
+    return $this->{$State} == Security::AUTH_SUCCESS;
+}
+
+
+1;
+