-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.pm
80 lines (61 loc) · 1.34 KB
/
Constants.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# Constants definitions
#
# Copyright (C) 2008 - 2009 Nano-opt
# Licence: GPL
package Constants;
use strict;
use File::Basename;
use Cwd;
use LMConfig;
use base qw(Exporter);
@Constants::EXPORT = qw(
LIB_VERSION
LIB_NAME
TRUE
FALSE
LOCATIONS
ERROR_SUCCESS
ERROR_AUTH_PASS
ERROR_LDAP
ERROR_PASS_HISTORY
);
# General
use constant LIB_VERSION => '0.1';
use constant LIB_NAME => 'LDAP Web-based User Manager';
use constant TRUE => 1;
use constant FALSE => 0;
# LDAP
# ERROR
use constant ERROR_SUCCESS => 0;
use constant ERROR_AUTH_PASS => 1;
use constant ERROR_LDAP => 2;
use constant ERROR_PASS_HISTORY => 3;
sub LOCATIONS {
# absolute path for installation ("installation")
my $path_base = dirname($INC{'Constants.pm'});
# de-taint
$path_base =~ /(.*)/;
$path_base = $1;
if ($path_base eq '.') {
$path_base = getcwd();
}
my $path_data = $path_base . '/data';
return {
'base' => $path_base,
'cgi' => $path_base,
'data' => $path_data,
'templates' => $path_base . '/template',
'compile_t' => $path_data . '/t',
};
}
1;
__END__
=head1 NAME
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 METHODS
=over
=item C<>
=back