auth.php: disallow unencrypted logins by default

This commit is contained in:
Zankaria 2024-04-30 11:31:06 +02:00
parent 003152095a
commit aa99d10f1a
5 changed files with 32 additions and 5 deletions

10
inc/functions/net.php Normal file
View file

@ -0,0 +1,10 @@
<?php
namespace Vichan\Functions\Net;
/**
* @return bool Returns if the client-server connection is an encrypted one (HTTPS).
*/
function is_connection_secure(): bool {
return !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
}