projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Den Pfad zu den Vorlagen richtig setzen. Ging mit dem letzten Commit kaputt.
[kivitendo-erp.git]
/
am.pl
diff --git
a/am.pl
b/am.pl
index
ef43d9d
..
b54599e
100755
(executable)
--- a/
am.pl
+++ b/
am.pl
@@
-30,25
+30,38
@@
#
#######################################################################
#
#######################################################################
+BEGIN {
+ push(@INC, "modules");
+}
+
# setup defaults, DO NOT CHANGE
# setup defaults, DO NOT CHANGE
-$userspath = "users";
-$templates = "templates";
+$userspath
= "users";
+$templates
= "templates";
$memberfile = "users/members";
$memberfile = "users/members";
-$sendmail = "| /usr/sbin/sendmail -t";
+$sendmail
= "| /usr/sbin/sendmail -t";
########## end ###########################################
########## end ###########################################
-
$| = 1;
use SL::LXDebug;
$lxdebug = LXDebug->new();
$| = 1;
use SL::LXDebug;
$lxdebug = LXDebug->new();
+use CGI;
use SL::Form;
use SL::Form;
+use SL::Locale;
eval { require "lx-erp.conf"; };
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;
$form = new Form;
+$cgi = new CGI('');
# name of this script
$0 =~ tr/\\/\//;
# name of this script
$0 =~ tr/\\/\//;
@@
-57,69
+70,69
@@
$script = substr($0, $pos + 1);
# we use $script for the language module
$form->{script} = $script;
# we use $script for the language module
$form->{script} = $script;
+
# strip .pl for translation files
$script =~ s/\.pl//;
# pull in DBI
use DBI;
# strip .pl for translation files
$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 ($@) {
$locale = new Locale "$language", "$script";
# check for user config file, could be missing or ???
eval { require("$userspath/$form->{login}.conf"); };
if ($@) {
$locale = new Locale "$language", "$script";
-
+
$form->{callback} = "";
$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 <p><a href=login.pl target=_top>$msg2</a>");
}
$form->redirect("$msg1 <p><a href=login.pl target=_top>$msg2</a>");
}
-
$myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
$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
# locale messages
$locale = new Locale "$myconfig{countrycode}", "$script";
# check 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('Incorrect Password!'))
+ if ($form->{password} ne $myconfig{password});
# did sysadmin lock us out
if (-e "$userspath/nologin") {
$form->error($locale->text('System currently down for maintenance!'));
}
# did sysadmin lock us out
if (-e "$userspath/nologin") {
$form->error($locale->text('System currently down for maintenance!'));
}
-
# pull in the main code
# pull in the main code
-require "
$form->{path}
/$form->{script}";
+require "
bin/mozilla
/$form->{script}";
# customized scripts
# 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
$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 ($@);
}
if ($form->{action}) {
$form->error($@) if ($@);
}
if ($form->{action}) {
+
# window title bar, user info
# 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}) }
;
+
call_sub($locale->findsub($form->{action}))
;
} else {
$form->error($locale->text('action= not defined!'));
}
} else {
$form->error($locale->text('action= not defined!'));
}
-
# end
# end