Fix: allow player login after the maestro expired
This commit is contained in:
@@ -40,6 +40,14 @@ if($activateStatus == 0) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$date = new DateTime($maestroInfo["availableActivateDateTime"]);
|
||||||
|
$now = new DateTime();
|
||||||
|
if($maestroInfo["activateStatus"] === 1 && $date < $now) {
|
||||||
|
set_error_message("마에스트로 계정의 유효기간이 지났습니다.\n(만료일 : ".$date->format("Y-m-d").")\n선생님께 문의하세요.");
|
||||||
|
send_result_fail();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$playerInfo = get_login_data($maestroID, $name, $enterCode);
|
$playerInfo = get_login_data($maestroID, $name, $enterCode);
|
||||||
if($playerInfo === NULL) {
|
if($playerInfo === NULL) {
|
||||||
set_error_message("입력한 이름 / 입장번호와 일치하는 계정이 없습니다.");
|
set_error_message("입력한 이름 / 입장번호와 일치하는 계정이 없습니다.");
|
||||||
@@ -65,14 +73,14 @@ function get_maestro_id($maestroName) {
|
|||||||
global $db_conn;
|
global $db_conn;
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT MaestroID, AccountType, ActivateStatus
|
SELECT MaestroID, AccountType, ActivateStatus, AvailableActivateDateTime
|
||||||
FROM maestro
|
FROM maestro
|
||||||
WHERE Name = ?
|
WHERE Name = ?
|
||||||
";
|
";
|
||||||
$stmt = $db_conn->prepare($query);
|
$stmt = $db_conn->prepare($query);
|
||||||
$stmt->bind_param('s', $maestroName);
|
$stmt->bind_param('s', $maestroName);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->bind_result($maestroID, $accountType, $activateStatus);
|
$stmt->bind_result($maestroID, $accountType, $activateStatus, $availableActivateDateTime);
|
||||||
$returnValue = $stmt->fetch();
|
$returnValue = $stmt->fetch();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
|
|
||||||
@@ -82,6 +90,7 @@ function get_maestro_id($maestroName) {
|
|||||||
$result["maestroID"] = $maestroID;
|
$result["maestroID"] = $maestroID;
|
||||||
$result["accountType"] = $accountType;
|
$result["accountType"] = $accountType;
|
||||||
$result["activateStatus"] = $activateStatus;
|
$result["activateStatus"] = $activateStatus;
|
||||||
|
$result["availableActivateDateTime"] = $availableActivateDateTime;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user