patch for emoncms, index.php, to handle https

 Hi,

Simple patch for index.php, to allow emoncms to run under SSL...

 



 


--- /var/www/emoncms3/index.php 2012-01-07 08:34:43.000000000 -0700
+++ index.php 2012-01-12 23:55:48.000000000 -0700
@@ -20,7 +20,15 @@
ini_set('display_errors','on');
error_reporting(E_ALL ^ E_NOTICE);

- $path = dirname("http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'])."/";
+ $ssl = $_SERVER['HTTPS'];
+ $proto = "http";
+
+ if ($ssl == "on") {
+ $proto = "https";
+ }
+
+
+ $path = dirname("$proto://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'])."/";

TrystanLea's picture

Re: patch for emoncms, index.php, to handle https

Thanks for this seanwg, I will add it now

Trystan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.