projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hilfsfunktion 'ary_to_hash' für einfache Umwandlung eines Arrays in ein Hash
[kivitendo-erp.git]
/
SL
/
Dispatcher.pm
diff --git
a/SL/Dispatcher.pm
b/SL/Dispatcher.pm
index
147b8cc
..
35284db
100644
(file)
--- a/
SL/Dispatcher.pm
+++ b/
SL/Dispatcher.pm
@@
-16,9
+16,6
@@
use SL::Locale;
use SL::Common;
use Form;
use List::Util qw(first);
use SL::Common;
use Form;
use List::Util qw(first);
-use Moose;
-use Rose::DB;
-use Rose::DB::Object;
use File::Basename;
# Trailing new line is added so that Perl will not add the line
use File::Basename;
# Trailing new line is added so that Perl will not add the line
@@
-85,6
+82,10
@@
sub pre_startup_setup {
%::myconfig = ();
%::called_subs = (); # currently used for recursion detection
}
%::myconfig = ();
%::called_subs = (); # currently used for recursion detection
}
+
+ $SIG{__WARN__} = sub {
+ $::lxdebug->warn(@_);
+ }
}
sub pre_startup_checks {
}
sub pre_startup_checks {
@@
-97,6
+98,7
@@
sub pre_startup {
}
sub require_main_code {
}
sub require_main_code {
+ $::lxdebug->enter_sub;
my ($script, $suffix) = @_;
eval {
my ($script, $suffix) = @_;
eval {
@@
-118,6
+120,7
@@
sub require_main_code {
};
$::form->error($EVAL_ERROR) if ($EVAL_ERROR);
}
};
$::form->error($EVAL_ERROR) if ($EVAL_ERROR);
}
+ $::lxdebug->leave_sub;
}
sub handle_request {
}
sub handle_request {
@@
-127,13
+130,9
@@
sub handle_request {
my $interface = lc(shift || 'cgi');
my ($script_name, $action);
my $interface = lc(shift || 'cgi');
my ($script_name, $action);
- if ($interface =~ m/^(?:fastcgi|fcgid|fcgi)$/) {
- $script_name = $ENV{SCRIPT_NAME};
- unrequire_bin_mozilla();
+ $script_name = $ENV{SCRIPT_NAME};
- } else {
- $script_name = $0;
- }
+ unrequire_bin_mozilla($interface);
$::cgi = CGI->new('');
$::locale = Locale->new($::language);
$::cgi = CGI->new('');
$::locale = Locale->new($::language);
@@
-150,16
+149,16
@@
sub handle_request {
pre_request_checks();
eval {
pre_request_checks();
eval {
- if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
- $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
- ::run($::auth->restore_session);
+ my $session_result = $::auth->restore_session;
+ $::auth->create_or_refresh_session;
- } elsif ($action) {
- # copy from am.pl routines
- $::form->error($::locale->text('System currently down for maintenance!')) if -e "$main::userspath/nologin" && $script ne 'admin';
+ $::form->error($::locale->text('System currently down for maintenance!')) if -e "$::userspath/nologin" && $script ne 'admin';
- my $session_result = $::auth->restore_session;
+ if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
+ $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
+ ::run($session_result);
+ } else {
show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result;
%::myconfig = $::auth->read_user($::form->{login});
show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result;
%::myconfig = $::auth->read_user($::form->{login});
@@
-173,14
+172,15
@@
sub handle_request {
$::auth->create_or_refresh_session;
delete $::form->{password};
$::auth->create_or_refresh_session;
delete $::form->{password};
- map { $::form->{$_} = $::myconfig{$_} } qw(stylesheet charset)
- unless $action eq 'save' && $::form->{type} eq 'preferences';
+ if ($action) {
+ map { $::form->{$_} = $::myconfig{$_} } qw(stylesheet charset)
+ unless $action eq 'save' && $::form->{type} eq 'preferences';
- $::form->set_standard_title;
- ::call_sub('::' . $::locale->findsub($action));
-
- } else {
- $::form->error($::locale->text('action= not defined!'));
+
$::form->set_standard_title;
+
::call_sub('::' . $::locale->findsub($action));
+ } else {
+ $::form->error($::locale->text('action= not defined!'));
+ }
}
1;
}
1;
@@
-202,6
+202,8
@@
sub handle_request {
}
sub unrequire_bin_mozilla {
}
sub unrequire_bin_mozilla {
+ return unless $_[0] =~ m/^(?:fastcgi|fcgid|fcgi)$/;
+
for (keys %INC) {
next unless m#^bin/mozilla/#;
next if /\bcommon.pl$/;
for (keys %INC) {
next unless m#^bin/mozilla/#;
next if /\bcommon.pl$/;