[Mapbender-commits] r2746 - trunk/mapbender/http/frames

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 6 10:40:26 EDT 2008


Author: astrid_emde
Date: 2008-08-06 10:40:25 -0400 (Wed, 06 Aug 2008)
New Revision: 2746

Modified:
   trunk/mapbender/http/frames/login.php
Log:
Bugfix: http://trac.osgeo.org/mapbender/ticket/266

Bugfix: http://trac.osgeo.org/mapbender/ticket/121

Modified: trunk/mapbender/http/frames/login.php
===================================================================
--- trunk/mapbender/http/frames/login.php	2008-08-06 14:31:38 UTC (rev 2745)
+++ trunk/mapbender/http/frames/login.php	2008-08-06 14:40:25 UTC (rev 2746)
@@ -90,7 +90,6 @@
 $name = $_REQUEST["name"];
 $password = $_REQUEST["password"];
 
-$loginMax = MAXLOGIN;
 
 if(!isset($name) || $name == ''){
   echo "<script type='text/javascript'>";
@@ -149,7 +148,7 @@
 		include(dirname(__FILE__)."/../../conf/session.conf");
 	}	
 	if($_SESSION["mb_user_id"]){
-		if($row["mb_user_login_count"] < $loginMax){
+		if($row["mb_user_login_count"] <= MAXLOGIN){
 			$sql_del_cnt =  "UPDATE mb_user SET mb_user_login_count = 0 WHERE mb_user_id = $1";
 			$v = array($_SESSION['mb_user_id']);
 			$t = array("i");
@@ -166,7 +165,12 @@
 			}
 			#only one gui is provided
 			if(count($arrayGUIs) == 1){
-				$myURL = "Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php?".strip_tags (SID)."&gui_id=".$arrayGUIs[0];            
+				if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
+					$myURL = "Location: https://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php?".strip_tags (SID)."&gui_id=".$arrayGUIs[0];
+				}
+				else {
+					$myURL = "Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php?".strip_tags (SID)."&gui_id=".$arrayGUIs[0];
+				}
 				# params for the initial call
 				if(isset($_REQUEST["mb_myBBOX"])){
 					$myURL .= "&mb_myBBOX=".$_REQUEST["mb_myBBOX"];
@@ -187,7 +191,12 @@
 		$v = array($name);
 		$t = array('s');
 		db_prep_query($sql_set_cnt,$v,$t);				
-		header ("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/login.php?name=".$name);
+		if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
+			header ("Location: https://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/login.php?name=".$name);
+		}
+		else {
+			header ("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/login.php?name=".$name);
+		}
 		exit();
 	}
 }



More information about the Mapbender_commits mailing list