190 lines
8.8 KiB
PHP
190 lines
8.8 KiB
PHP
<?php
|
|
include_once('./_common.php');
|
|
//include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
|
|
//include_once(G5_LIB_PATH.'/register.lib.php');
|
|
//include_once(G5_LIB_PATH.'/mailer.lib.php');
|
|
//include_once(G5_LIB_PATH.'/thumbnail.lib.php');
|
|
include_once(G5_SKIN_PATH.'/main.skin.php');
|
|
|
|
// 리퍼러 체크
|
|
referer_check();
|
|
|
|
|
|
if (!($w == '' || $w == 'u')) {
|
|
alert('w 값이 제대로 넘어오지 않았습니다.');
|
|
}
|
|
|
|
if ($w == 'u' && $is_admin == 'super') {
|
|
if (file_exists(G5_PATH.'/DEMO'))
|
|
alert('데모 화면에서는 하실(보실) 수 없는 작업입니다.');
|
|
}
|
|
|
|
// if (run_replace('register_member_chk_captcha', !chk_captcha(), $w)) {
|
|
// alert('자동등록방지 숫자가 틀렸습니다.');
|
|
// }
|
|
|
|
if($w == 'u')
|
|
$mb_id = isset($_SESSION['ss_mb_id']) ? trim($_SESSION['ss_mb_id']) : '';
|
|
else if($w == '')
|
|
$mb_id = isset($_POST['mb_id']) ? trim($_POST['mb_id']) : '';
|
|
else
|
|
alert('잘못된 접근입니다', G5_URL);
|
|
|
|
if(!$mb_id)
|
|
alert('회원아이디 값이 없습니다. 올바른 방법으로 이용해 주십시오.');
|
|
|
|
|
|
$mb_id = escape_trim($_POST['mb_id']);
|
|
$mb_password = escape_trim($_POST['mb_password']);
|
|
$mb_password_re = escape_trim($_POST['mb_password_re']);
|
|
$mb_name = escape_trim($_POST['mb_name']);
|
|
$mb_nick = $mb_name;
|
|
$mb_email1 = escape_trim($_POST['mb_email1']);
|
|
$mb_email2 = escape_trim($_POST['mb_email2']);
|
|
$mb_email = $mb_email1.$mb_email2;
|
|
|
|
//$mb_password = isset($_POST['mb_password']) ? trim($_POST['mb_password']) : '';
|
|
// $mb_password_re = isset($_POST['mb_password_re']) ? trim($_POST['mb_password_re']) : '';
|
|
// $mb_name = isset($_POST['mb_name']) ? trim($_POST['mb_name']) : '';
|
|
// $mb_nick = isset($_POST['mb_nick']) ? trim($_POST['mb_nick']) : '';
|
|
// $mb_email = isset($_POST['mb_email']) ? trim($_POST['mb_email']) : '';
|
|
$mb_sex = isset($_POST['mb_sex']) ? trim($_POST['mb_sex']) : "";
|
|
$mb_birth = isset($_POST['mb_birth']) ? trim($_POST['mb_birth']) : "";
|
|
$mb_homepage = isset($_POST['mb_homepage']) ? trim($_POST['mb_homepage']) : "";
|
|
$mb_tel = isset($_POST['mb_tel']) ? trim($_POST['mb_tel']) : "";
|
|
$mb_hp = isset($_POST['mb_hp']) ? trim($_POST['mb_hp']) : "";
|
|
$mb_zip1 = isset($_POST['mb_zip']) ? substr(trim($_POST['mb_zip']), 0, 3) : "";
|
|
$mb_zip2 = isset($_POST['mb_zip']) ? substr(trim($_POST['mb_zip']), 3) : "";
|
|
$mb_addr1 = isset($_POST['mb_addr1']) ? trim($_POST['mb_addr1']) : "";
|
|
$mb_addr2 = isset($_POST['mb_addr2']) ? trim($_POST['mb_addr2']) : "";
|
|
$mb_addr3 = isset($_POST['mb_addr3']) ? trim($_POST['mb_addr3']) : "";
|
|
$mb_addr_jibeon = isset($_POST['mb_addr_jibeon']) ? trim($_POST['mb_addr_jibeon']) : "";
|
|
$mb_signature = isset($_POST['mb_signature']) ? trim($_POST['mb_signature']) : "";
|
|
$mb_profile = isset($_POST['mb_profile']) ? trim($_POST['mb_profile']) : "";
|
|
$mb_recommend = isset($_POST['mb_recommend']) ? trim($_POST['mb_recommend']) : "";
|
|
$mb_mailling = isset($_POST['mb_mailling']) ? trim($_POST['mb_mailling']) : "";
|
|
$mb_sms = isset($_POST['mb_sms']) ? trim($_POST['mb_sms']) : "";
|
|
$mb_open = isset($_POST['mb_open']) ? trim($_POST['mb_open']) : "0";
|
|
$mb_1 = isset($_POST['mb_comp']) ? trim($_POST['mb_comp']) : "";
|
|
$mb_2 = isset($_POST['mb_comp_team']) ? trim($_POST['mb_comp_team']) : "";
|
|
$mb_3 = isset($_POST['mb_3']) ? trim($_POST['mb_3']) : "";
|
|
$mb_4 = isset($_POST['mb_4']) ? trim($_POST['mb_4']) : "";
|
|
$mb_5 = isset($_POST['mb_5']) ? trim($_POST['mb_5']) : "";
|
|
$mb_6 = isset($_POST['mb_6']) ? trim($_POST['mb_6']) : "";
|
|
$mb_7 = isset($_POST['mb_7']) ? trim($_POST['mb_7']) : "";
|
|
$mb_8 = isset($_POST['mb_8']) ? trim($_POST['mb_8']) : "";
|
|
$mb_9 = isset($_POST['mb_9']) ? trim($_POST['mb_9']) : "";
|
|
$mb_10 = isset($_POST['mb_10']) ? trim($_POST['mb_10']) : "";
|
|
|
|
$mb_name = clean_xss_tags($mb_name);
|
|
$mb_email = get_email_address($mb_email);
|
|
$mb_homepage = clean_xss_tags($mb_homepage);
|
|
$mb_tel = clean_xss_tags($mb_tel);
|
|
$mb_zip1 = preg_replace('/[^0-9]/', '', $mb_zip1);
|
|
$mb_zip2 = preg_replace('/[^0-9]/', '', $mb_zip2);
|
|
$mb_addr1 = clean_xss_tags($mb_addr1);
|
|
$mb_addr2 = clean_xss_tags($mb_addr2);
|
|
$mb_addr3 = clean_xss_tags($mb_addr3);
|
|
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
|
|
|
|
run_event('register_form_update_before', $mb_id, $w);
|
|
|
|
if ($w == '') {
|
|
if (!trim(get_session('ss_mb_id')))
|
|
alert('로그인 되어 있지 않습니다.');
|
|
|
|
if (trim($_POST['mb_id']) != $mb_id)
|
|
alert("로그인된 정보와 수정하려는 정보가 틀리므로 수정할 수 없습니다.\\n만약 올바르지 않은 방법을 사용하신다면 바로 중지하여 주십시오.");
|
|
|
|
$sql_password = "";
|
|
if ($mb_password)
|
|
$sql_password = " , mb_password = '".get_encrypt_string($mb_password)."' ";
|
|
|
|
$sql_nick_date = "";
|
|
if ($mb_nick_default != $mb_nick)
|
|
$sql_nick_date = " , mb_nick_date = '".G5_TIME_YMD."' ";
|
|
|
|
$sql_open_date = "";
|
|
if ($mb_open_default != $mb_open)
|
|
$sql_open_date = " , mb_open_date = '".G5_TIME_YMD."' ";
|
|
|
|
// 이전 메일주소와 수정한 메일주소가 틀리다면 인증을 다시 해야하므로 값을 삭제
|
|
$sql_email_certify = '';
|
|
if ($old_email != $mb_email && $config['cf_use_email_certify'])
|
|
$sql_email_certify = " , mb_email_certify = '' ";
|
|
|
|
$sql = " update {$g5['member_table']}
|
|
set mb_nick = '{$mb_nick}',
|
|
mb_name = '{$mb_name}',
|
|
mb_mailling = '{$mb_mailling}',
|
|
mb_sms = '{$mb_sms}',
|
|
mb_open = '{$mb_open}',
|
|
mb_email = '{$mb_email}',
|
|
mb_homepage = '{$mb_homepage}',
|
|
mb_tel = '{$mb_tel}',
|
|
mb_hp = '{$mb_hp}',
|
|
mb_zip1 = '{$mb_zip1}',
|
|
mb_zip2 = '{$mb_zip2}',
|
|
mb_addr1 = '{$mb_addr1}',
|
|
mb_addr2 = '{$mb_addr2}',
|
|
mb_addr3 = '{$mb_addr3}',
|
|
mb_addr_jibeon = '{$mb_addr_jibeon}',
|
|
mb_signature = '{$mb_signature}',
|
|
mb_profile = '{$mb_profile}',
|
|
mb_comp = '{$mb_1}',
|
|
mb_comp_team = '{$mb_2}',
|
|
mb_3 = '{$mb_3}',
|
|
mb_4 = '{$mb_4}',
|
|
mb_5 = '{$mb_5}',
|
|
mb_6 = '{$mb_6}',
|
|
mb_7 = '{$mb_7}',
|
|
mb_8 = '{$mb_8}',
|
|
mb_9 = '{$mb_9}',
|
|
mb_10 = '{$mb_10}'
|
|
{$sql_password}
|
|
{$sql_nick_date}
|
|
{$sql_open_date}
|
|
{$sql_email_certify}
|
|
{$sql_certify}
|
|
where mb_id = '$mb_id' ";
|
|
sql_query($sql);
|
|
|
|
$re_value = "success";
|
|
}
|
|
|
|
$msg = "";
|
|
|
|
run_event('register_form_update_after', $mb_id, $w);
|
|
|
|
echo json_encode($re_value, JSON_UNESCAPED_UNICODE);
|
|
|
|
// if ($w == '') {
|
|
// $row = sql_fetch(" select mb_password from {$g5['member_table']} where mb_id = '{$member['mb_id']}' ");
|
|
// $tmp_password = $row['mb_password'];
|
|
|
|
// if ($old_email != $mb_email && $config['cf_use_email_certify']) {
|
|
// set_session('ss_mb_id', '');
|
|
// alert('회원 정보가 수정 되었습니다.\n\nE-mail 주소가 변경되었으므로 다시 인증하셔야 합니다.', G5_URL);
|
|
// } else {
|
|
// echo '
|
|
// <!doctype html>
|
|
// <html lang="ko">
|
|
// <head>
|
|
// <meta charset="utf-8">
|
|
// <title>회원정보수정</title>
|
|
// <body>
|
|
// <form name="fregisterupdate" method="post" action="'.G5_HTTP_BBS_URL.'/register_form.php">
|
|
// <input type="hidden" name="w" value="u">
|
|
// <input type="hidden" name="mb_id" value="'.$mb_id.'">
|
|
// <input type="hidden" name="mb_password" value="'.$tmp_password.'">
|
|
// <input type="hidden" name="is_update" value="1">
|
|
// </form>
|
|
// <script>
|
|
// alert("회원 정보가 수정 되었습니다.");
|
|
// document.fregisterupdate.submit();
|
|
// </script>
|
|
// </body>
|
|
// </html>';
|
|
// }
|
|
// }
|
|
?>
|