CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#6365] Make https redirections more robust to prevent loss of functionality in admin panel

avatar
Created By: Daniel Bünzli (dbuenzli)
Date Submitted: Wed Apr 06 02:41:04 -0400 2011

Assigned To: Robert Campbell (calguy1000)
Version: 1.9.4.1
CMSMS Version: None
Severity: Minor
Resolution: Won't Fix
State: Closed
Summary:
Make https redirections more robust to prevent loss of functionality in admin panel
Detailed Description:
My hosting setup is such that the code for redirection under https goes through
http which causes loss of functionality in the File Manager. A fix is given
below.

Thanks,

Daniel

> diff -u cms/lib/misc.functions.php.old cms/lib/misc.functions.php
--- cms/lib/misc.functions.php.old	2011-04-06 01:07:46.000000000 -0500
+++ cms/lib/misc.functions.php	2011-04-06 01:17:07.000000000 -0500
@@ -43,7 +43,7 @@
 	else
 		$config = array();
 
-    $schema = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http';
+    $schema = ($_SERVER['SERVER_PORT'] == '443' || $_SERVER['HTTPS'] == 'on') ?
'https' : 'http';
$host =
strlen($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:$_SERVER['SERVER_NAME'];
 
     $components = parse_url($to);
 


History

Comments
avatar
Date: 2011-04-06 05:58
Posted By: Daniel Bünzli (dbuenzli)

Also related is that all the ajax stuff in  the Content->Pages  page list didn't
work.  I tracked that to the following piece of code, which I just commented
out. Maybe something more sensible needs to be done.

Daniel

diff -u cms/lib/xajax/xajax_core/xajax.inc.php.old
cms/lib/xajax/xajax_core/xajax.inc.php
--- cms/lib/xajax/xajax_core/xajax.inc.php.old	2011-04-06 04:49:08.000000000
-0500
+++ cms/lib/xajax/xajax_core/xajax.inc.php	2011-04-06 04:55:04.000000000 -0500
@@ -920,11 +920,11 @@
 		$sURL.= $aURL['host'];
 
 		// Add the port if needed
-		if (!empty($aURL['port']) 
-			&& (($aURL['scheme'] == 'http' && $aURL['port'] != 80) 
-			|| ($aURL['scheme'] == 'https' && $aURL['port'] != 443))) {
-			$sURL.= ':'.$aURL['port'];
-		}
+// 		if (!empty($aURL['port']) 
+// 			&& (($aURL['scheme'] == 'http' && $aURL['port'] != 80) 
+// 			|| ($aURL['scheme'] == 'https' && $aURL['port'] != 443))) {
+// 			$sURL.= ':'.$aURL['port'];
+// 		}
 
 		// Add the path and the query string
 		$sURL.= $aURL['path'].@$aURL['query'];


      
avatar
Date: 2012-04-14 15:30
Posted By: Ronny Krijt (ronnyk)

To be checked post-1.11
      
avatar
Date: 2013-01-19 20:56
Posted By: Daniel Bünzli (dbuenzli)

Just a follow up on 1.11.4. 

The first patch in misc.functions.php doesn't seem to be needed anymore (the
code was changed).

However the patch for the ajax thing in the Content->Pages mentioned in my
comment from the 2011-04-06 still needs to be applied (otherwise the tree widget
doesn't work and you cannot reorder pages).

Best,

Daniel


      
avatar
Date: 2014-04-05 22:37
Posted By: Robert Campbell (calguy1000)

xajax dropped in CMSMS 2.0
      
Updates

Updated: 2014-12-20 23:27
state: Open => Closed

Updated: 2014-04-05 22:37
resolution_id: 6 => 8

Updated: 2012-09-07 15:05
resolution_id: 5 => 6
assigned_to_id: 100 => 106

Updated: 2012-04-14 15:30
severity_id: 2 => 3
cmsms_version_id: => -1

Updated: 2011-04-06 06:00
version_id: 28822 => 28949

Updated: 2011-04-06 05:58
resolution_id: => 5