diff options
| author | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2026-01-30 17:59:23 +0100 |
|---|---|---|
| committer | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2026-01-30 17:59:23 +0100 |
| commit | d0fce093ef2f16fc2897baf7ddf93b6f969890bf (patch) | |
| tree | c39446943c2a36c4bafcaa5e1640d3ea85721a90 /index.php | |
initial commit
The first prototype where you can upload student data from moodle
and change the marks. In student view the results for the logged in
person can be viewed.
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/index.php b/index.php new file mode 100644 index 0000000..3997484 --- /dev/null +++ b/index.php @@ -0,0 +1,46 @@ +<?php +include "setup.php"; +include "login.php"; +my_session_start(); + +$login = FALSE; +if (!empty($_POST["login"]) and $_POST["login"] === "login") { + $login = try_login($_POST["username"],$_POST["password"]); +} elseif (isset($_SESSION["login"])) { + $login = $_SESSION["login"]; +} + +if ($login === "admin") { + include "admin-show.php"; +} elseif ($login === "user") { + include "show-user.php"; +} else { +?> +<!DOCTYPE html> +<html> +<body> + <h1>Ergebnisse der Portfolioprüfungen</h1> + <p>Hier können sie die Teilleistungen der Portfolioprüfungen für + die Veranstaltungen „Technische Informatik für EIT/ME“ und + „Digitaltechnik für TI“ einsehen. Sie müssen für den Login im Netz + der Hochschule oder über VPN mit dem Hochschulnetz verbunden sein. + </p> + + <form action="index.php" method="post"> + <label for="username">Username: </label> + <input type="text" name="username"><br> + <label for="password">Password: </label> + <input type="password" name="password"><br> + <input type="submit" name="login" value="login"> + </form> +<?php + if ($login === "nodb") { + echo "<p>Login hat funktioniert. Leider habe ich sie nicht in der + Datenbank gefunden.</p>"; + } elseif ($login === "failed") { + echo "<p>Login failed </p>"; + } + echo "</body>"; + echo "</html>"; +} +?>
\ No newline at end of file |
