From fd87b6fe45222772a8247a1e9480c5c38ef6e4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Thu, 2 Aug 2018 17:27:18 +0900 Subject: [PATCH] Add: update maestro info, password php --- src/web/module/maestro_section_register.html | 5 +- src/web/module/maestro_setup.html | 259 +++++++++++++++++- src/web/server/maestro/maestro_info.php | 6 +- .../server/maestro/update_maestro_info.php | 31 +++ .../maestro/update_maestro_password.php | 57 ++++ 5 files changed, 338 insertions(+), 20 deletions(-) create mode 100644 src/web/server/maestro/update_maestro_info.php create mode 100644 src/web/server/maestro/update_maestro_password.php diff --git a/src/web/module/maestro_section_register.html b/src/web/module/maestro_section_register.html index 9948f1f..2973d22 100644 --- a/src/web/module/maestro_section_register.html +++ b/src/web/module/maestro_section_register.html @@ -51,8 +51,7 @@ function checkMaestroID() { let message = maestroName + " : 새로 등록할 수 있는 마에스트로 아이디입니다."; showErrorMessage(message, "success"); - $("#id_ckeck_help").text(""); - $("#password").focus(); + // $("#password").focus(); }, (errorMessage, errorCode) => { @@ -83,7 +82,7 @@ function checkData() { showErrorMessage("아이디를 입력해 주세요.", "error"); $("#maestro_name").focus(); return; - }else if(!isAvailableID) { + } else if(!isAvailableID) { onErrorMaestroID("아이디 중복 확인을 해 주세요.", "error"); $("#check_id").focus(); return; diff --git a/src/web/module/maestro_setup.html b/src/web/module/maestro_setup.html index 2477431..91aff0b 100644 --- a/src/web/module/maestro_setup.html +++ b/src/web/module/maestro_setup.html @@ -1,7 +1,193 @@  @@ -10,42 +196,85 @@ function changeMaestroInfo() {
+
+
+
마에스트로 계정 정보 수정
- +
- + 4~20 글자. 영문, 숫자만 사용 가능합니다.
- + + [중복 체크] 버튼을 눌러주세요.
- -
- - 4~16 글자. 영문, 숫자만 사용 가능합니다. -
-
- -
- +
위 내용으로 마에스트로 계정 정보를 변경합니다.
- +
-
+
+ + + +
+
마에스트로 암호 변경
+
+ +
+
+ +
+
+ +
+ + 기존에 사용하던 암호를 입력하세요. +
+
+
+ +
+ +
+
+ +
+ + 4~16 글자. 영문, 숫자만 사용 가능합니다. +
+
+ +
+ +
+ + 위에 입력한 암호를 다시 한 번 정확히 입력하세요. +
+
+ +
위 내용으로 마에스트로 암호를 변경합니다.
+ +
+ +
+ +
+ \ No newline at end of file diff --git a/src/web/server/maestro/maestro_info.php b/src/web/server/maestro/maestro_info.php index 3507ddf..29fea0d 100644 --- a/src/web/server/maestro/maestro_info.php +++ b/src/web/server/maestro/maestro_info.php @@ -15,6 +15,7 @@ if($info === null) { } set_data("name", $info["name"]); +set_data("email", $info["email"]); set_data("accountType", $info["accountType"]); set_data("playerCount", $info["playerCount"]); send_result_success(); @@ -25,19 +26,20 @@ function get_maestro_info($maestroID) { global $db_conn; $query = " - SELECT Name, AccountType, PlayerCount + SELECT Name, Email, AccountType, PlayerCount FROM moty_maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); $stmt->bind_param("s", $maestroID); $stmt->execute(); - $stmt->bind_result($name, $accountType, $playerCount); + $stmt->bind_result($name, $email, $accountType, $playerCount); // while($stmt->fetch()) $stmt->fetch(); $stmt->close(); $info["name"] = $name; + $info["email"] = $email; $info["accountType"] = $accountType; $info["playerCount"] = $playerCount; diff --git a/src/web/server/maestro/update_maestro_info.php b/src/web/server/maestro/update_maestro_info.php new file mode 100644 index 0000000..b0d5478 --- /dev/null +++ b/src/web/server/maestro/update_maestro_info.php @@ -0,0 +1,31 @@ +prepare($query); + $stmt->bind_param("ssi", $maestroName, $email, $maestroID); + $stmt->execute(); +} + +?> \ No newline at end of file diff --git a/src/web/server/maestro/update_maestro_password.php b/src/web/server/maestro/update_maestro_password.php new file mode 100644 index 0000000..38387f3 --- /dev/null +++ b/src/web/server/maestro/update_maestro_password.php @@ -0,0 +1,57 @@ +prepare($query); + $stmt->bind_param("is", $maestro_id, $registeredPW); + $stmt->execute(); + $stmt->bind_result($countResult); + // while($stmt->fetch()) + $stmt->fetch(); + $stmt->close(); + + return $countResult; +} + +function update_maestro_password($maestroID, $newPW) { + global $db_conn; + + $query = " + UPDATE moty_maestro + SET Password = PASSWORD(?) + WHERE MaestroID = ? + "; + $stmt = $db_conn->prepare($query); + $stmt->bind_param("si", $newPW, $maestroID); + $stmt->execute(); +} + +?> \ No newline at end of file