From be3db7d1e68a317041a9556f2849c292334245ab Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 23 Jun 2011 14:08:18 +0200 Subject: [PATCH] Benutzer-Anmeldung verweigern, wenn nicht eingespielte Admin-DB-Upgrades vorhanden sind --- SL/User.pm | 6 ++++ bin/mozilla/login.pl | 7 +++++ locale/de/all | 3 ++ .../webpages/login/auth_db_needs_update.html | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 templates/webpages/login/auth_db_needs_update.html diff --git a/SL/User.pm b/SL/User.pm index d6b870552..d638220c2 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -120,6 +120,12 @@ sub login { $self->create_schema_info_table($form, $dbh); + my $dbupdater_auth = SL::DBUpgrade2->new(form => $form, dbdriver => 'Pg', auth => 1)->parse_dbupdate_controls; + if ($dbupdater_auth->unapplied_upgrade_scripts($::auth->dbconnect)) { + $::lxdebug->leave_sub; + return -3; + } + $rc = 0; my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $myconfig{dbdriver})->parse_dbupdate_controls; diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 528c4eb4b..94905e4ed 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -112,6 +112,12 @@ sub login { # if we get an error back, bale out my $result; if (($result = $user->login($form)) <= -1) { + if ($result == -3) { + show_error('login/auth_db_needs_update'); + $::auth->destroy_session; + ::end_of_request(); + } + ::end_of_request() if $result == -2; login_screen($::locale->text('Incorrect username or password!')); ::end_of_request(); @@ -184,6 +190,7 @@ sub show_error { print $form->parse_html_template($template); # $form->parse_html_template('login/auth_db_unreachable'); + # $form->parse_html_template('login/auth_db_needs_update'); # $form->parse_html_template('login/authentication_pl_missing'); ::end_of_request(); diff --git a/locale/de/all b/locale/de/all index 38a9eaefe..37e8bfaba 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1068,6 +1068,8 @@ $self->{texts} = { 'Lx-Office has found one or more problems in the general ledger.' => 'Lx-Office hat ein oder mehrere Probleme im Hauptbuch gefunden.', 'Lx-Office is about to update the database [ #1 ].' => 'Lx-Office wird gleich die Datenbank [ #1 ] aktualisieren.', 'Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.' => 'Lx-Office enthält jetzt auch echte Lagerverwaultung anstatt reiner Mengenzählung.', + 'Lx-Office needs to update the authentication database before you can proceed.' => 'Lx-Office muss die Authentifizierungsdatenbank aktualisieren, bevor Sie fortfahren können.', + 'Lx-Office will then update the database automatically.' => 'Lx-Office wird die Datenbank daraufhin automatisch aktualisieren.', 'MAILED' => 'Gesendet', 'MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES' => 'Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte wählen Sie ein anderes Menü in der Benutzerkonfiguration im Administrationsmenü aus.', 'Main Preferences' => 'Grundeinstellungen', @@ -1324,6 +1326,7 @@ $self->{texts} = { 'Please insert your language values below' => 'Bitte die Übersetzungen unten eintragen', 'Please insert your longdescription below' => 'Bitte den Langtext eingeben', 'Please install the below listed modules or ask your system administrator to.' => 'Bitte installieren Sie die unten aufgeführten Module, oder bitten Sie Ihren Administrator darum.', + 'Please log in to the administration panel.' => 'Bitte melden Sie sich im Administrationsbereich an.', 'Please re-run the analysis for broken general ledger entries by clicking this button:' => 'Bitte wiederholen Sie die Analyse der Hauptbucheinträge, indem Sie auf diesen Button klicken:', 'Please read the file' => 'Bitte lesen Sie die Datei', 'Please select a customer from the list below.' => 'Bitte einen Endkunden aus der Liste auswählen', diff --git a/templates/webpages/login/auth_db_needs_update.html b/templates/webpages/login/auth_db_needs_update.html new file mode 100644 index 000000000..03854f6f1 --- /dev/null +++ b/templates/webpages/login/auth_db_needs_update.html @@ -0,0 +1,28 @@ +[%- USE LxERP %] + + +

[% LxERP.t8('Error!') %]

+ +

+ [%- LxERP.t8('Lx-Office needs to update the authentication database before you can proceed.') %] + [%- LxERP.t8('Please log in to the administration panel.') %] + [%- LxERP.t8('Lx-Office will then update the database automatically.') %] +

+ +
+

+ [% LxERP.t8('For further information read this:') %] + Lx-Office Installation
+ [% LxERP.t8('Or download the whole Installation Documentation as PDF (110kB) for off-line study (currently in German Language).') %] + Lx-Office_Installation_DE.pdf +

+ +
+ +

+ [% LxERP.t8('Login') %] | + [% LxERP.t8('Administration') %] +

+ + + -- 2.20.1