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 constant END_OF_REQUEST => "END-OF-REQUEST\n";
sub pre_request_checks {
- show_error('login/auth_db_unreachable') unless $::auth->session_tables_present;
+ if (!$::auth->session_tables_present) {
+ if ($::form->{script} eq 'admin.pl') {
+ ::run();
+ ::end_of_request();
+ } else {
+ show_error('login/auth_db_unreachable');
+ }
+ }
$::auth->expire_sessions;
}
pre_request_checks();
eval {
+ $::form->error($::locale->text('System currently down for maintenance!')) if -e "$::userspath/nologin" && $script ne 'admin';
+
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);
} elsif ($action) {
# copy from am.pl routines
- $::form->error($::locale->text('System currently down for maintenance!')) if -e "$main::userspath/nologin" && $script ne 'admin';
-
my $session_result = $::auth->restore_session;
show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result;