X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=am.pl;h=b54599e4965af4b3cb88c9ca42cda612ae851046;hb=937a49378b241374fb29a7d52426507171dfbc2e;hp=a9b05323293811aeefcd1b416f9d7a9f6b875622;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git diff --git a/am.pl b/am.pl index a9b053232..b54599e49 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,11 +46,22 @@ $| = 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; + undef($latex); +} $form = new Form; +$cgi = new CGI(''); # name of this script $0 =~ tr/\\/\//; @@ -62,6 +77,8 @@ $script =~ s/\.pl//; # pull in DBI use DBI; +$form->{login} =~ s|.*/||; + # check for user config file, could be missing or ??? eval { require("$userspath/$form->{login}.conf"); }; if ($@) { @@ -84,28 +101,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 ($@); } @@ -117,7 +129,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!')); }