From 5421c05aae8b1d8794aca515549ec95416450f23 Mon Sep 17 00:00:00 2001 From: kent1 Date: Sun, 6 Aug 2017 23:31:22 +0200 Subject: [PATCH 1/2] Error on isset for X_FORWARDED_PROTO Should be `isset($_SERVER["HTTP_X_FORWARDED_PROTO"])` and not `!isset($_SERVER["HTTP_X_FORWARDED_PROTO"])` Avoid a notice : `PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /usr/share/alternc/panel/class/config.php on line 170` --- bureau/class/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bureau/class/config.php b/bureau/class/config.php index 6af94001..ff578321 100755 --- a/bureau/class/config.php +++ b/bureau/class/config.php @@ -167,7 +167,7 @@ $err = new m_err(); $authip = new m_authip(); $hooks = new m_hooks(); -if (!isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"]=="https") { +if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"]=="https") { $_SERVER["HTTPS"]="on"; } From d375dc2c7cfe1d90415f6e8206641a11faab9c6b Mon Sep 17 00:00:00 2001 From: kent1 Date: Sun, 6 Aug 2017 23:46:02 +0200 Subject: [PATCH 2/2] Avoid a warning if directory exists PHP Warning: mkdir(): File exists in /usr/lib/alternc/install.d/alternc-ssl on line 12 --- ssl/alternc-ssl.install.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssl/alternc-ssl.install.php b/ssl/alternc-ssl.install.php index 9544c2d0..cfb548e6 100644 --- a/ssl/alternc-ssl.install.php +++ b/ssl/alternc-ssl.install.php @@ -9,7 +9,9 @@ if ($argv[1] == "templates") { // install ssl.conf echo "[alternc-ssl] Installing ssl.conf template\n"; copy("/etc/alternc/templates/apache2/mods-available/ssl.conf","/etc/apache2/mods-available/ssl.conf"); - mkdir("/var/run/alternc-ssl"); + if (!is_dir('/var/run/alternc-ssl')) { + mkdir("/var/run/alternc-ssl"); + } chown("/var/run/alternc-ssl","alterncpanel"); chgrp("/var/run/alternc-ssl","alterncpanel"); // replace open_basedir line if necessary :