summaryrefslogtreecommitdiff
path: root/utils/admin_user.php
blob: 42ed784210e2a7f0ab59723b08676a1344033d76 (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
<h2>Password</h2>
<?php
include_once($UTIL_DIR."/user.php");
include_once($UTIL_DIR."/convert.php");

if($task == "setpassword") {
	$users = new Users($DATA_DIR . "/users.xml");
	$user = $users->findUser($HTTP_COOKIE_VARS["UserID"]);
	$user->setPassword($oldpassword, $password1, $password2);
	$users->add($user); // We need to update the user after changing the password!
	$users->write();
}
?>

<div class="small_header">Change password</div>
<form method="post" action="?page=admin&amp;module=user&amp;task=setpassword">
  <p>
    Old password:
    <input type="password" name="oldpassword" style="width: 100px;" value=""/
  </p>
  <p>
    New password:
    <input type="password" name="password1" style="width: 100px;" value=""/>
  </p>
  <p>
    Confirm password:
    <input type="password" name="password2" style="width: 100px;" value=""/>
  </p>
  <p>
    <button type="submit">Change password</button>
  </p>
</form>