X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=login.pl;h=f216dd9c40393dacc3a02c684b836d9a726a70dc;hb=078fa02aa17feb2560a76b54a9c98c8c98957de5;hp=6156dc1e3f24ad7d0a94cab849789e3f2fa0c221;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/login.pl b/login.pl index 6156dc1e3..f216dd9c4 100755 --- a/login.pl +++ b/login.pl @@ -30,21 +30,25 @@ # ####################################################################### +BEGIN { + unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). + push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. +} # setup defaults, DO NOT CHANGE -$userspath = "users"; -$templates = "templates"; +$userspath = "users"; +$templates = "templates"; $memberfile = "users/members"; -$sendmail = "| /usr/sbin/sendmail -t"; +$sendmail = "| /usr/sbin/sendmail -t"; ########## end ########################################### - $| = 1; use SL::LXDebug; $lxdebug = LXDebug->new(); -eval { require "lx-erp.conf"; }; +eval { require "config/lx-erp.conf"; }; +eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf"; if ($ENV{CONTENT_LENGTH}) { read(STDIN, $_, $ENV{CONTENT_LENGTH}); @@ -58,7 +62,6 @@ if ($ARGV[0]) { $_ = $ARGV[0]; } - %form = split /[&=]/; # fix for apache 2.0 bug @@ -69,6 +72,7 @@ $0 =~ tr/\\/\//; $pos = rindex $0, '/'; $script = substr($0, $pos + 1); +$form->{login} =~ s|.*/||; if (-e "$userspath/nologin" && $script ne 'admin.pl') { print "content-type: text/plain @@ -78,59 +82,11 @@ Login disabled!\n"; exit; } +require "bin/mozilla/installationcheck.pl"; +verify_installation(); -if ($form{path}) { - $form{path} =~ s/%2f/\//gi; - $form{path} =~ s/\.\.\///g; - - if ($form{path} !~ /^bin\//) { - print "content-type: text/plain - -Invalid path!\n"; - die; - } - - - $ARGV[0] = "$_&script=$script"; - require "$form{path}/$script"; -} else { - - if (!$form{terminal}) { - if ($ENV{HTTP_USER_AGENT}) { - # web browser - if ($ENV{HTTP_USER_AGENT} =~ /(mozilla|links|opera|w3m)/i) { - $form{terminal} = "mozilla"; - } - - if ($ENV{HTTP_USER_AGENT} =~ /lynx/i) { - $form{terminal} = "lynx"; - } - } else { - if ($ENV{TERM} =~ /xterm/) { - $form{terminal} = "xterm"; - } - if ($ENV{TERM} =~ /(console|linux|vt.*)/i) { - $form{terminal} = "console"; - } - } - } - - - if ($form{terminal}) { - - $ARGV[0] = "path=bin/$form{terminal}&script=$script"; - map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form; - - require "bin/$form{terminal}/$script"; - - } else { - - print qq| - Unknown terminal - |; - } - -} +$ARGV[0] = "$_&script=$script"; +require "bin/mozilla/$script"; # end of main