Author:   Lars Michelsen <[email protected]>
Date:     Wed Jan 18 11:30:56 2012 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Wed Jan 18 11:30:56 2012 +0100

Multisite auth: Redirecting to login page when auth.secret does not exist

---

 ChangeLog                                        |    1 +
 share/server/core/classes/CoreLogonMultisite.php |   13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2edf741..6772805 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Core
   * Added ; and | to allowed signs for urls
   * Undefined backend in single objects does not prevent whole map loading 
anymore
   * Overview page: Better handling of invalid map configuration files
+  * Multisite auth: Redirecting to login page when auth.secret does not exist
 
 Frontend
   * Showing dummy shape image when configured shape does not exist
diff --git a/share/server/core/classes/CoreLogonMultisite.php 
b/share/server/core/classes/CoreLogonMultisite.php
index 6b0ca5e..4128116 100644
--- a/share/server/core/classes/CoreLogonMultisite.php
+++ b/share/server/core/classes/CoreLogonMultisite.php
@@ -36,8 +36,9 @@ class CoreLogonMultisite extends CoreLogonModule {
                           array('PATH' => $this->htpasswdPath)));
         }
         if(!file_exists($this->secretPath)) {
-            throw new NagVisException(l('LogonMultisite: The auth secret file 
&quot;[PATH]&quot; does not exist.',
-                          array('PATH' => $this->secretPath)));
+            $this->redirectToLogin();
+            //throw new NagVisException(l('LogonMultisite: The auth secret 
file &quot;[PATH]&quot; does not exist.',
+            //              array('PATH' => $this->secretPath)));
         }
     }
 
@@ -100,13 +101,17 @@ class CoreLogonMultisite extends CoreLogonModule {
         return '';
     }
 
+    private function redirectToLogin() {
+        // FIXME: Get the real path to multisite
+        header('Location:../../../check_mk/login.py?_origtarget=' . 
$_SERVER['REQUEST_URI']);
+    }
+
     public function check($printErr = true) {
         global $AUTH, $CORE;
 
         $username = $this->checkAuth();
         if($username === '') {
-            // FIXME: Get the real path to multisite
-            header('Location:../../../check_mk/login.py?_origtarget=' . 
$_SERVER['REQUEST_URI']);
+            $this->redirectToLogin();
             return false;
         }
 


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to