Auto-detect Cloudflare in installer

This commit is contained in:
Wruczek 2023-03-14 13:00:01 +01:00
parent 4ac20a09f7
commit bcef09b846
2 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,8 @@
<?php
if(!defined("__TSWEBSITE_VERSION")) die("Direct access not allowed");
use Medoo\Medoo;
if(!defined("__TSWEBSITE_VERSION")) die("Direct access not allowed");
if (!empty($_POST)) {
$dbhostname = trim($_POST["dbhostname"]);
$dbusername = trim($_POST["dbusername"]);

View File

@ -98,9 +98,10 @@ $displayip = Config::get("query_displayip"); // set initial website name to the
<div class="form-group mb-4">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="using-cloudflare" name="using-cloudflare">
<input type="checkbox" class="custom-control-input" id="using-cloudflare" name="using-cloudflare"
<?= isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? "checked" : "" ?>>
<label class="custom-control-label" for="using-cloudflare">
I am using CloudFlare
I am using Cloudflare
</label>
</div>
<p><small>This will change the way ts-website detects user IP address</small></p>