aboutsummaryrefslogtreecommitdiff
path: root/setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'setup.php')
-rw-r--r--setup.php93
1 files changed, 93 insertions, 0 deletions
diff --git a/setup.php b/setup.php
new file mode 100644
index 0000000..640ee56
--- /dev/null
+++ b/setup.php
@@ -0,0 +1,93 @@
+<?php
+if (!isset($setupdone)) {
+$setupdone=TRUE;
+include "database.php";
+
+$semester = ["WiSe 2025/26", "SoSe 2025", "WiSe 2024/25"];
+
+$admins = ["beckmanf"];
+
+function my_session_start() {
+ $secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
+ session_start([
+ 'use_strict_mode' => 1,
+ 'cookie_httponly' => 1,
+ 'cookie_secure' => $secure, // Only if using HTTPS
+ 'cookie_samesite' => 'Strict', // or 'Lax'
+ 'use_only_cookies' => 1
+ ]);
+ // Set session timeout
+ if (isset($_SESSION['LAST_ACTIVITY']) &&
+ (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) { // 30 minutes
+ session_unset();
+ session_destroy();
+ }
+ $_SESSION['LAST_ACTIVITY'] = time();
+}
+
+$pfp = array (
+ "ti" => array (
+ "name" => "Technische Informatik",
+ "pnr" => ["1710080", "3707100"],
+ "studiengang" => ["EI", "ME"]
+ ),
+ "dt" => array (
+ "name" => "Digitaltechnik",
+ "pnr" => ["3976090"],
+ "studiengang" => ["TI"]
+ )
+);
+
+$notenlabor = ["BE", "NB", "AB", "NM", "NA"];
+$notenklausur = ["100","130","170","200","230","270","300","330","370","400","500"];
+
+$students = array (
+ "12345" => array (
+ "vorname" => "Karl",
+ "nachname" => "Meier",
+ "studiengang" => "EI",
+ "noten" => array (
+ "ti" => array (
+ "klausur" => "500",
+ "labor" => "BE"
+ ),
+ "dt" => []
+ )
+ ),
+ "11111" => array (
+ "vorname" => "Claudia",
+ "nachname" => "Darbo",
+ "studiengang" => "ME",
+ "noten" => array("ti" => [],"dt" => [])
+ ),
+ "22222" => array (
+ "vorname" => "Günther",
+ "nachname" => "Kohl",
+ "studiengang" => "TI",
+ "noten" => array("ti" => [],"dt" => [])
+ )
+);
+
+$groups = array (
+ "WiSe 2025/26" => array (
+ "ti" => array (
+ "G99-AA" => ["12345", "11111"],
+ "G99-ZZ" => ["22222", "11111"]
+ )
+ ),
+ "SoSe 2025" => array (
+ "ti" => array (
+ "G99-AA" => ["11111"],
+ "G98-ZZ" => ["22222"]
+ ),
+ "dt" => array (
+ "G99-KK" => ["11111"],
+ "G37-ZZ" => ["22222","12345"]
+ )
+ )
+);
+
+db_read();
+
+} //setupdone
+?>