forked from bobosch/uvr1611
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changePassword.php
40 lines (39 loc) · 968 Bytes
/
changePassword.php
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
<?php
include_once("lib/backend/database.inc.php");
include_once("lib/login/session.inc.php");
include_once("lib/error.inc.php");
try {
$database = Database::getInstance();
if(isset($_POST["password1"], $_POST["password2"], $_POST["password3"]) && $_POST["password2"] == $_POST["password3"] && login("admin", $_POST["password1"])) {
$database->changePassword("admin", $_POST["password2"]);
?>
<html>
<body>
Passwort geaendert!
</body>
</html>
<?php
}
else
{
?>
<html>
<body>
<form method="post" action="changePassword.php">
<label for="password1">Altes Passwort:</label>
<input name="password1" type="password"/>
<label for="password2">Neues Passwort:</label>
<input name="password2" type="password"/>
<label for="password3">Neues Passwort bestaetigen:</label>
<input name="password3" type="password"/>
<input name="submit" type="submit" value="aendern"/>
</form>
</body>
</html>
<?php
}
}
catch(Exception $e) {
sendAjaxError($e);
}
?>