web - refactor core modules, harden authorization, simplify endpoints
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
// Initialisierung
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/general_files/initialise.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/brandschutz/util/brandschutz_helpers.php';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" dir="ltr">
|
||||
@@ -56,24 +57,17 @@
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if (isset($groups["Brandschutz"]) && $groups["Brandschutz"] == 1) {
|
||||
// Prüfen ob Schulung überfällig ist
|
||||
$bsOverdue = false;
|
||||
$bsStmt = $pdo->prepare("SELECT last_training_date FROM brandschutz_training WHERE user_id = ?");
|
||||
$bsStmt->execute([$_SESSION['user_id']]);
|
||||
$bsLastTraining = $bsStmt->fetchColumn();
|
||||
if ($bsLastTraining === false) {
|
||||
$bsOverdue = true;
|
||||
} else {
|
||||
if (empty($bsLastTraining) || strtotime($bsLastTraining . ' +365 days') < time()) {
|
||||
$bsOverdue = true;
|
||||
}
|
||||
}
|
||||
$bsTrainingStatus = brandschutz_training_status($bsLastTraining === false ? null : (string) $bsLastTraining);
|
||||
$bsOverdue = (bool) $bsTrainingStatus['is_due'];
|
||||
?>
|
||||
|
||||
<?php if ($bsOverdue): ?>
|
||||
<div class="mainpage_notice mainpage_notice--warning" role="status">
|
||||
<div class="mainpage_notice_title">Brandschutzunterweisung fällig!</div>
|
||||
<div class="mainpage_notice_text">Bitte führen Sie zeitnah die <strong><a href="window.location.href='/intranet_repo/projects/brandschutz/brandschutz.php'">Online-Brandschutzunterweisung</a></strong> durch. Die Schulung dauert nur ca. 15 bis 20 Minuten. Eine regelmäßige Durchführung ist gesetzlich vorgeschrieben. Vielen Dank!</div>
|
||||
<div class="mainpage_notice_text">Bitte führen Sie zeitnah die <strong><a href="/intranet_repo/projects/brandschutz/brandschutz.php">Online-Brandschutzunterweisung</a></strong> durch. Die Schulung dauert nur ca. 15 bis 20 Minuten. Eine regelmäßige Durchführung ist gesetzlich vorgeschrieben. Vielen Dank!</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user