2003-02-21 01:38:16 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC 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 Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2003-02-21 01:38:16 +00:00
|
|
|
|
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
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("tnow", "ttok"));
|
|
|
|
|
2005-02-13 06:13:33 +00:00
|
|
|
$user = get_logged_in_user();
|
2008-10-17 16:40:15 +00:00
|
|
|
check_tokens($user->authenticator);
|
2003-02-21 01:38:16 +00:00
|
|
|
|
2010-02-18 22:33:26 +00:00
|
|
|
$name = post_str("user_name");
|
2011-08-25 22:12:48 +00:00
|
|
|
if ($name != sanitize_tags($name)) {
|
2010-02-13 22:52:55 +00:00
|
|
|
error_page(tra("HTML tags are not allowed in your name."));
|
2005-05-07 06:41:27 +00:00
|
|
|
}
|
|
|
|
if (strlen($name) == 0) {
|
2010-02-18 22:33:26 +00:00
|
|
|
error_page(tra("You must supply a name for your account."));
|
2005-05-07 06:41:27 +00:00
|
|
|
}
|
2008-06-11 19:36:10 +00:00
|
|
|
$url = post_str("url", true);
|
2011-08-25 22:12:48 +00:00
|
|
|
$url = sanitize_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)) {
|
2011-08-25 22:12:48 +00:00
|
|
|
error_page("bad country");
|
2005-02-13 06:13:33 +00:00
|
|
|
}
|
2008-12-14 22:18:49 +00:00
|
|
|
$country = BoincDb::escape_string($country);
|
2011-08-25 22:12:48 +00:00
|
|
|
$postal_code = sanitize_tags(post_str("postal_code", true));
|
2005-02-13 06:13:33 +00:00
|
|
|
|
2008-12-14 22:18:49 +00:00
|
|
|
$name = BoincDb::escape_string($name);
|
|
|
|
$url = BoincDb::escape_string($url);
|
|
|
|
$postal_code = BoincDb::escape_string($postal_code);
|
2008-06-11 19:36:10 +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 {
|
2010-02-13 22:52:55 +00:00
|
|
|
error_page(tra("Couldn't update user info."));
|
2005-02-13 06:13:33 +00:00
|
|
|
}
|
2003-02-21 01:38:16 +00:00
|
|
|
|
|
|
|
?>
|