///////////////////////////////////////////////////////////////////////////////////
// //
// phpBoard -- Copyright (c) 2000 by Nathan Clemons //
// nathan@thelinuxcommunity.org //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// //
///////////////////////////////////////////////////////////////////////////////////
require "config_inc.php3";
require $inc_dir . "sql_inc.php3";
require $inc_dir . "lib_inc.php3";
require $inc_dir . $user_lib;
$title = "Updating Preferences @ $site_name";
include $inc_dir . "header.php3";
top_bar();
$update_sub = 'update_sub' . $ext;
print("
\n");
print("| Updating Preferences |
\n");
// connect to the server
$db_link = SQL_connect();
$cookie_name = eregi_replace(" ", "_", $site_name);
$cusername = $GLOBALS["$cookie_name-username"];
$cpassword = $GLOBALS["$cookie_name-password"];
$realname = get_user_info_field($row["username"], $user_name_field);
$imgurl = get_user_info_field($row["username"], $image_field);
$admin = get_user_info_field($row["username"], $admin_field);
$email = get_user_info_field($row["username"], $email_field);
$password = get_user_info_field($row["username"], $passwd_field);
if (!check_pw($cpassword, $password)) {
print("| Error: username and password do not match. |
\n");
SQL_close($db_link);
include $inc_dir . "footer.php3";
exit;
}
print("| Username | $cusername |
\n");
print("| Email Address | $new_email |
\n");
if ($new_email != $email) {
if ($new_email == "") {
print("| You must specify an email address. Please click back and try again. |
\n");
SQL_close($db_link);
include $inc_dir . "footer.php3";
exit;
}
$res = change_user_info_field($cusername, $email_field, $new_email);
if ($res > 0) {
print("| Email address updated... |
\n");
}
}
print("| Real Name | $new_real |
\n");
if ($new_real != $real) {
if ($new_real == "") {
print("| You must specify an real name. Please click back and try again. |
\n");
SQL_close($db_link);
include $inc_dir . "footer.php3";
exit;
}
$res = change_user_info_field($cusername, $user_name_field, $new_real);
if ($res > 0) {
print("| Real name updated... |
\n");
}
}
if (($new_pass == $new_pass1) && ($new_pass != "")) {
$len = strlen($new_pass);
$str = "";
for ($i = 0; $i < $len; $i++) {
$str .= "*";
}
print("| New Password | $str |
\n");
$pw_new = make_pw($new_pass);
$res = change_user_info_field($cusername, $passwd_field, $pw_new);
if ($res > 0) {
print("| Password updated... |
\n");
}
}
print("| Personal Image URL | $new_img");
if ($new_img != $imgurl) {
if ($new_img != "") {
print("
");
}
$res = change_user_info_field($cusername, $image_field, $new_img);
if ($res > 0) {
print(" |
| Image URL updated... |
\n");
}
} else if ($new_img != "") {
print("
");
}
print("\n");
print("
");
include $inc_dir . "footer.php3";
?>