From a7e2d840bc1018297475c5d4357c51749993aa30 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 13 May 2009 02:25:50 +0000 Subject: [PATCH] commit daves changes from earlier today --- admin/judges.inc.php | 2 +- admin/user_editor_window.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/admin/judges.inc.php b/admin/judges.inc.php index f194ebad..a8866c10 100644 --- a/admin/judges.inc.php +++ b/admin/judges.inc.php @@ -48,7 +48,7 @@ function getJudgingTeams() while($mr=mysql_fetch_object($mq)) { - $u = user_load($mr->judges_id, true); + $u = user_load($mr->judges_id, false); $judgelangs = join('/', $u['languages']); $teams[$lastteamid]['members'][]=array( diff --git a/admin/user_editor_window.php b/admin/user_editor_window.php index 0e4578b8..477ec3af 100644 --- a/admin/user_editor_window.php +++ b/admin/user_editor_window.php @@ -78,11 +78,15 @@ if(array_key_exists('username',$_GET)) { $username = $_GET['username']; $type = $_GET['type']; $un = mysql_escape_string($username); - $q = mysql_query("SELECT id,MAX(year),deleted FROM users WHERE username='$un'"); - $r = mysql_fetch_object($q); - if($r->deleted == 'no') { - echo "Username already exists."; - exit; + $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); + if($r->deleted == 'no') { + echo "Username already exists."; + exit; + } } $u = user_create($type, $username); $u['email'] = $username;