Admininterface: Wenn eine gültige Session mit gültigem Admin-Passwort vorliegt, dann...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Jan 2008 08:39:56 +0000 (08:39 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Jan 2008 08:39:56 +0000 (08:39 +0000)
bin/mozilla/admin.pl

index a6200ba..6af37b3 100644 (file)
@@ -78,10 +78,7 @@ $form->{stylesheet} = "lx-office-erp.css";
 $form->{favicon}    = "favicon.ico";
 
 if ($form->{action}) {
-
-  $subroutine = $locale->findsub($form->{action});
-
-  if ($auth->authenticate_root($form->{rpw}, 0)) {
+  if ($auth->authenticate_root($form->{rpw}, 0) != Auth::OK) {
     $form->{error_message} = $locale->text('Incorrect Password!');
     adminlogin();
     exit;
@@ -89,10 +86,15 @@ if ($form->{action}) {
 
   $auth->create_or_refresh_session() if ($auth->session_tables_present());
 
-  call_sub($subroutine);
+  call_sub($locale->findsub($form->{action}));
 
-} else {
+} elsif ($auth->authenticate_root($form->{rpw}, 0) == Auth::OK) {
+
+  $auth->create_or_refresh_session() if ($auth->session_tables_present());
+
+  login();
 
+} else {
   # if there are no drivers bail out
   $form->error($locale->text('No Database Drivers available!'))
     unless (User->dbdrivers);