2005-08-11 00:17:00 +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/>.
|
2005-08-11 00:17:00 +00:00
|
|
|
|
2007-12-12 04:52:30 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/email.inc");
|
2005-08-11 00:17:00 +00:00
|
|
|
|
2008-06-11 19:36:10 +00:00
|
|
|
$auth = post_str("auth");
|
|
|
|
$name = post_str("name");
|
2007-10-30 18:16:29 +00:00
|
|
|
|
2005-08-11 00:17:00 +00:00
|
|
|
if (strlen($name)==0) {
|
2007-12-12 04:52:30 +00:00
|
|
|
error_page("You must supply a name for your account");
|
2005-08-11 00:17:00 +00:00
|
|
|
}
|
|
|
|
if ($new_name != strip_tags($new_name)) {
|
2007-12-12 04:52:30 +00:00
|
|
|
error_page("HTML tags not allowed in name");
|
2005-08-11 00:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$country = post_str("country");
|
|
|
|
if (!is_valid_country($country)) {
|
2007-12-12 04:52:30 +00:00
|
|
|
error_page( "invalid country");
|
2005-08-11 00:17:00 +00:00
|
|
|
}
|
2008-12-14 22:18:49 +00:00
|
|
|
$country = BoincDb::escape_string($country);
|
|
|
|
$postal_code = BoincDb::escape_string(strip_tags(post_str("postal_code", true)));
|
|
|
|
$auth = BoincDb::escape_string($auth);
|
2005-08-11 00:17:00 +00:00
|
|
|
|
2008-12-14 22:18:49 +00:00
|
|
|
$name = BoincDb::escape_string($name);
|
|
|
|
$postal_code = BoincDb::escape_string($postal_code);
|
2005-08-11 00:17:00 +00:00
|
|
|
|
2007-10-30 18:16:29 +00:00
|
|
|
$user = BoincUser::lookup("authenticator='$auth'");
|
|
|
|
if (!$user) {
|
|
|
|
error_page("no such user");
|
|
|
|
}
|
|
|
|
$retval = $user->update("name='$name', country='$country', postal_code='$postal_code'");
|
2005-08-11 00:17:00 +00:00
|
|
|
if (!$retval) {
|
2007-12-12 04:52:30 +00:00
|
|
|
error_page("database error");
|
2005-08-11 00:17:00 +00:00
|
|
|
}
|
|
|
|
|
2010-03-30 20:58:39 +00:00
|
|
|
// team may have already been joined in create_account RPC.
|
|
|
|
// if so, skip team-finder
|
|
|
|
//
|
|
|
|
if ($user->teamid) {
|
|
|
|
Header("Location: home.php");
|
|
|
|
} else {
|
|
|
|
Header("Location: team_search.php");
|
|
|
|
}
|
2008-02-13 19:02:44 +00:00
|
|
|
send_cookie('auth', $auth, true);
|
|
|
|
send_cookie('init', "1", true);
|
2005-08-11 00:17:00 +00:00
|
|
|
?>
|