diff options
-rwxr-xr-x | templates/index.php | 4 | ||||
-rwxr-xr-x | templates/settings.php | 4 | ||||
-rwxr-xr-x | templates/writer.php | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/templates/index.php b/templates/index.php index acc52a0..d031aa8 100755 --- a/templates/index.php +++ b/templates/index.php @@ -2,6 +2,10 @@ $currentpath = __DIR__."/CarnetElectron/"; $root = \OCP\Util::linkToAbsolute("carnet","templates"); +if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){ + //should be https... + $root = "https".substr($root,strlen("http")); +} $file = file_get_contents($currentpath."index.html"); // $file = str_replace("href=\"","href=\"".$root."/CarnetElectron/",$file); diff --git a/templates/settings.php b/templates/settings.php index 4f24dc3..f91095a 100755 --- a/templates/settings.php +++ b/templates/settings.php @@ -2,6 +2,10 @@ $currentpath = __DIR__."/CarnetElectron/"; $root = \OCP\Util::linkToAbsolute("carnet","templates"); +if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){ + //should be https... + $root = "https".substr($root,strlen("http")); +} $file = file_get_contents($currentpath."settings/index.html"); // diff --git a/templates/writer.php b/templates/writer.php index 7e449c8..b0f0e99 100755 --- a/templates/writer.php +++ b/templates/writer.php @@ -1,7 +1,10 @@ <?php $currentpath = __DIR__."/CarnetElectron/"; $root = \OCP\Util::linkToAbsolute("carnet","templates"); - +if(strpos($root,"http://") === 0 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){ + //should be https... + $root = "https".substr($root,strlen("http")); +} $file = file_get_contents($currentpath."reader/reader.html"); $file = str_replace("<!ROOTPATH>", $root."/CarnetElectron/", $file); |