From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Nov 2011 09:32:21 +0000 Subject: Rewl og krat... needs cleaning up - after port to GIT. --- forum/utils/profile.php | 91 ++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 42 deletions(-) (limited to 'forum/utils/profile.php') diff --git a/forum/utils/profile.php b/forum/utils/profile.php index f7595ed..d96b8c2 100644 --- a/forum/utils/profile.php +++ b/forum/utils/profile.php @@ -1,45 +1,52 @@ username = $username; - $current_user->name = $name; - $current_user->email = $email; - // $current_user->avatar = $avatar; - $current_user->signature = stripslashes($signature); - if($password != "") { - if($password == $password_confirm) { - $current_user->password = sha1(md5($password)); - } else { - error("Passwords do not match - thus not changed!"); - } - } + if($action == "update") { + global $name, $email, $signature, $password, $password_confirm, $users; + // $current_user->username = $username; + $current_user->name = $name; + $current_user->email = $email; + // $current_user->avatar = $avatar; + $current_user->signature = stripslashes($signature); + if($password != "") { + if($password == $password_confirm) { + $current_user->password = sha1(md5($password)); + } else { + error("Passwords do not match - thus not changed!"); + } + } + + if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { + if(!file_exists("gfx/avatars")) mkdir("gfx/avatars"); + // Prepend username to prevent overwriting of other users avatars. + $filename = $current_user->username . "_" . $_FILES['userfile']['name']; + if($current_user->avatar) unlink("gfx/avatars/" . $current_user->avatar); + move_uploaded_file($_FILES['userfile']['tmp_name'], "gfx/avatars/" . $filename); + $current_user->avatar = $filename; + } + + $users->write(); + } - if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { - if(!file_exists("gfx/avatars")) mkdir("gfx/avatars"); - // Prepend username to prevent overwriting of other users avatars. - $filename = $current_user->username . "_" . $_FILES['userfile']['name']; - if($current_user->avatar) unlink("gfx/avatars/" . $current_user->avatar); - move_uploaded_file($_FILES['userfile']['tmp_name'], "gfx/avatars/" . $filename); - $current_user->avatar = $filename; - } - - - $users->write(); -} -?> - -
username; ?>">
*/ ?> - Name:
- New password:
- Confirm password:
- E-Mail:
- Avatar:
- Avatar
-
- Signature:
-
-
- -
+ $str .= "
"; + //$str .= " Username: username . "\"
"; + $str .= " Name: name . "\">
"; + $str .= " New password:
"; + $str .= " Confirm password:
"; + $str .= " E-Mail: email . "\">
"; + $str .= " Avatar:
"; + $str .= " \"Avatar\"avatar . "\"/>
"; + $str .= "
"; + $str .= " Signature:
"; + $str .= "
"; + $str .= "
"; + $str .= " "; + $str .= "
"; + + return $str; +} \ No newline at end of file -- cgit v1.2.3