Fix: client login.php

This commit is contained in:
2018-08-23 12:32:55 +09:00
parent 6fcb459550
commit 74525d79fb
2 changed files with 16 additions and 14 deletions
+2 -2
View File
@@ -119,8 +119,8 @@ class Login {
// show retry message // show retry message
console.log('login failed, jsonData : ' + JSON.stringify(jsonData)); console.log('login failed, jsonData : ' + JSON.stringify(jsonData));
if(jsonData["ERROR"] !== null) { if(jsonData["error"] !== null) {
self.infoText.text = jsonData["ERROR"]; self.infoText.text = jsonData["error"];
} }
} }
+14 -12
View File
@@ -10,9 +10,9 @@ $enterCode = $_POST["enter_code"];
$maestroInfo = get_maestro_id($maestroName); $maestroInfo = get_maestro_id($maestroName);
if($maestroInfo === null) { if($maestroInfo === NULL) {
send_error_message($replyJSON, "입력한 마에스트로 계정이 없습니다"); set_error_message("입력한 마에스트로 계정이 없습니다");
$db_conn->close(); send_result_fail();
exit; exit;
} }
@@ -20,9 +20,9 @@ $maestroID = $maestroInfo["maestroID"];
$maestroAccountType = $maestroInfo["accountType"]; $maestroAccountType = $maestroInfo["accountType"];
$playerInfo = get_login_data($maestroID, $name, $enterCode); $playerInfo = get_login_data($maestroID, $name, $enterCode);
if($playerInfo === null) { if($playerInfo === NULL) {
send_error_message($replyJSON, "입력한 이름/입장번호와 일치하는 계정이 없습니다"); set_error_message("입력한 이름/입장번호와 일치하는 계정이 없습니다");
$db_conn->close(); send_result_fail();
exit; exit;
} }
@@ -51,12 +51,12 @@ function get_maestro_id($maestroName) {
$stmt->bind_param('s', $maestroName); $stmt->bind_param('s', $maestroName);
$stmt->execute(); $stmt->execute();
$stmt->bind_result($maestroID, $accountType); $stmt->bind_result($maestroID, $accountType);
// while($stmt->fetch()) { $returnValue = $stmt->fetch();
// ;
// }
$stmt->fetch();
$stmt->close(); $stmt->close();
if($returnValue === NULL || $returnValue === FALSE)
return NULL;
$result["maestroID"] = $maestroID; $result["maestroID"] = $maestroID;
$result["accountType"] = $accountType; $result["accountType"] = $accountType;
return $result; return $result;
@@ -74,10 +74,12 @@ function get_login_data($maestroID, $name, $enterCode) {
$stmt->bind_param('iss', $maestroID, $name, $enterCode); $stmt->bind_param('iss', $maestroID, $name, $enterCode);
$stmt->execute(); $stmt->execute();
$stmt->bind_result($playerID, $accountType); $stmt->bind_result($playerID, $accountType);
// while($stmt->fetch()) $returnValue = $stmt->fetch();
$stmt->fetch();
$stmt->close(); $stmt->close();
if($returnValue === NULL || $returnValue === FALSE)
return NULL;
$result["playerID"] = $playerID; $result["playerID"] = $playerID;
$result["accountType"] = $accountType; $result["accountType"] = $accountType;
return $result; return $result;