- team import: fix string-escaping bugs

- user web: don't show links to sched logs if they don't exist
- user web: add new team types

svn path=/trunk/boinc/; revision=14295
This commit is contained in:
David Anderson 2007-11-24 04:51:03 +00:00
parent da3671f0de
commit 19267f06e1
4 changed files with 27 additions and 6 deletions

View File

@ -11611,3 +11611,15 @@ David 23 Nov 2007
forum_reply.php
pm.php
sample_index.php
David 23 Nov 2007
- team import: fix string-escaping bugs
- user web: don't show links to sched logs if they don't exist
- user web: add new team types
html/
inc/
host.inc
team_types.inc
ops/
team_import.php

View File

@ -18,7 +18,11 @@ function sched_log_name($x) {
}
function sched_log_link($x) {
if (file_exists("../sched_logs")) {
return "<a href=\"../sched_logs/" . sched_log_name($x) . "\">" . time_str($x) . "</a>";
} else {
return time_str($x);
}
}
function location_form($host) {

View File

@ -8,12 +8,17 @@ $team_types = array(
"Secondary school",
"Junior college",
"University or department",
"Government agency"
"Government agency",
"Non-profit organization",
"National",
"Local/regional",
"Computer type",
"Social/political/religious"
);
function team_type_name($num) {
global $team_types;
if ($num>0 && $num<8) {
if ($num>0 && $num<count($team_types)) {
return $team_types[$num];
}
return "None";

View File

@ -106,7 +106,7 @@ function insert_case($t, $user) {
}
if (!$user) {
echo " making user $t->user_email\n";
$user = make_user($t->user_email, $t->user_name, random_string());
$user = make_user(mysql_real_escape_string($t->user_email), mysql_real_escape_string($t->user_name), random_string());
if (!$user) {
echo " Can't make user $t->user_email\n";
echo mysql_error();
@ -176,8 +176,8 @@ function handle_team($f) {
}
echo "Processing $t->name $t->user_email\n";
$user = lookup_user_email_addr($t->user_email);
$team = lookup_team_name($t->name);
$user = lookup_user_email_addr(mysql_real_escape_string($t->user_email));
$team = lookup_team_name(mysql_real_escape_string($t->name));
if ($team) {
if (!$user) {
echo " team exists but user $t->user_email doesn't\n";