2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
2006-10-23 19:33:22 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/team.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2006-10-23 19:33:22 +00:00
|
|
|
db_init();
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
$teamid = post_int("teamid");
|
|
|
|
|
|
|
|
if ($user->teamid == $teamid) {
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2004-11-21 18:56:30 +00:00
|
|
|
$team = lookup_team($teamid);
|
2002-12-16 21:41:41 +00:00
|
|
|
require_founder_login($user, $team);
|
2007-05-18 15:02:02 +00:00
|
|
|
|
2005-05-12 21:33:18 +00:00
|
|
|
$team_url = process_user_text(strip_tags(post_str("url", true)));
|
2003-02-24 21:25:16 +00:00
|
|
|
$x = strstr($team_url, "http://");
|
|
|
|
if ($x) {
|
|
|
|
$team_url = substr($team_url, 7);
|
2002-12-16 21:41:41 +00:00
|
|
|
}
|
2007-05-18 15:02:02 +00:00
|
|
|
$team_name = boinc_htmlentities(process_user_text(strip_tags(post_str("name"))));
|
2005-05-12 21:33:18 +00:00
|
|
|
$team_name_lc = strtolower($team_name);
|
|
|
|
$team_name_html = process_user_text(post_str("name_html", true)); //Do we really not want to
|
2007-06-29 16:11:59 +00:00
|
|
|
$team_description = process_user_text(post_str("description", true)); //scrub out bad HTML tags?
|
2007-05-18 15:02:02 +00:00
|
|
|
$type = process_user_text(post_str("type", true));
|
|
|
|
$country = process_user_text(post_str("country", true));
|
2007-08-26 10:29:08 +00:00
|
|
|
if ($country == "") {
|
|
|
|
$country = "International";
|
|
|
|
}
|
|
|
|
if (!is_valid_country($country)) {
|
|
|
|
error_page("bad country");
|
|
|
|
}
|
2007-05-18 15:02:02 +00:00
|
|
|
|
|
|
|
if (! is_numeric($teamid)) {
|
|
|
|
error_page("Team ID must be numeric.");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strlen($team_name) == 0) { // Should be caught up with the post_str("name"),
|
|
|
|
error_page("Must specify team name"); // but you can never be too safe.
|
|
|
|
}
|
|
|
|
|
2003-02-24 21:25:16 +00:00
|
|
|
$query_team_table = sprintf(
|
|
|
|
"update team set name = '%s',
|
2005-05-12 21:33:18 +00:00
|
|
|
name_lc = '%s',
|
2003-02-24 21:25:16 +00:00
|
|
|
name_html = '%s',
|
|
|
|
url = '%s',
|
|
|
|
description = '%s',
|
2003-03-21 04:38:55 +00:00
|
|
|
type = %d,
|
|
|
|
country='%s'
|
2003-02-24 21:25:16 +00:00
|
|
|
where id = %d",
|
|
|
|
$team_name,
|
2005-05-12 21:33:18 +00:00
|
|
|
$team_name_lc,
|
2003-02-24 21:25:16 +00:00
|
|
|
$team_name_html,
|
|
|
|
$team_url,
|
|
|
|
$team_description,
|
2005-05-12 21:33:18 +00:00
|
|
|
$type,
|
|
|
|
$country,
|
2003-02-24 21:25:16 +00:00
|
|
|
$team->id
|
|
|
|
);
|
2003-03-21 04:38:55 +00:00
|
|
|
$result = mysql_query($query_team_table);
|
|
|
|
if ($result) {
|
|
|
|
Header("Location: team_display.php?teamid=$team->id");
|
2003-02-24 21:25:16 +00:00
|
|
|
} else {
|
2005-05-12 21:33:18 +00:00
|
|
|
error_page("Could not update team - please try later.");
|
2003-02-24 21:25:16 +00:00
|
|
|
}
|
2006-10-23 19:33:22 +00:00
|
|
|
} else {
|
|
|
|
error_page("You need to be the member and the founder of the team to edit team information.");
|
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
?>
|