[Mapbender-commits] r2738 - in branches/2.5/http: frames php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Aug 5 03:59:34 EDT 2008
Author: christoph
Date: 2008-08-05 03:59:34 -0400 (Tue, 05 Aug 2008)
New Revision: 2738
Modified:
branches/2.5/http/frames/login.php
branches/2.5/http/php/mod_logout.php
Log:
http://trac.osgeo.org/mapbender/ticket/121
Modified: branches/2.5/http/frames/login.php
===================================================================
--- branches/2.5/http/frames/login.php 2008-08-04 15:25:28 UTC (rev 2737)
+++ branches/2.5/http/frames/login.php 2008-08-05 07:59:34 UTC (rev 2738)
@@ -166,7 +166,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"];
@@ -186,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();
}
}
Modified: branches/2.5/http/php/mod_logout.php
===================================================================
--- branches/2.5/http/php/mod_logout.php 2008-08-04 15:25:28 UTC (rev 2737)
+++ branches/2.5/http/php/mod_logout.php 2008-08-05 07:59:34 UTC (rev 2738)
@@ -22,22 +22,36 @@
ob_start();
require_once(dirname(__FILE__)."/../include/dyn_php.php");
+
ignore_user_abort();
+
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
+
session_destroy();
+
$dir = preg_replace("/\\\/","/", dirname($_SERVER['PHP_SELF']));
if (isset($logout_location) && $logout_location != ''){
header("Location: ".$logout_location);
}
else {
- if (is_file(dirname($_SERVER['PHP_SELF'])."/login.php")) {
- header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/login.php");
- }
- else {
- header("Location: http://".$_SERVER['HTTP_HOST'].preg_replace("/\/php/","/frames",$dir)."/login.php");
- }
+ if (is_file(dirname($_SERVER['PHP_SELF'])."/login.php")) {
+ if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
+ header("Location: https://".$_SERVER['HTTP_HOST'].$dir."/login.php");
+ }
+ else {
+ header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/login.php");
+ }
+ }
+ else {
+ if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
+ header("Location: https://".$_SERVER['HTTP_HOST'].preg_replace("/\/php/","/frames",$dir)."/login.php");
+ }
+ else {
+ header("Location: http://".$_SERVER['HTTP_HOST'].preg_replace("/\/php/","/frames",$dir)."/login.php");
+ }
+ }
}
?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list