Fix fair login for remote commands

This commit is contained in:
james 2009-11-06 02:24:04 +00:00
parent e58ce49aed
commit cb7033f7ae

View File

@ -390,17 +390,13 @@ function handle_award_additional_materials(&$u, &$fair, &$data, &$response)
$response['query'] = $data;
// echo "Authenticating... ";
$username = mysql_escape_string($username);
$q=mysql_query("SELECT uid FROM users WHERE username='$username'");
if(mysql_num_rows($q) != 1) {
$u = user_load_by_email($username);
if($u == false) {
$response['error'] = 1;
$response['message'] = "Authentication Failed";
$response['message'] = "Authentication Failed for $username";
echo json_encode($response);
exit;
}
$i = mysql_fetch_assoc($q);
$u = user_load_by_uid($i['uid']);
$response['i'] = $i;
if(!is_array($u) || $u['password'] == '') {
$response['error'] = 1;
$response['message'] = "Authentication Failed2";