aboutsummaryrefslogtreecommitdiff
path: root/setup.php
blob: 34324a4e299ffe4cbc04fc291693dd7c32caca00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/*
    praktrack - tracking the parts of a portfolio review
    Copyright (C) 2026  Friedrich Beckmann <friedrich.beckmann@tha.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
*/
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"]
    ),
    "amt" => array (
        "name" => "Prüfungsamt",
        "pnr"  => [],
        "studiengang" => []
    )
);

$notenlabor = ["BE", "NB", "AB", "NM", "NA"];
$notenklausur = ["100","130","170","200","230","270","300","330","370","400","500"];
$notenamt = ["1"]; //amt is either 1 or not set, i.e ""
$notendelete = ["00", "000"]; //Unset value in database "00" for labor, "000" for klausur
/*
$students = array (
    "1234567" => array (
        "vorname" => "Karl",
        "nachname" => "Meier",
        "studiengang" => "EI",
        "noten" => array (
            "ti" => array (
                "klausur" => "500",
                "labor" => "BE",
                "amt" => ""
            ),
            "dt" => []
        ),
        "history" => ["nix passiert"]

    ),
    "1111111" => array (
        "vorname" => "Claudia",
        "nachname" => "Darbo",
        "studiengang" => "ME",
        "noten" => array("ti" => [],"dt" => []),
        "history" => ["noch nix passiert"]

    ),
    "2222222" => array (
        "vorname" => "Günther",
        "nachname" => "Kohl",
        "studiengang" => "TI",
        "noten" => array("ti" => [],"dt" => []),
        "history" => ["gar nix passiert", "oder doch?"]

    )
);

$groups = array (
    "WiSe 2025/26" => array (
        "ti" => array (
                "G99-AA" => ["1234567", "1111111"],
                "G99-ZZ" => ["2222222", "1111111"]
            )
        ),
    "SoSe 2025" => array (
        "ti" => array (
                "G99-AA" => ["1111111"],
                "G98-ZZ" => ["2222222"]
             ),
        "dt" => array (
                "G99-KK" => ["1111111"],
                "G37-ZZ" => ["2222222","1234567"]
            )      
        )
);
*/
db_read();

} //setupdone
?>