diff --git a/checkin_notes b/checkin_notes
index c1c7d44fce..6c60a3b722 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -25041,3 +25041,9 @@ David 18 Feb 2005
client/
app_start.C
+
+David 19 Feb 2005
+ - user web cleanup (GET arg checking mostly)
+
+ html/user/
+ (various files)
diff --git a/html/user/host_delete.php b/html/user/host_delete.php
index 74385454f6..9bb4c0e78b 100644
--- a/html/user/host_delete.php
+++ b/html/user/host_delete.php
@@ -1,7 +1,8 @@
Return to list of your computers
- ";
- page_tail();
+$hostid = get_int("hostid");
+$host = get_host($hostid, $user);
+if (host_nresults($host)==0) {
+ mysql_query("delete from host where id=$hostid");
+} else {
+ fail("existing results");
+}
+echo "
+ Host deleted.
+
Return to list of your computers
+";
+page_tail();
?>
diff --git a/html/user/host_update_credit.php b/html/user/host_update_credit.php
index 38dd22b0ec..b46df9a63a 100644
--- a/html/user/host_update_credit.php
+++ b/html/user/host_update_credit.php
@@ -1,7 +1,8 @@
Host credit updated";
- page_tail();
+$hostid = get_int("hostid");
+host_update_credit($hostid);
+echo "
Host credit updated";
+page_tail();
?>
diff --git a/html/user/results.php b/html/user/results.php
index f002301446..b506c4d586 100644
--- a/html/user/results.php
+++ b/html/user/results.php
@@ -1,57 +1,56 @@
id) {
- echo "No access";
- exit();
- }
- $type = "user";
- $clause = "userid=$userid";
- }
- page_head("Results for $type");
- result_table_start(true, false, true);
- $i = 0;
- $query = "select * from result where $clause order by id desc limit $offset,".($results_per_page+1);
- $result = mysql_query($query);
- $number_of_results = mysql_affected_rows();
- while ($res = mysql_fetch_object($result) and $i<$results_per_page) {
- show_result_row($res, true, false, true);
- $i++;
- }
- mysql_free_result($result);
- echo "\n";
-
- if ($number_of_results > $results_per_page) {
- $offset = $offset+$results_per_page;
- echo "
-
Next $results_per_page results
- ";
- }
+require_once("../inc/db.inc");
+require_once("../inc/util.inc");
+require_once("../inc/result.inc");
+$config = get_config();
+if (!parse_bool($config, "show_results")) {
+ page_head("Temporarily disabled");
page_tail();
+ exit();
+}
+
+$results_per_page = 20;
+
+db_init();
+$hostid = get_int("hostid", true);
+$userid = get_int("userid", true);
+$offset = get_int("offset", true);
+if (!$offset) $offset=0;
+
+if ($hostid) {
+ $host = lookup_host($hostid);
+ $type = "computer";
+ $clause = "hostid=$hostid";
+} else {
+ $user = get_logged_in_user();
+ if ($userid != $user->id) {
+ error_page("No access");
+ }
+ $type = "user";
+ $clause = "userid=$userid";
+}
+page_head("Results for $type");
+result_table_start(true, false, true);
+$i = 0;
+$query = "select * from result where $clause order by id desc limit $offset,".($results_per_page+1);
+$result = mysql_query($query);
+$number_of_results = mysql_affected_rows();
+while ($res = mysql_fetch_object($result) and $i<$results_per_page) {
+ show_result_row($res, true, false, true);
+ $i++;
+}
+mysql_free_result($result);
+echo "\n";
+
+if ($number_of_results > $results_per_page) {
+ $offset = $offset+$results_per_page;
+ echo "
+
Next $results_per_page results
+ ";
+}
+
+page_tail();
?>
diff --git a/html/user/sample_robots.txt b/html/user/sample_robots.txt
index 16d036caa7..56e044d07d 100644
--- a/html/user/sample_robots.txt
+++ b/html/user/sample_robots.txt
@@ -1,8 +1,11 @@
User-agent: *
-Allow: /download_network.php
-Allow: /index.php
-Allow: /info.php
-Allow: /intro.php
-Allow: /old_news.php
-Allow: /rss_main.php
-Disallow: /
+Disallow: /account
+Disallow: /add_venue
+Disallow: /am_
+Disallow: /bug_report
+Disallow: /edit_
+Disallow: /host_
+Disallow: /prefs_
+Disallow: /result
+Disallow: /team
+Disallow: /workunit
diff --git a/html/user/show_host_detail.php b/html/user/show_host_detail.php
index 7c9f236f0c..457d1e88ba 100644
--- a/html/user/show_host_detail.php
+++ b/html/user/show_host_detail.php
@@ -1,24 +1,26 @@
id == $host->userid) {
- $private = true;
- }
+require_once("../inc/db.inc");
+require_once("../inc/util.inc");
+require_once("../inc/user.inc");
+require_once("../inc/host.inc");
+
+db_init();
+$hostid = get_int("hostid");
+$ipprivate = $_GET["ipprivate"];
+$host = lookup_host($hostid);
+if (!$host) {
+ echo "Couldn't find computer";
+ exit();
+}
+$private = false;
+$user = get_logged_in_user(false);
+if ($user && $user->id == $host->userid) {
+ $private = true;
+}
+
+page_head("Computer summary");
+show_host($host, $private, $ipprivate);
+page_tail();
- page_head("Computer summary");
- show_host($host, $private, $ipprivate);
- page_tail();
?>
diff --git a/html/user/team_edit_form.php b/html/user/team_edit_form.php
index c5f7012b18..778d772df8 100644
--- a/html/user/team_edit_form.php
+++ b/html/user/team_edit_form.php
@@ -4,19 +4,20 @@ require_once("../inc/db.inc");
require_once("../inc/util.inc");
require_once("../inc/team.inc");
- db_init();
- $user = get_logged_in_user();
+db_init();
+$user = get_logged_in_user();
- $teamid = $_GET["teamid"];
- $team = lookup_team($teamid);
- require_founder_login($user, $team);
+$teamid get_int("teamid");
+$team = lookup_team($teamid);
+require_founder_login($user, $team);
+
+$team_name = ereg_replace("\"", "'", $team->name);
+$team_name_html = ereg_replace("\"", "'", $team->name_html);
+$team_url = ereg_replace("\"", "'", $team->url);
+$team_description = ereg_replace("\"", "'", $team->description);
+$team_type = $team->type;
+page_head("Edit $team_name");
+team_edit_form($team, "Update team info", "team_edit_action.php");
+page_tail();
- $team_name = ereg_replace("\"", "'", $team->name);
- $team_name_html = ereg_replace("\"", "'", $team->name_html);
- $team_url = ereg_replace("\"", "'", $team->url);
- $team_description = ereg_replace("\"", "'", $team->description);
- $team_type = $team->type;
- page_head("Edit $team_name");
- team_edit_form($team, "Update team info", "team_edit_action.php");
- page_tail();
?>
diff --git a/html/user/team_email_list.php b/html/user/team_email_list.php
index b5d61530b6..82585e100d 100644
--- a/html/user/team_email_list.php
+++ b/html/user/team_email_list.php
@@ -5,27 +5,27 @@ require_once("../inc/util.inc");
require_once("../inc/email.inc");
require_once("../inc/team.inc");
- db_init();
+db_init();
- $user = get_logged_in_user();
- $teamid = $_GET["teamid"];
- $team = lookup_team($teamid);
- require_founder_login($user, $team);
+$user = get_logged_in_user();
+$teamid = get_int("teamid");
+$team = lookup_team($teamid);
+require_founder_login($user, $team);
- page_head("$team->name Email List");
- start_table();
- row1("Member list of $team->name");
- row2_plain("Name", "Email address");
- $result = mysql_query("select * from user where teamid=$team->id");
- while ($user = mysql_fetch_object($result)) {
- if (!split_munged_email_addr($user->email_addr, null, $email)) {
- $email = $user->email_addr;
- }
- row2_plain($user->name, $email);
- }
- mysql_free_result($result);
- end_table();
+page_head("$team->name Email List");
+start_table();
+row1("Member list of $team->name");
+row2_plain("Name", "Email address");
+$result = mysql_query("select * from user where teamid=$team->id");
+while ($user = mysql_fetch_object($result)) {
+ if (!split_munged_email_addr($user->email_addr, null, $email)) {
+ $email = $user->email_addr;
+ }
+ row2_plain($user->name, $email);
+}
+mysql_free_result($result);
+end_table();
- page_tail();
+page_tail();
?>
diff --git a/html/user/team_join_form.php b/html/user/team_join_form.php
index 3d972a8f71..dfd6bb7511 100644
--- a/html/user/team_join_form.php
+++ b/html/user/team_join_form.php
@@ -4,24 +4,24 @@ require_once("../inc/db.inc");
require_once("../inc/util.inc");
require_once("../inc/team.inc");
- db_init();
- $user = get_logged_in_user();
- $teamid = $_GET["id"];
+db_init();
+$user = get_logged_in_user();
+$teamid = get_int("id");
- $team = lookup_team($teamid);
- $team_name = $team->name;
- page_head("Join $team_name");
- echo " Please note:
-
- - Joining a team gives its founder access to your email address.
-
- Joining a team does not affect your account's credit.
-
-
-
- ";
- page_tail();
+$team = lookup_team($teamid);
+$team_name = $team->name;
+page_head("Join $team_name");
+echo " Please note:
+
+ - Joining a team gives its founder access to your email address.
+
- Joining a team does not affect your account's credit.
+
+
+
+";
+page_tail();
?>
diff --git a/html/user/team_remove_inactive_form.php b/html/user/team_remove_inactive_form.php
index 6eb9a2c575..b931a04918 100644
--- a/html/user/team_remove_inactive_form.php
+++ b/html/user/team_remove_inactive_form.php
@@ -1,51 +1,51 @@
nusers;
- page_head("Remove Members from $team->name");
- echo "
- Removing a member will subtract their credit from team totals
-