Explorar o código

check for HTTPS connection

1Day %!s(int64=3) %!d(string=hai) anos
pai
achega
2947df6ce3
Modificáronse 2 ficheiros con 8 adicións e 0 borrados
  1. 7 0
      public/install/functions.php
  2. 1 0
      public/install/index.php

+ 7 - 0
public/install/functions.php

@@ -17,6 +17,13 @@ function checkPhpVersion()
     return "not OK";
     return "not OK";
 }
 }
 
 
+function checkHTTPS()
+{
+    return
+        (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
+        || $_SERVER['SERVER_PORT'] == 443;
+}
+
 function getMySQLVersion()
 function getMySQLVersion()
 {
 {
     global $requirements;
     global $requirements;

+ 1 - 0
public/install/index.php

@@ -63,6 +63,7 @@ if (!isset($_GET['step'])) {
     ?>
     ?>
     <p class="login-box-msg">This installer will lead you through the most crucial Steps of Controlpanel.gg`s
     <p class="login-box-msg">This installer will lead you through the most crucial Steps of Controlpanel.gg`s
         setup</p>
         setup</p>
+    <p class="<?php print(checkHTTPS() == true ? "ok" : "notok"); ?>">HTTPS is required</p>
 
 
     <p class="<?php print(checkPhpVersion() === "OK" ? "ok" : "notok"); ?>"> php
     <p class="<?php print(checkPhpVersion() === "OK" ? "ok" : "notok"); ?>"> php
         version: <?php echo phpversion(); ?> (required <?php echo $requirements["php"]; ?>)</p>
         version: <?php echo phpversion(); ?> (required <?php echo $requirements["php"]; ?>)</p>