Auth Konstanten ausgelagert in ein eigenes Package.
[kivitendo-erp.git] / SL / Auth / Constants.pm
1 package SL::Auth::Constants;
2
3 use strict;
4
5 use Exporter qw(import);
6
7 our %EXPORT_TAGS   = (
8   OK => [ qw(
9     OK
10   ) ],
11   ERR => [ qw(
12     ERR_PASSWORD
13     ERR_BACKEND
14   ) ],
15   SESSION => [ qw(
16     SESSION_OK
17     SESSION_NONE
18     SESSION_EXPIRED
19   ) ],
20 );
21
22 # add all the other ":class" tags to the ":all" class,
23 # deleting duplicates
24 {
25  my %seen;
26  push @{$EXPORT_TAGS{all}}, grep {!$seen{$_}++} @$_ for values %EXPORT_TAGS;
27 }
28
29 Exporter::export_ok_tags('all');
30
31 use constant OK              =>   0;
32 use constant ERR_PASSWORD    =>   1;
33 use constant ERR_BACKEND     => 100;
34
35 use constant SESSION_OK      =>   0;
36 use constant SESSION_NONE    =>   1;
37 use constant SESSION_EXPIRED =>   2;
38
39 1;
40
41 __END__
42
43 =head1 NAME
44
45 SL::Auth::Constants - COnstants for Auth module
46
47 =head1 SYNOPSIS
48
49   use SL::Auth::Constants qw(:all);
50
51   OK == $auth->authenticate($user, $pass) or die;
52
53 =head1 DESCRIPTION
54
55 This module provides status constants for authentication handling
56
57 =head1 FUNCTIONS
58
59 =head1 BUGS
60
61 =head1 AUTHOR
62
63 =cut