first commit

This commit is contained in:
pgmr3
2023-12-22 17:21:31 +01:00
commit dde03b1d27
57 changed files with 6287 additions and 0 deletions

40
check_lifetime.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
// ------------------------------------------------------------------------------
//
// © Copyright (с) 2023 License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
// Author: Rhttps://github.com/pgmr3
// ------------------------------------------------------------------------------
include_once('config.php');
include_once('check_accesstoken.php');
if(session_status() !== PHP_SESSION_ACTIVE) $name_vorher = session_name (SESSION_NAME); //"ServerTools");
session_start();//repeated start without changing the parameters
if(!isset($_SESSION['endTime']) || !isset($_SESSION['sso_accesstoken']) ) {
header('State:'.'noAccess');
exit();
}
$_SESSION['lifetime'] = $_SESSION['endTime'] - time();//Remaining time
if ($_SESSION['lifetime'] <= 0 ) {
CheckAccesstoken();
if(!isset($_SESSION['sso_accesstoken'])) {
header('location: '.LOCAL_HOST.'/');
header('State:'.'noAccess');
exit();
}
}
else {
header('State:'.'waiting');
//usleep(1000);
}
if(isset($_GET['echoSessionLifetime'])) {
if ($_GET['echoSessionLifetime'] === "true") {
echo "You will be logged out in ".$_SESSION['lifetime']." seconds. Renew with F5/reload site.";
}
else exit();
}
?>