X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=login.pl;h=a01fc10f8d99e87f35ef3fd1ae23ca3990bb5cb6;hb=b9f6d2f5eb8fed1feae2554af76a4f1bebce3e87;hp=c1d4df4065afe8906dac25191ca02ecd29c63743;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git diff --git a/login.pl b/login.pl index c1d4df406..a01fc10f8 100755 --- a/login.pl +++ b/login.pl @@ -30,6 +30,11 @@ # ####################################################################### +BEGIN { + unshift @INC, "modules/YAML"; # Use our own version of YAML. + push @INC, "modules"; # Only use our own versions of modules if there's no system version. +} + # setup defaults, DO NOT CHANGE $userspath = "users"; $templates = "templates"; @@ -43,6 +48,7 @@ use SL::LXDebug; $lxdebug = LXDebug->new(); eval { require "lx-erp.conf"; }; +eval { require "lx-erp-local.conf"; } if -f "lx-erp-local.conf"; if ($ENV{CONTENT_LENGTH}) { read(STDIN, $_, $ENV{CONTENT_LENGTH}); @@ -66,6 +72,8 @@ $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 @@ -74,57 +82,11 @@ Login disabled!\n"; exit; } -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"; - } +require "bin/mozilla/installationcheck.pl"; +verify_installation(); - 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