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(); } $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; }