]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Auth/Constants.pm
Auth Konstanten ausgelagert in ein eigenes Package.
[mfinanz.git] / SL / Auth / Constants.pm
diff --git a/SL/Auth/Constants.pm b/SL/Auth/Constants.pm
new file mode 100644 (file)
index 0000000..4fe520a
--- /dev/null
@@ -0,0 +1,63 @@
+package SL::Auth::Constants;
+
+use strict;
+
+use Exporter qw(import);
+
+our %EXPORT_TAGS   = (
+  OK => [ qw(
+    OK
+  ) ],
+  ERR => [ qw(
+    ERR_PASSWORD
+    ERR_BACKEND
+  ) ],
+  SESSION => [ qw(
+    SESSION_OK
+    SESSION_NONE
+    SESSION_EXPIRED
+  ) ],
+);
+
+# add all the other ":class" tags to the ":all" class,
+# deleting duplicates
+{
+ my %seen;
+ push @{$EXPORT_TAGS{all}}, grep {!$seen{$_}++} @$_ for values %EXPORT_TAGS;
+}
+
+Exporter::export_ok_tags('all');
+
+use constant OK              =>   0;
+use constant ERR_PASSWORD    =>   1;
+use constant ERR_BACKEND     => 100;
+
+use constant SESSION_OK      =>   0;
+use constant SESSION_NONE    =>   1;
+use constant SESSION_EXPIRED =>   2;
+
+1;
+
+__END__
+
+=head1 NAME
+
+SL::Auth::Constants - COnstants for Auth module
+
+=head1 SYNOPSIS
+
+  use SL::Auth::Constants qw(:all);
+
+  OK == $auth->authenticate($user, $pass) or die;
+
+=head1 DESCRIPTION
+
+This module provides status constants for authentication handling
+
+=head1 FUNCTIONS
+
+=head1 BUGS
+
+=head1 AUTHOR
+
+=cut