member_update.php 가 get_token()(HMAC) 으로 발급한 토큰을 member_update_run.php 가 check_admin_token()(세션) 으로 검증해 항상 불일치 → 오류 HTML 반환으로 AJAX JSON 파싱이 실패하던 문제 수정. sms_admin 의 다른 _run 들과 동일하게 검증측(check_admin_token)은 유지하고, 실행 시 ajax.token.php 로 세션 토큰을 발급받아 본 요청에 사용하도록 변경. check_admin_token 의 1회용 소거 특성상 재실행에도 견고함. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
85 lines
2.8 KiB
PHP
85 lines
2.8 KiB
PHP
<?php
|
|
$sub_menu = "900200";
|
|
include_once("./_common.php");
|
|
|
|
auth_check_menu($auth, $sub_menu, "r");
|
|
|
|
$g5['title'] = "회원정보 업데이트";
|
|
|
|
include_once(G5_ADMIN_PATH.'/admin.head.php');
|
|
?>
|
|
|
|
<div id="sms5_mbup">
|
|
<form name="mb_update_form" id="mb_update_form" action="./member_update_run.php" >
|
|
<div class="local_desc02 local_desc">
|
|
<p>
|
|
새로운 회원정보로 업데이트 합니다.<br>
|
|
실행 후 '완료' 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
|
|
</p>
|
|
</div>
|
|
<div class="local_desc01 local_desc">
|
|
<p>
|
|
마지막 업데이트 일시 : <span id="datetime"><?php echo isset($sms5['cf_datetime']) ? get_sanitize_input($sms5['cf_datetime']) : ''; ?></span> <br>
|
|
</p>
|
|
</div>
|
|
|
|
<div id="res_msg" class="local_desc01 local_desc">
|
|
</div>
|
|
|
|
<div class="btn_fixed_top">
|
|
<input type="submit" value="실행" class="btn_submit btn">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
(function($){
|
|
$( "#mb_update_form" ).submit(function( e ) {
|
|
e.preventDefault();
|
|
$("#res_msg").html('업데이트 중입니다. 잠시만 기다려 주십시오...');
|
|
var action = $(this).attr("action");
|
|
$.ajax({
|
|
url: '<?php echo G5_ADMIN_URL; ?>/ajax.token.php',
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
data: { admin_csrf_token_key: '<?php echo admin_csrf_token_key(1); ?>' },
|
|
success: function(tokenData) {
|
|
if(tokenData.error){
|
|
alert(tokenData.error);
|
|
$("#res_msg").html("");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: action,
|
|
type: 'POST',
|
|
cache:false,
|
|
timeout : 30000,
|
|
dataType:"json",
|
|
data: { mtype : 'json', token : tokenData.token },
|
|
success: function(data) {
|
|
if(data.error){
|
|
alert( data.error );
|
|
$("#res_msg").html("");
|
|
} else {
|
|
$("#datetime").html( data.datetime );
|
|
$("#res_msg").html( data.res_msg );
|
|
}
|
|
},
|
|
error: function (xhr, ajaxOptions, thrownError) {
|
|
alert(xhr.status);
|
|
alert(thrownError);
|
|
}
|
|
});
|
|
},
|
|
error: function (xhr, ajaxOptions, thrownError) {
|
|
alert(xhr.status);
|
|
alert(thrownError);
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
})(jQuery);
|
|
</script>
|
|
|
|
<?php
|
|
include_once(G5_ADMIN_PATH.'/admin.tail.php');
|