Cannot Add New Clock or Change City Window 11
[SOLVED] Forgot Password -> Error 500
installation problem : MDB2 Error: unknown error
the "actual" time of arrival & departure
Time Tracker UPGRADE INSTRUCTIONS
// ttMitigateCSRF verifies request headers in an attempt to block cross site request forgery.
function ttMitigateCSRF() {
// No need to do anything for get requests.
global $request;
if ($request->isGet())
return true;
$origin = $_SERVER['HTTP_ORIGIN'];
if ($origin) {
$pos = strpos($origin, '//');
$origin = substr($origin, $pos+2); // Strip protocol.
}
if (!$origin) {
// Try using referer.
$origin = $_SERVER['HTTP_REFERER'];
if ($origin) {
$pos = strpos($origin, '//');
$origin = substr($origin, $pos+2); // Strip protocol.
$pos = strpos($origin, '/');
$origin = substr($origin, 0, $pos); // Leave host only.
}
}
$target = defined('HTTP_TARGET') ? HTTP_TARGET : $_SERVER['HTTP_HOST'];
if (strcmp($origin, $target)) {
error_log("Potential cross site request forgery. Origin: '$origin' does not match target: '$target'.");
return false; // Origin and target do not match.
}
return true;
}
// ttAccessAllowed checks whether user is allowed access to a particular page.
// It is used as an initial check on all publicly available pages
// (except login.php, register.php, and others where we don't have to check).
function ttAccessAllowed($required_right)
{
global $auth;
global $user;
// Redirect to login page if user is not authenticated.
if (!$auth->isAuthenticated()) {
header('Location: login.php');
exit();
}
// Protection against cross site request forgery.
if (!ttMitigateCSRF())
return false;
...