2005-02-25 00:41:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/xml.inc");
|
2005-03-23 19:25:00 +00:00
|
|
|
require_once("../inc/team.inc");
|
2005-02-25 00:41:22 +00:00
|
|
|
|
|
|
|
function reply($x) {
|
|
|
|
echo "<am_set_info_reply>
|
|
|
|
$x
|
|
|
|
</am_set_info_reply>
|
|
|
|
";
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function error($x) {
|
|
|
|
reply("<error>$x</error>");
|
|
|
|
}
|
|
|
|
|
|
|
|
function success($x) {
|
|
|
|
reply("<success/>\n$x");
|
|
|
|
}
|
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
2005-03-28 22:26:22 +00:00
|
|
|
xml_header();
|
|
|
|
|
2005-02-25 00:41:22 +00:00
|
|
|
$auth = process_user_text($_GET["account_key"]);
|
|
|
|
$user = lookup_user_auth($auth);
|
|
|
|
if (!$user) {
|
|
|
|
error("no such user");
|
|
|
|
}
|
|
|
|
|
|
|
|
$name = process_user_text($_GET["name"]);
|
|
|
|
$country = $_GET["country"];
|
|
|
|
if ($country && !is_valid_country($country)) {
|
|
|
|
error("invalid country");
|
|
|
|
}
|
|
|
|
$postal_code = process_user_text($_GET["postal_code"]);
|
|
|
|
$global_prefs = process_user_text($_GET["global_prefs"]);
|
|
|
|
$project_prefs = process_user_text($_GET["project_prefs"]);
|
|
|
|
$url = process_user_text($_GET["url"]);
|
|
|
|
$send_email = process_user_text($_GET["send_email"]);
|
|
|
|
$show_hosts = process_user_text($_GET["show_hosts"]);
|
2005-03-23 19:25:00 +00:00
|
|
|
$teamid = get_int("teamid", true);
|
2005-11-13 06:48:26 +00:00
|
|
|
$venue = process_user_text($_GET["venue"]);
|
2005-02-25 00:41:22 +00:00
|
|
|
|
|
|
|
$query = "";
|
|
|
|
if ($name) {
|
|
|
|
$query .= " name='$name', ";
|
|
|
|
}
|
|
|
|
if ($country) {
|
|
|
|
$query .= " country='$country', ";
|
|
|
|
}
|
|
|
|
if ($postal_code) {
|
|
|
|
$query .= " postal_code='$postal_code', ";
|
|
|
|
}
|
|
|
|
if ($global_prefs) {
|
|
|
|
$query .= " global_prefs='$global_prefs', ";
|
|
|
|
}
|
|
|
|
if ($project_prefs) {
|
|
|
|
$query .= " project_prefs='$project_prefs', ";
|
|
|
|
}
|
|
|
|
if ($url) {
|
|
|
|
$query .= " url='$url', ";
|
|
|
|
}
|
|
|
|
if ($send_email != null) {
|
|
|
|
$query .= " send_email='$send_email', ";
|
|
|
|
}
|
|
|
|
if ($show_hosts != null) {
|
|
|
|
$query .= " show_hosts='$show_hosts', ";
|
|
|
|
}
|
|
|
|
|
2005-03-23 19:25:00 +00:00
|
|
|
if ($teamid) {
|
|
|
|
$team = lookup_team($teamid);
|
|
|
|
if ($team) {
|
|
|
|
user_join_team($team, $user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-13 06:48:26 +00:00
|
|
|
if ($venue) {
|
|
|
|
$query .= " venue='$venue', ";
|
|
|
|
}
|
|
|
|
|
2005-02-25 00:41:22 +00:00
|
|
|
$result = mysql_query("update user set $query seti_id=seti_id where id=$user->id");
|
|
|
|
if ($result) {
|
|
|
|
success("");
|
|
|
|
} else {
|
|
|
|
error("database error");
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|