check for HTTPS connection

check for HTTPS connection
This commit is contained in:
Dennis 2022-01-26 13:25:27 +01:00 committed by GitHub
commit ed1dcddee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

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

View file

@ -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
setup</p>
<p class="<?php print(checkHTTPS() == true ? "ok" : "notok"); ?>">HTTPS is required</p>
<p class="<?php print(checkPhpVersion() === "OK" ? "ok" : "notok"); ?>"> php
version: <?php echo phpversion(); ?> (required <?php echo $requirements["php"]; ?>)</p>