commit daves changes from earlier today

This commit is contained in:
james 2009-05-13 02:25:50 +00:00
parent 86d4e37448
commit a7e2d840bc
2 changed files with 10 additions and 6 deletions

View File

@ -48,7 +48,7 @@ function getJudgingTeams()
while($mr=mysql_fetch_object($mq)) while($mr=mysql_fetch_object($mq))
{ {
$u = user_load($mr->judges_id, true); $u = user_load($mr->judges_id, false);
$judgelangs = join('/', $u['languages']); $judgelangs = join('/', $u['languages']);
$teams[$lastteamid]['members'][]=array( $teams[$lastteamid]['members'][]=array(

View File

@ -78,12 +78,16 @@ if(array_key_exists('username',$_GET)) {
$username = $_GET['username']; $username = $_GET['username'];
$type = $_GET['type']; $type = $_GET['type'];
$un = mysql_escape_string($username); $un = mysql_escape_string($username);
$q = mysql_query("SELECT id,MAX(year),deleted FROM users WHERE username='$un'"); $q = mysql_query("SELECT id,MAX(year),deleted FROM users WHERE username='$un' GROUP BY uid");
echo mysql_error();
if(mysql_num_rows($q)) {
$r = mysql_fetch_object($q); $r = mysql_fetch_object($q);
if($r->deleted == 'no') { if($r->deleted == 'no') {
echo "Username already exists."; echo "Username already exists.";
exit; exit;
} }
}
$u = user_create($type, $username); $u = user_create($type, $username);
$u['email'] = $username; $u['email'] = $username;
user_save($u); user_save($u);