[Mapbender-commits] r8063 - branches/mobile/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 23 10:30:46 EDT 2011


Author: pschmidt
Date: 2011-08-23 07:30:46 -0700 (Tue, 23 Aug 2011)
New Revision: 8063

Modified:
   branches/mobile/http/php/mb_validateSession.php
Log:
Einlogen mit PUBLIC_USER

Modified: branches/mobile/http/php/mb_validateSession.php
===================================================================
--- branches/mobile/http/php/mb_validateSession.php	2011-08-15 15:05:26 UTC (rev 8062)
+++ branches/mobile/http/php/mb_validateSession.php	2011-08-23 14:30:46 UTC (rev 8063)
@@ -33,11 +33,33 @@
 if (!Mapbender::session()->get("mb_user_id") || 
 	!Mapbender::session()->get("mb_user_ip") || 
 	Mapbender::session()->get('mb_user_ip') != $_SERVER['REMOTE_ADDR']) {
+    if(isset($INDEX_WITHOUTPASS) && $INDEX_WITHOUTPASS && defined("PUBLIC_USER")) {
+            Mapbender::session()->set("mb_user_id", PUBLIC_USER);
+            require_once(dirname(__FILE__)."/../classes/class_user.php");
+            $user = new User();
 
-		$e = new mb_exception("mb_validateSession.php: Invalid user: " . Mapbender::session()->get("mb_user_id"));
-		session_write_close();
-		header("Location: " . LOGIN);
-		die();
+            if (intval($user->id) == intval(PUBLIC_USER)) {
+                Mapbender::session()->set("mb_user_password", $user->name);
+                Mapbender::session()->set("mb_user_id", $user->id);
+                Mapbender::session()->set("mb_user_name", $user->name);
+                Mapbender::session()->set("mb_user_ip", $_SERVER['REMOTE_ADDR']);
+                Mapbender::session()->set("HTTP_HOST", $_SERVER["HTTP_HOST"]);
+
+                require_once(dirname(__FILE__)."/mb_getGUIs.php");
+                $arrayGUIs = mb_getGUIs($user->id);
+                Mapbender::session()->set("mb_user_guis", $arrayGUIs);
+            } else {
+                $e = new mb_exception("mb_validateSession.php: Invalid user: " . Mapbender::session()->get("mb_user_id"));
+                session_write_close();
+                header("Location: " . LOGIN);
+                die();
+            }
+        } else {
+                $e = new mb_exception("mb_validateSession.php: Invalid user: " . Mapbender::session()->get("mb_user_id"));
+                session_write_close();
+                header("Location: " . LOGIN);
+                die();
+        }
 }
 
 //



More information about the Mapbender_commits mailing list