summaryrefslogtreecommitdiff
path: root/forum/utils/profile.php
blob: 7f8372c2495be0ec6f4e22443a7ca61edc3c8beb (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
<?php
include_once($UTIL_DIR . "/error.php");

if($action == "update") {
//	   $current_user->username = $username;
	   $current_user->name = $name;
	   $current_user->email = $email;
	   $current_user->avatar = $avatar;
	   $current_user->signature = $signature;
	   if($password != "") {
			 if($password == $password_confirm) {
				 $current_user->password = sha1(md5($password));
			 } else {
				 error("Passwords do not match - thus not changed!");
			 }
		 }
	   $users->write();
}
?>

<form method="post" action="?mode=profile&amp;action=update">
<?php /*Username: <input name="username" value="<?php echo $current_user->username; ?>"><br/> */ ?>
Name: <input name="name" value="<?php echo $current_user->name; ?>"><br/>
New password: <input type="password" name="password" value=""><br/>
Confirm password: <input type="password" name="password_confirm" value=""><br/>
E-Mail: <input name="email" value="<?php echo $current_user->email; ?>"><br/>
Avatar: <select name="avatar">
<?php
$dir = opendir("gfx/avatars");
while($avatar = readdir($dir)) {
	if($avatar != "." && $avatar != "..") {
?>		<option value="<?php echo $avatar ?>" <?php if($current_user->avatar == $avatar) echo selected; ?>><?php echo $avatar ?></option>
<?php
	}
}
?>
</select><br/>
Signature:<br/>
<textarea name="signature" cols="60" rows="2"><?php echo $current_user->signature ?></textarea><br/>
<br/>
<button type="submit">Update</button>
</form>