X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=am.pl;h=e48b9790d9f00672dda13f8572d0d56399213a9c;hb=e2e06cbb81c60cd462133b97024886766e4c167d;hp=df71c21e5d86ffc61d717a3412968a60a6a8d0cd;hpb=3ce6fe64b187b1bb29386cfd62ed39478b97c2d8;p=kivitendo-erp.git diff --git a/am.pl b/am.pl index df71c21e5..e48b9790d 100755 --- a/am.pl +++ b/am.pl @@ -30,6 +30,10 @@ # ####################################################################### +BEGIN { + push(@INC, "modules"); +} + # setup defaults, DO NOT CHANGE $userspath = "users"; $templates = "templates"; @@ -42,9 +46,14 @@ $| = 1; use SL::LXDebug; $lxdebug = LXDebug->new(); +use CGI; use SL::Form; +use SL::Locale; eval { require "lx-erp.conf"; }; +eval { require "lx-erp-local.conf"; } if -f "lx-erp-local.conf"; + +require "bin/mozilla/common.pl"; if (defined($latex) && !defined($latex_templates)) { $latex_templates = $latex; @@ -52,6 +61,7 @@ if (defined($latex) && !defined($latex_templates)) { } $form = new Form; +$cgi = new CGI(''); # name of this script $0 =~ tr/\\/\//; @@ -89,28 +99,23 @@ $locale = new Locale "$myconfig{countrycode}", "$script"; $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"); -} - # did sysadmin lock us out if (-e "$userspath/nologin") { $form->error($locale->text('System currently down for maintenance!')); } # pull in the main code -require "$form->{path}/$form->{script}"; +require "bin/mozilla/$form->{script}"; # customized scripts -if (-f "$form->{path}/custom_$form->{script}") { - eval { require "$form->{path}/custom_$form->{script}"; }; +if (-f "bin/mozilla/custom_$form->{script}") { + eval { require "bin/mozilla/custom_$form->{script}"; }; $form->error($@) if ($@); } # customized scripts for login -if (-f "$form->{path}/$form->{login}_$form->{script}") { - eval { require "$form->{path}/$form->{login}_$form->{script}"; }; +if (-f "bin/mozilla/$form->{login}_$form->{script}") { + eval { require "bin/mozilla/$form->{login}_$form->{script}"; }; $form->error($@) if ($@); } @@ -122,7 +127,7 @@ if ($form->{action}) { . $locale->text('Version') . " $form->{version} - $myconfig{name} - $myconfig{dbname}"; - &{ $locale->findsub($form->{action}) }; + call_sub($locale->findsub($form->{action})); } else { $form->error($locale->text('action= not defined!')); }