boinc/html/user/host_venue_action.php

34 lines
776 B
PHP

<?php
require_once("db.inc");
require_once("util.inc");
$authenticator = init_session();
db_init();
$user = get_user_from_auth($authenticator);
require_login($user);
$venue = $_GET["venue"];
$hostid = $_GET["hostid"];
$result = mysql_query("select * from host where id = $hostid");
$host = mysql_fetch_object($result);
mysql_free_result($result);
if (!$host) {
echo "Couldn't find host.";
exit();
}
if ($host->userid != $user->id) {
echo "Not your host\n";
exit();
}
$retval = mysql_query("update host set venue='$venue' where id = $hostid");
if ($retval) {
Header("Location: show_host_detail.php?hostid=$hostid");
} else {
db_error_page();
}
?>