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;
|
$response['query'] = $data;
|
||||||
|
|
||||||
// echo "Authenticating... ";
|
// echo "Authenticating... ";
|
||||||
$username = mysql_escape_string($username);
|
$u = user_load_by_email($username);
|
||||||
$q=mysql_query("SELECT uid FROM users WHERE username='$username'");
|
if($u == false) {
|
||||||
if(mysql_num_rows($q) != 1) {
|
|
||||||
$response['error'] = 1;
|
$response['error'] = 1;
|
||||||
$response['message'] = "Authentication Failed";
|
$response['message'] = "Authentication Failed for $username";
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$i = mysql_fetch_assoc($q);
|
|
||||||
$u = user_load_by_uid($i['uid']);
|
|
||||||
$response['i'] = $i;
|
|
||||||
if(!is_array($u) || $u['password'] == '') {
|
if(!is_array($u) || $u['password'] == '') {
|
||||||
$response['error'] = 1;
|
$response['error'] = 1;
|
||||||
$response['message'] = "Authentication Failed2";
|
$response['message'] = "Authentication Failed2";
|
||||||
|
Loading…
Reference in New Issue
Block a user