This repository was archived by the owner on May 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprofile.php
More file actions
88 lines (78 loc) · 2.46 KB
/
Copy pathprofile.php
File metadata and controls
88 lines (78 loc) · 2.46 KB
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
<?php include_once 'inc/header.php'; ?>
<?php
$user = AuthenticationManager::getAuthenticatedUser();
if ($user->getRole() === "teacher"): ?>
<script type='text/javascript' src='js/teacher.js'></script>
<?php endif ?>
<?php
function getRoleInGerman($role)
{
switch ($role)
{
case 'admin':
return 'Administrator';
break;
case 'student':
return 'Schüler';
break;
case 'teacher':
return 'Lehrer';
break;
default:
return 'Unbekannt';
}
}
?>
<div class='container'>
<div class="message" id="message">
</div>
<h1>Benutzerprofil</h1>
<table class='table table-striped'>
<tr>
<th>Benutzername</th>
<td><?php echo escape($user->getUserName()); ?></td>
</tr>
<tr>
<th>Vorname</th>
<td><?php echo escape($user->getFirstName()); ?></td>
</tr>
<tr>
<th>Nachname</th>
<td><?php echo escape($user->getLastName()); ?></td>
</tr>
<tr>
<th>Klasse</th>
<td><?php echo escape($user->getClass()); ?></td>
</tr>
<tr>
<th>Rolle</th>
<td><?php echo escape(getRoleInGerman($user->getRole())); ?></td>
</tr>
</table>
<br><br>
<?php
if ($user->getRole() === "teacher"): ?>
<h2>Passwort ändern</h2>
<table class='table table-striped'>
<form id="changePasswordForm" method="POST" action="">
<tr>
<th><label for="current_password">Aktuelles Passwort</label></th>
<td><input type="password" id="current_password" name="current_password" required></td>
</tr>
<tr>
<th><label for="new_password">Neues Passwort:</label></th>
<td><input type="password" id="new_password" name="new_password" required></td>
</tr>
<tr>
<th><label for="confirm_password">Bestätige Passwort:</label></th>
<td><input type="password" id="confirm_password" name="confirm_password" required></td>
</tr>
<tr>
<th></th>
<td><input id="btn-change-password" type="submit" value="Passwort ändern"></td>
</tr>
</form>
</table>
<?php endif ?>
</div>
<?php include_once 'inc/footer.php'; ?>