X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=am.pl;h=d5124e8d06c8d877d799eb25056484294fc8a7ca;hb=9c2d49bb4dae241b4290afaeeb762d9c0e584301;hp=ef43d9d4f82d9e8e372de204f225da505c0f6429;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/am.pl b/am.pl index ef43d9d4f..d5124e8d0 100755 --- a/am.pl +++ b/am.pl @@ -30,25 +30,35 @@ # ####################################################################### +BEGIN { + push(@INC, "modules"); +} + # 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(); +use CGI; use SL::Form; +use SL::Locale; eval { require "lx-erp.conf"; }; +if (defined($latex) && !defined($latex_templates)) { + $latex_templates = $latex; + undef($latex); +} $form = new Form; +$cgi = new CGI(''); # name of this script $0 =~ tr/\\/\//; @@ -57,6 +67,7 @@ $script = substr($0, $pos + 1); # we use $script for the language module $form->{script} = $script; + # strip .pl for translation files $script =~ s/\.pl//; @@ -67,27 +78,27 @@ use DBI; eval { require("$userspath/$form->{login}.conf"); }; if ($@) { $locale = new Locale "$language", "$script"; - + $form->{callback} = ""; - $msg1 = $locale->text('You are logged out!'); - $msg2 = $locale->text('Login'); + $msg1 = $locale->text('You are logged out!'); + $msg2 = $locale->text('Login'); $form->redirect("$msg1
$msg2"); } - $myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd}; -map { $form->{$_} = $myconfig{$_} } qw(stylesheet charset) unless (($form->{action} eq 'save') && ($form->{type} eq 'preferences')); +map { $form->{$_} = $myconfig{$_} } qw(stylesheet charset) + unless (($form->{action} eq 'save') && ($form->{type} eq 'preferences')); # locale messages $locale = new Locale "$myconfig{countrycode}", "$script"; # check password -$form->error($locale->text('Incorrect Password!')) if ($form->{password} ne $myconfig{password}); - +$form->error($locale->text('Incorrect Password!')) + if ($form->{password} ne $myconfig{password}); $form->{path} =~ s/\.\.\///g; if ($form->{path} !~ /^bin\//) { - $form->error($locale->text('Invalid path!')."\n"); + $form->error($locale->text('Invalid path!') . "\n"); } # did sysadmin lock us out @@ -95,7 +106,6 @@ if (-e "$userspath/nologin") { $form->error($locale->text('System currently down for maintenance!')); } - # pull in the main code require "$form->{path}/$form->{script}"; @@ -112,14 +122,17 @@ if (-f "$form->{path}/$form->{login}_$form->{script}") { } if ($form->{action}) { + # window title bar, user info - $form->{titlebar} = "Lx-Office ".$locale->text('Version'). " $form->{version} - $myconfig{name} - $myconfig{dbname}"; + $form->{titlebar} = + "Lx-Office " + . $locale->text('Version') + . " $form->{version} - $myconfig{name} - $myconfig{dbname}"; &{ $locale->findsub($form->{action}) }; } else { $form->error($locale->text('action= not defined!')); } - # end