diff --git a/src/web/js/lib/maestro_info.js b/src/web/js/lib/maestro_info.js index 11ec986..e4d18d8 100644 --- a/src/web/js/lib/maestro_info.js +++ b/src/web/js/lib/maestro_info.js @@ -31,6 +31,7 @@ class MaestroInfo { getMaxPlayerCount() { switch(this.accountType) { + case 0: case 1: return 20; case 2: diff --git a/src/web/module/maestro_setup.html b/src/web/module/maestro_setup.html index 91aff0b..4cf272f 100644 --- a/src/web/module/maestro_setup.html +++ b/src/web/module/maestro_setup.html @@ -5,7 +5,7 @@ let isAvailableIDName = false; let registeredMaestroIDName = ""; let registeredEmail = ""; let registeredPassword = ""; - +let registeredAccountType = -1; let newMaestroIDName = ""; let newEmail = ""; @@ -34,6 +34,8 @@ function loadMaestroInfo(maestroID) { registeredEmail = jsonData.email; $("#email").val(registeredEmail); + + registeredAccountType = jsonData.accountType; }, (errorMessage, errorCode) => { @@ -85,6 +87,11 @@ function checkMaestroIDName() { } function changeMaestroInfo() { + if(registeredAccountType === 0) { + showErrorMessage("체험 계정은 정보 수정이 불가능합니다.", "error"); + return; + } + newMaestroIDName = $("#maestro_id").val(); if(newMaestroIDName.length === 0) { showErrorMessage("변경할 아이디를 입력해 주세요.", "error"); @@ -130,6 +137,14 @@ function changeMaestroInfo() { } function checkPassword() { + if(registeredAccountType === 0) { + showErrorMessage("체험 계정은 암호 수정이 불가능합니다.", "error"); + $('html, body').animate({ + scrollTop: $("#message_box").offset().top + 'px' + }, 'fast'); + return; + } + registeredPassword = $("#prev_password").val(); if(registeredPassword.length === 0) { showErrorMessage("현재 암호를 입력해 주세요.", "error"); diff --git a/src/web/module/maestro_upgrade.html b/src/web/module/maestro_upgrade.html index 2aab23e..0ed9c21 100644 --- a/src/web/module/maestro_upgrade.html +++ b/src/web/module/maestro_upgrade.html @@ -28,6 +28,23 @@ function loadMaestroInfo(maestroID) { function updateCards(accountType) { console.log(accountType); switch(accountType) { + case 0: + $("#account_type_1").addClass("border-warning"); + $("#account_type_1_btn").addClass("btn-secondary disabled"); + $("#account_type_1_footer").addClass("text-danger"); + $("#account_type_1_footer").text("체험 계정은 업그레이드가 불가능합니다."); + + $("#account_type_2").addClass("border-warning"); + $("#account_type_2_btn").addClass("btn-secondary disabled"); + $("#account_type_2_footer").addClass("text-danger"); + $("#account_type_2_footer").text("체험 계정은 업그레이드가 불가능합니다."); + + $("#account_type_3").addClass("border-warning"); + $("#account_type_3_btn").addClass("btn-secondary disabled"); + $("#account_type_3_footer").addClass("text-danger"); + $("#account_type_3_footer").text("체험 계정은 업그레이드가 불가능합니다."); + break; + case 1: $("#account_type_1").addClass("border-warning"); $("#account_type_1_btn").addClass("btn-secondary disabled"); diff --git a/src/web/server/maestro/maestro_experience_account.php b/src/web/server/maestro/maestro_experience_account.php index abc3ba7..2ac9a4a 100644 --- a/src/web/server/maestro/maestro_experience_account.php +++ b/src/web/server/maestro/maestro_experience_account.php @@ -5,7 +5,7 @@ include "./../lib/send_reply_json.php"; include "./../setup/connect_db.php"; -$maestro_experience_id = get_maestro_experience_id("test"); +$maestro_experience_id = get_maestro_experience_id(); if($maestro_experience_id === null) { set_error_message("등록된 마에스트로 관리자 계정이 없습니다."); send_result_fail(); @@ -33,16 +33,16 @@ send_result_success(); exit; -function get_maestro_experience_id($maestro_name) { +function get_maestro_experience_id() { global $db_conn; $query = " SELECT MaestroID FROM moty_maestro - WHERE Name = ? + WHERE AccountType = 0 "; $stmt = $db_conn->prepare($query); - $stmt->bind_param("s", $maestro_name); + // $stmt->bind_param("s", $maestro_name); $stmt->execute(); $stmt->bind_result($maestro_experience_id); // while($stmt->fetch()) {