2003-02-21 01:38:16 +00:00
|
|
|
<?php
|
|
|
|
|
2007-11-12 22:28:17 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2005-02-13 06:13:33 +00:00
|
|
|
require_once("../inc/user.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/countries.inc");
|
2003-02-21 01:38:16 +00:00
|
|
|
|
2005-02-13 06:13:33 +00:00
|
|
|
$user = get_logged_in_user();
|
2003-02-21 01:38:16 +00:00
|
|
|
|
2007-05-18 15:02:02 +00:00
|
|
|
$name = boinc_htmlentities(process_user_text(post_str("user_name")));
|
2005-05-07 06:41:27 +00:00
|
|
|
if ($name != strip_tags($name)) {
|
|
|
|
error_page("HTML tags not allowed in name");
|
|
|
|
}
|
|
|
|
if (strlen($name) == 0) {
|
|
|
|
error_page("You must supply a name for your account.");
|
|
|
|
}
|
2005-05-13 19:14:48 +00:00
|
|
|
$url = process_user_text(post_str("url", true));
|
2005-02-26 06:23:32 +00:00
|
|
|
$url = strip_tags($url);
|
2005-02-13 06:13:33 +00:00
|
|
|
$country = post_str("country");
|
2007-08-26 10:29:08 +00:00
|
|
|
if ($country == "") {
|
|
|
|
$country = "International";
|
|
|
|
}
|
2005-02-13 06:13:33 +00:00
|
|
|
if (!is_valid_country($country)) {
|
2005-02-22 19:37:55 +00:00
|
|
|
error_page("bad country");
|
2005-02-13 06:13:33 +00:00
|
|
|
}
|
2005-05-13 19:14:48 +00:00
|
|
|
$postal_code = process_user_text(post_str("postal_code",true));
|
2005-02-22 19:37:55 +00:00
|
|
|
$postal_code = strip_tags($postal_code);
|
2005-02-13 06:13:33 +00:00
|
|
|
|
2007-11-12 22:28:17 +00:00
|
|
|
$result = $user->update("name='$name', url='$url', country='$country', postal_code='$postal_code'");
|
2005-02-13 06:13:33 +00:00
|
|
|
if ($result) {
|
|
|
|
Header("Location: home.php");
|
|
|
|
} else {
|
2005-05-07 06:41:27 +00:00
|
|
|
error_page("Couldn't update user info.");
|
2005-02-13 06:13:33 +00:00
|
|
|
}
|
2003-02-21 01:38:16 +00:00
|
|
|
|
|
|
|
?>
|