Fix a typo
This commit is contained in:
parent
ad4b7fc4e7
commit
a0f0e95043
6 changed files with 118 additions and 37 deletions
|
@ -14,6 +14,15 @@ $password = $js["password"];
|
|||
// Compare against hash in database + : md5(salt)
|
||||
$DB = get_DB();
|
||||
|
||||
$id = NULLKEY;
|
||||
$first = "";
|
||||
$last = "";
|
||||
$rezday = 0;
|
||||
$title = "";
|
||||
$login = false;
|
||||
$reason = "Invalid password";
|
||||
$active = false;
|
||||
|
||||
$clientKey = $js['clientKey'];
|
||||
if($clientKey == CLIENTPSK) {
|
||||
// PSK Matches, authorized application
|
||||
|
@ -32,14 +41,6 @@ if($clientKey == CLIENTPSK) {
|
|||
reason: map['reason'] as String,
|
||||
user: User.parseJson(json.encode(map['user'])));
|
||||
*/
|
||||
$id = NULLKEY;
|
||||
$first = "";
|
||||
$last = "";
|
||||
$rezday = 0;
|
||||
$title = "";
|
||||
$login = false;
|
||||
$reason = "Invalid password";
|
||||
$active = false;
|
||||
|
||||
if($res->num_rows > 0) {
|
||||
$row = $res->fetch_assoc();
|
||||
|
@ -64,27 +65,21 @@ if($clientKey == CLIENTPSK) {
|
|||
$reason = "No such user";
|
||||
}
|
||||
|
||||
die(json_encode(
|
||||
array(
|
||||
"login" => $login,
|
||||
"reason" => $reason,
|
||||
"type" => "S2CLoginResponse",
|
||||
"user" => array(
|
||||
"id" => $id,
|
||||
"first" => $first,
|
||||
"last" => $last,
|
||||
"title" => $title,
|
||||
"rez" => $rezday,
|
||||
"active" => $active
|
||||
)
|
||||
)
|
||||
));
|
||||
} else {
|
||||
die(json_encode(array(
|
||||
"login" => false,
|
||||
"reason" => "Unauthorized",
|
||||
"type" => "S2CLoginResponse"
|
||||
)));
|
||||
}
|
||||
|
||||
die(json_encode(
|
||||
array(
|
||||
"login" => $login,
|
||||
"reason" => $reason,
|
||||
"type" => "S2CLoginResponse",
|
||||
"user" => array(
|
||||
"id" => $id,
|
||||
"first" => $first,
|
||||
"last" => $last,
|
||||
"title" => $title,
|
||||
"rez" => $rezday,
|
||||
"active" => $active
|
||||
)
|
||||
)
|
||||
));
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue