X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=login.pl;h=c1d4df4065afe8906dac25191ca02ecd29c63743;hb=4c996a3d4df205f272f6c6cb86c1cdfec1ade49d;hp=6156dc1e3f24ad7d0a94cab849789e3f2fa0c221;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/login.pl b/login.pl index 6156dc1e3..c1d4df406 100755 --- a/login.pl +++ b/login.pl @@ -30,15 +30,13 @@ # ####################################################################### - # 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; @@ -58,7 +56,6 @@ if ($ARGV[0]) { $_ = $ARGV[0]; } - %form = split /[&=]/; # fix for apache 2.0 bug @@ -69,7 +66,6 @@ $0 =~ tr/\\/\//; $pos = rindex $0, '/'; $script = substr($0, $pos + 1); - if (-e "$userspath/nologin" && $script ne 'admin.pl') { print "content-type: text/plain @@ -78,7 +74,6 @@ Login disabled!\n"; exit; } - if ($form{path}) { $form{path} =~ s/%2f/\//gi; $form{path} =~ s/\.\.\///g; @@ -90,39 +85,38 @@ 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"; + $form{terminal} = "mozilla"; } if ($ENV{HTTP_USER_AGENT} =~ /lynx/i) { - $form{terminal} = "lynx"; + $form{terminal} = "lynx"; } } else { if ($ENV{TERM} =~ /xterm/) { - $form{terminal} = "xterm"; + $form{terminal} = "xterm"; } if ($ENV{TERM} =~ /(console|linux|vt.*)/i) { - $form{terminal} = "console"; + $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|