Umstellung der Benutzerverwaltung von Dateien im Verzeichnis "users" auf die Verwendu...
[kivitendo-erp.git] / login.pl
1 #!/usr/bin/perl
2 #
3 ######################################################################
4 # SQL-Ledger Accounting
5 # Copyright (C) 2001
6 #
7 #  Author: Dieter Simader
8 #   Email: dsimader@sql-ledger.org
9 #     Web: http://www.sql-ledger.org
10 #
11 #  Contributors:
12 #
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
17 #
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #######################################################################
26 #
27 # this script sets up the terminal and runs the scripts
28 # in bin/$terminal directory
29 # admin.pl is linked to this script
30 #
31 #######################################################################
32
33 BEGIN {
34   unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
35   push    @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
36 }
37
38 # setup defaults, DO NOT CHANGE
39 $userspath  = "users";
40 $templates  = "templates";
41 $memberfile = "users/members";
42 $sendmail   = "| /usr/sbin/sendmail -t";
43 ########## end ###########################################
44
45 $| = 1;
46
47 use SL::LXDebug;
48 $lxdebug = LXDebug->new();
49
50 eval { require "config/lx-erp.conf"; };
51 eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
52
53 if ($ENV{CONTENT_LENGTH}) {
54   read(STDIN, $_, $ENV{CONTENT_LENGTH});
55 }
56
57 if ($ENV{QUERY_STRING}) {
58   $_ = $ENV{QUERY_STRING};
59 }
60
61 if ($ARGV[0]) {
62   $_ = $ARGV[0];
63 }
64
65 %form = split /[&=]/;
66
67 # fix for apache 2.0 bug
68 map { $form{$_} =~ s/\\$// } keys %form;
69
70 # name of this script
71 $0 =~ tr/\\/\//;
72 $pos = rindex $0, '/';
73 $script = substr($0, $pos + 1);
74
75 $form->{login} =~ s|.*/||;
76
77 if (-e "$userspath/nologin" && $script ne 'admin.pl') {
78   print "content-type: text/plain
79
80 Login disabled!\n";
81
82   exit;
83 }
84
85 require "bin/mozilla/installationcheck.pl";
86 verify_installation();
87
88 $ARGV[0] = "$_&script=$script";
89 require "bin/mozilla/$script";
90
91 # end of main
92