forked from science-ation/science-ation
Fix fair login for remote commands
This commit is contained in:
parent
e58ce49aed
commit
cb7033f7ae
10
remote.php
10
remote.php
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user