diff options
author | deva <deva> | 2008-10-04 10:38:03 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-04 10:38:03 +0000 |
commit | cce5e7710295021b41d9aaecc503a60fb99256be (patch) | |
tree | 660235be91fb821e976c7ae62347eb368ce87524 /forum/utils/profile.php |
Initial revision
Diffstat (limited to 'forum/utils/profile.php')
-rw-r--r-- | forum/utils/profile.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/forum/utils/profile.php b/forum/utils/profile.php new file mode 100644 index 0000000..ee47cb0 --- /dev/null +++ b/forum/utils/profile.php @@ -0,0 +1,39 @@ +<?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; + 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&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/> +<br/> +<button type="submit">Update</button> +</form> |