2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("util.inc");
|
|
|
|
require_once("team.inc");
|
|
|
|
require_once("db.inc");
|
|
|
|
|
2002-12-04 19:14:00 +00:00
|
|
|
$authenticator = init_session();
|
2002-08-07 18:56:55 +00:00
|
|
|
db_init();
|
2002-12-04 19:14:00 +00:00
|
|
|
$user = get_user_from_auth($authenticator);
|
2002-12-16 21:41:41 +00:00
|
|
|
$id = $HTTP_POST_VARS["id"];
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2002-12-16 21:41:41 +00:00
|
|
|
$query = "select * from team where id = $id";
|
2002-08-07 18:56:55 +00:00
|
|
|
$result = mysql_query($query);
|
2002-12-16 21:41:41 +00:00
|
|
|
if ($result) {
|
|
|
|
$team = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
require_founder_login($user, $team);
|
|
|
|
|
|
|
|
$team_url = ereg_replace("\"", "'", $HTTP_POST_VARS["url"]);
|
|
|
|
$pos = strpos($team_url, "http://");
|
|
|
|
if (!($pos === false)) { // note: three equal signs
|
|
|
|
$team_url = substr($team_url, 7);
|
|
|
|
}
|
|
|
|
$team_name = ereg_replace("\"", "'", $HTTP_POST_VARS["name"]);
|
|
|
|
$team_name_html = ereg_replace("\"", "'", $HTTP_POST_VARS["name_html"]);
|
|
|
|
$team_description = ereg_replace("\"", "'", $HTTP_POST_VARS["description"]);
|
|
|
|
|
|
|
|
|
2002-08-07 18:56:55 +00:00
|
|
|
$query_team_table = sprintf(
|
|
|
|
"update team set name = '%s',
|
|
|
|
name_html = '%s',
|
|
|
|
url = '%s',
|
|
|
|
description = '%s',
|
|
|
|
type = %d
|
|
|
|
where id = %d",
|
2002-12-16 21:41:41 +00:00
|
|
|
$team_name,
|
|
|
|
$team_name_html,
|
|
|
|
$new_url,
|
|
|
|
$team_description,
|
2002-08-07 18:56:55 +00:00
|
|
|
$HTTP_POST_VARS["type"],
|
|
|
|
$team->id
|
|
|
|
);
|
|
|
|
$result_team_table = mysql_query($query_team_table);
|
|
|
|
if ($result_team_table) {
|
|
|
|
page_head("Changes accepted");
|
|
|
|
$team_name = $team->name;
|
|
|
|
echo "<h2>Changes Accepted</h2>";
|
|
|
|
echo "The changes to <a href=team_display.php?id=$team->id>$team_name</a> were accepted and should now be in effect.";
|
|
|
|
} else {
|
|
|
|
page_head("Error");
|
|
|
|
echo "Couldn't edit team - please try later.\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|