diff --git a/adm/board_form_update.php b/adm/board_form_update.php index db451aac4..558561b4d 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -12,16 +12,25 @@ if (!$bo_table) { alert('게시판 TABLE명은 반드시 입력하세요.'); } if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) { alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)'); } if (!$_POST['bo_subject']) { alert('게시판 제목을 입력하세요.'); } +$_POST['bo_include_head'] = preg_replace("#[\\\]+$#", "", substr($_POST['bo_include_head'], 0, 255)); +$_POST['bo_include_tail'] = preg_replace("#[\\\]+$#", "", substr($_POST['bo_include_tail'], 0, 255)); + if ($file = $_POST['bo_include_head']) { + $purl = parse_url($file); + $file = $purl['path']; if (!preg_match("/\.(php|htm['l']?)$/i", $file)) { alert('상단 파일 경로가 php, html 파일이 아닙니다.'); } + $_POST['bo_include_head'] = $file; } if ($file = $_POST['bo_include_tail']) { + $purl = parse_url($file); + $file = $purl['path']; if (!preg_match("/\.(php|htm['l']?)$/i", $file)) { alert('하단 파일 경로가 php, html 파일이 아닙니다.'); } + $_POST['bo_include_tail'] = $file; } $board_path = G5_DATA_PATH.'/file/'.$bo_table; diff --git a/adm/config_form.php b/adm/config_form.php index 6535f2272..410bbc503 100644 --- a/adm/config_form.php +++ b/adm/config_form.php @@ -180,6 +180,12 @@ if(!isset($config['cf_kakao_js_apikey'])) { ADD `cf_kakao_js_apikey` varchar(255) NOT NULL DEFAULT '' AFTER `cf_googl_shorturl_apikey` ", true); } +// SMS 전송유형 필드 추가 +if(!isset($config['cf_sms_type'])) { + sql_query(" ALTER TABLE `{$g5['config_table']}` + ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ", true); +} + if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic"; if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic"; @@ -1034,6 +1040,16 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) { + + + + LMS로 선택하시면 90바이트 이하는 SMS로, 그 이상은 1500바이트까지 LMS로 전송됩니다.
요금은 건당 SMS는 16원, LMS는 48원입니다."); ?> + + + @@ -1069,7 +1085,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) { 아이코드 SMS 신청
회원가입 - 아이코드 회원가입 @@ -1081,12 +1096,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) { 충전하기 - - 건수별 금액 - - 원. - - diff --git a/adm/config_form_update.php b/adm/config_form_update.php index 7c2c7891b..2c1279df4 100644 --- a/adm/config_form_update.php +++ b/adm/config_form_update.php @@ -124,6 +124,7 @@ $sql = " update {$g5['config_table']} cf_cert_limit = '{$_POST['cf_cert_limit']}', cf_cert_req = '{$_POST['cf_cert_req']}', cf_sms_use = '{$_POST['cf_sms_use']}', + cf_sms_type = '{$_POST['cf_sms_type']}', cf_icode_id = '{$_POST['cf_icode_id']}', cf_icode_pw = '{$_POST['cf_icode_pw']}', cf_icode_server_ip = '{$_POST['cf_icode_server_ip']}', diff --git a/adm/css/admin.css b/adm/css/admin.css index c7066ba54..feecc59d8 100644 --- a/adm/css/admin.css +++ b/adm/css/admin.css @@ -758,4 +758,9 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right} #grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;} #grp_color li.color2 span{background:rgb(234, 162, 40);} #chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0} -#chart_wr{margin:20px } \ No newline at end of file +#chart_wr{margin:20px } + +/*전송실패 문자 재전송 내역*/ +.sms_table{padding:0 20px 40px;} +.sms_table table th{border:1px solid #ddd;padding:9px 0} +.sms_table table td{border:1px solid #ddd;text-align:center;width:16%;padding:9px 0} \ No newline at end of file diff --git a/adm/index.php b/adm/index.php index a579ad851..fcaa2dfe5 100644 --- a/adm/index.php +++ b/adm/index.php @@ -91,7 +91,7 @@ $colspan = 12; $leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME); $intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME); - $mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']); + $mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']); $mb_id = $row['mb_id']; if ($row['mb_leave_date']) diff --git a/adm/member_form.php b/adm/member_form.php index ddcdfbe47..3e056459e 100644 --- a/adm/member_form.php +++ b/adm/member_form.php @@ -31,6 +31,8 @@ else if ($w == 'u') $required_mb_password = ''; $html_title = '수정'; + $mb['mb_name'] = get_text($mb['mb_name']); + $mb['mb_nick'] = get_text($mb['mb_nick']); $mb['mb_email'] = get_text($mb['mb_email']); $mb['mb_homepage'] = get_text($mb['mb_homepage']); $mb['mb_birth'] = get_text($mb['mb_birth']); @@ -38,6 +40,7 @@ else if ($w == 'u') $mb['mb_hp'] = get_text($mb['mb_hp']); $mb['mb_addr1'] = get_text($mb['mb_addr1']); $mb['mb_addr2'] = get_text($mb['mb_addr2']); + $mb['mb_addr3'] = get_text($mb['mb_addr3']); $mb['mb_signature'] = get_text($mb['mb_signature']); $mb['mb_recommend'] = get_text($mb['mb_recommend']); $mb['mb_profile'] = get_text($mb['mb_profile']); diff --git a/adm/member_list.php b/adm/member_list.php index ea3c6e4c6..9eaf3e43c 100644 --- a/adm/member_list.php +++ b/adm/member_list.php @@ -166,7 +166,7 @@ $colspan = 16; $leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date('Ymd', G5_SERVER_TIME); $intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date('Ymd', G5_SERVER_TIME); - $mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']); + $mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']); $mb_id = $row['mb_id']; $leave_msg = ''; @@ -211,7 +211,7 @@ $colspan = 16; - + diff --git a/adm/menu_list.php b/adm/menu_list.php index daa86fdaf..2aa88b13c 100644 --- a/adm/menu_list.php +++ b/adm/menu_list.php @@ -73,7 +73,7 @@ $colspan = 7; } $search = array('"', "'"); - $replace = array('"', '''); + $replace = array('"', '''); $me_name = str_replace($search, $replace, $row['me_name']); ?> diff --git a/adm/sms_admin/_common.php b/adm/sms_admin/_common.php index e44e58e4d..4afeddf37 100644 --- a/adm/sms_admin/_common.php +++ b/adm/sms_admin/_common.php @@ -2,6 +2,7 @@ define('G5_IS_ADMIN', true); include_once ('../../common.php'); include_once(G5_ADMIN_PATH.'/admin.lib.php'); +include_once(G5_SMS5_PATH.'/sms5.lib.php'); if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) { if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' "))) diff --git a/adm/sms_admin/config.php b/adm/sms_admin/config.php index 858cfb313..0b532b447 100644 --- a/adm/sms_admin/config.php +++ b/adm/sms_admin/config.php @@ -86,10 +86,6 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용 - - 건별 금액 - 원 - diff --git a/adm/sms_admin/history_send.php b/adm/sms_admin/history_send.php index 214815a6a..109dfcc41 100644 --- a/adm/sms_admin/history_send.php +++ b/adm/sms_admin/history_send.php @@ -39,7 +39,8 @@ if (!$res['cnt']) { $sql = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag"); while ($res = sql_fetch_array($sql)) { - $res['bk_hp'] = get_hp($res['bk_hp'], 0); + $res['bk_hp'] = get_hp($res['hs_hp'], 0); + $res['bk_name'] = $res['hs_name']; if ($g5['sms5_demo']) $res['bk_hp'] = '0100000000'; @@ -48,6 +49,7 @@ while ($res = sql_fetch_array($sql)) } $wr_total = count($list); +$reply = str_replace('-', '', trim($write['wr_reply'])); if ($config['cf_sms_use'] != 'icode') { alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.'); @@ -55,79 +57,170 @@ if ($config['cf_sms_use'] != 'icode') { include_once(G5_ADMIN_PATH.'/admin.head.php'); $SMS = new SMS5; -$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']); -$reply = str_replace('-', '', trim($write['wr_reply'])); +if($config['cf_sms_type'] == 'LMS') { + $port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']); -$result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total); - -if ($result) -{ - $result = $SMS->Send(); - - if ($result) //SMS 서버에 접속했습니다. - { - sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'"); + if($port_setting !== false) { + $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting); $wr_success = 0; $wr_failure = 0; $count = 0; - foreach ($SMS->Result as $result) - { - list($phone, $code) = explode(":", $result); + for($i=0; $i<$wr_total; $i++) { + $strDest = array(); + $strDest[] = $list[$i]['bk_hp']; + $strCallBack = $reply; + $strCaller = $config['cf_title']; + $strSubject = ''; + $strURL = ''; + $strData = $write['wr_message']; + if( !empty($list[$i]['bk_name']) ){ + $strData = str_replace("{이름}", $list[$i]['bk_name'], $strData); + } + $strDate = $booking; + $nCount = 1; - if (substr($code,0,5) == "Error") - { - $hs_code = substr($code,6,2); + $result = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount); - switch ($hs_code) { - case '02': // "02:형식오류" - $hs_memo = "형식이 잘못되어 전송이 실패하였습니다."; - break; - case '23': // "23:인증실패,데이터오류,전송날짜오류" - $hs_memo = "데이터를 다시 확인해 주시기바랍니다."; - break; - case '97': // "97:잔여코인부족" - $hs_memo = "잔여코인이 부족합니다."; - break; - case '98': // "98:사용기간만료" - $hs_memo = "사용기간이 만료되었습니다."; - break; - case '99': // "99:인증실패" - $hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요."; - break; - default: // "미 확인 오류" - $hs_memo = "알 수 없는 오류로 전송이 실패하었습니다."; - break; + if($result) { + $result = $SMS->Send(); + + if ($result) //SMS 서버에 접속했습니다. + { + foreach ($SMS->Result as $result) + { + list($phone, $code) = explode(":", $result); + + if (substr($code,0,5) == "Error") + { + $hs_code = substr($code,6,2); + + switch ($hs_code) { + case '02': // "02:형식오류" + $hs_memo = "형식이 잘못되어 전송이 실패하였습니다."; + break; + case '23': // "23:인증실패,데이터오류,전송날짜오류" + $hs_memo = "데이터를 다시 확인해 주시기바랍니다."; + break; + case '97': // "97:잔여코인부족" + $hs_memo = "잔여코인이 부족합니다."; + break; + case '98': // "98:사용기간만료" + $hs_memo = "사용기간이 만료되었습니다."; + break; + case '99': // "99:인증실패" + $hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요."; + break; + default: // "미 확인 오류" + $hs_memo = "알 수 없는 오류로 전송이 실패하였습니다."; + break; + } + $wr_failure++; + $hs_flag = 0; + } + else + { + $hs_code = $code; + $hs_memo = get_hp($phone, 1)."로 전송했습니다."; + $wr_success++; + $hs_flag = 1; + } + + $row = $list[$i]; + $row['bk_hp'] = get_hp($row['bk_hp'], 1); + + $log = array_shift($SMS->Log); + $log = @iconv('euc-kr', 'utf-8', $log); + + sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false); + } + + $SMS->Init(); // 보관하고 있던 결과값을 지웁니다. } - $wr_failure++; - $hs_flag = 0; } - else - { - $hs_code = $code; - $hs_memo = get_hp($phone, 1)."로 전송했습니다."; - $wr_success++; - $hs_flag = 1; - } - - $row = array_shift($list); - $row['bk_hp'] = get_hp($row['bk_hp'], 1); - - $log = array_shift($SMS->Log); - $log = @iconv('euc-kr', 'utf-8', $log); - - sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='{$row['hs_name']}', hs_hp='{$row['hs_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false); } - $SMS->Init(); // 보관하고 있던 결과값을 지웁니다. - sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure' where wr_no='$wr_no' and wr_renum='$new_wr_renum'"); + sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_success='$wr_success', wr_failure='$wr_failure', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'"); + sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0"); } - else alert("에러: SMS 서버와 통신이 불안정합니다."); +} else { + $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']); + + $reply = str_replace('-', '', trim($write['wr_reply'])); + + $result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total); + + if ($result) + { + $result = $SMS->Send(); + + if ($result) //SMS 서버에 접속했습니다. + { + sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'"); + + $wr_success = 0; + $wr_failure = 0; + $count = 0; + + foreach ($SMS->Result as $result) + { + list($phone, $code) = explode(":", $result); + + if (substr($code,0,5) == "Error") + { + $hs_code = substr($code,6,2); + + switch ($hs_code) { + case '02': // "02:형식오류" + $hs_memo = "형식이 잘못되어 전송이 실패하였습니다."; + break; + case '23': // "23:인증실패,데이터오류,전송날짜오류" + $hs_memo = "데이터를 다시 확인해 주시기바랍니다."; + break; + case '97': // "97:잔여코인부족" + $hs_memo = "잔여코인이 부족합니다."; + break; + case '98': // "98:사용기간만료" + $hs_memo = "사용기간이 만료되었습니다."; + break; + case '99': // "99:인증실패" + $hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요."; + break; + default: // "미 확인 오류" + $hs_memo = "알 수 없는 오류로 전송이 실패하었습니다."; + break; + } + $wr_failure++; + $hs_flag = 0; + } + else + { + $hs_code = $code; + $hs_memo = get_hp($phone, 1)."로 전송했습니다."; + $wr_success++; + $hs_flag = 1; + } + + $row = array_shift($list); + $row['bk_hp'] = get_hp($row['bk_hp'], 1); + + $log = array_shift($SMS->Log); + $log = @iconv('euc-kr', 'utf-8', $log); + + sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='{$row['hs_name']}', hs_hp='{$row['hs_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false); + } + $SMS->Init(); // 보관하고 있던 결과값을 지웁니다. + + sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure' where wr_no='$wr_no' and wr_renum='$new_wr_renum'"); + sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0"); + } + else alert("에러: SMS 서버와 통신이 불안정합니다."); + } + else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다."); } -else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다."); ?> '.PHP_EOL; } $editor_html = editor_html('wr_content', $content, $is_dhtml_editor); $editor_js = ''; diff --git a/config.php b/config.php index 6f6a6bfed..d667e91f6 100644 --- a/config.php +++ b/config.php @@ -5,7 +5,7 @@ ********************/ define('G5_VERSION', '그누보드5'); -define('G5_GNUBOARD_VER', '5.1.1'); +define('G5_GNUBOARD_VER', '5.1.2'); // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 define('_GNUBOARD_', true); @@ -192,6 +192,9 @@ define('G5_THUMB_JPG_QUALITY', 90); // 썸네일 png Compress 설정 define('G5_THUMB_PNG_COMPRESS', 5); +// 모바일 기기에서 DHTML 에디터 사용여부를 설정합니다. +define('G5_IS_MOBILE_DHTML_USE', false); + // ip 숨김방법 설정 /* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은 \\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로 diff --git a/extend/sms5.extend.php b/extend/sms5.extend.php index 5596f9ad0..6405f1373 100644 --- a/extend/sms5.extend.php +++ b/extend/sms5.extend.php @@ -49,9 +49,5 @@ if (!empty($config['cf_sms_use'])) { // 아이코드에 실제로 보내지 않고 가상(Random)으로 전송결과를 저장합니다. $g5['sms5_demo_send'] = true; } - - include_once(G5_LIB_PATH.'/icode.sms.lib.php'); - include_once(G5_SMS5_PATH.'/sms5.lib.php'); - } ?> \ No newline at end of file diff --git a/head.sub.php b/head.sub.php index 208c20c38..e70da0c59 100644 --- a/head.sub.php +++ b/head.sub.php @@ -100,7 +100,7 @@ if ($is_member) { // 회원이라면 로그인 중이라는 메세지를 출력 else if ($is_admin == 'group') $sr_admin_msg = "그룹관리자 "; else if ($is_admin == 'board') $sr_admin_msg = "게시판관리자 "; - echo '
'.$sr_admin_msg.$member['mb_nick'].'님 로그인 중 '; + echo '
'.$sr_admin_msg.get_text($member['mb_nick']).'님 로그인 중 '; echo '로그아웃
'; } ?> \ No newline at end of file diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql index b960a9326..a3add4f4e 100644 --- a/install/gnuboard5.sql +++ b/install/gnuboard5.sql @@ -285,8 +285,9 @@ CREATE TABLE IF NOT EXISTS `g5_config` ( `cf_cert_limit` int(11) NOT NULL DEFAULT '0', `cf_cert_req` tinyint(4) NOT NULL DEFAULT '0', `cf_sms_use` varchar(255) NOT NULL DEFAULT '', + `cf_sms_type` varchar(10) NOT NULL DEFAULT '', `cf_icode_id` varchar(255) NOT NULL DEFAULT '', - `cf_icode_pw` varchar(255) NOT NULL DEFAULT '', + `cf_icode_pw` varchar(255) NOT NULL DEFAULT '', `cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '', `cf_icode_server_port` varchar(255) NOT NULL DEFAULT '', `cf_googl_shorturl_apikey` varchar(255) NOT NULL DEFAULT '', diff --git a/js/autosave.js b/js/autosave.js index b65891ff8..3de56cd81 100644 --- a/js/autosave.js +++ b/js/autosave.js @@ -7,13 +7,18 @@ var save_wr_content = null; function autosave() { $("form#fwrite").each(function() { - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - this.wr_content.value = CKEDITOR.instances.wr_content.getData(); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - this.wr_content.value = ed_wr_content.outputBodyHTML(); - } else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) { - this.wr_content.value = oEditors.getById['wr_content'].getIR(); + if(g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { + this.wr_content.value = CKEDITOR.instances.wr_content.getData(); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { + this.wr_content.value = ed_wr_content.outputBodyHTML(); + } else { + if(typeof get_editor_wr_content == "function") { + this.wr_content.value = get_editor_wr_content(); + } + } } + // 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함 if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) { $.ajax({ @@ -78,14 +83,16 @@ $(function(){ var subject = $(data).find("item").find("subject").text(); var content = $(data).find("item").find("content").text(); $("#wr_subject").val(subject); - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - CKEDITOR.instances.wr_content.setData(content); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - ed_wr_content.putContents(content); - } else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) { - oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]); - //oEditors.getById["wr_content"].exec("SET_IR", [""]); - oEditors.getById["wr_content"].exec("PASTE_HTML", [content]); + if(g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { + CKEDITOR.instances.wr_content.setData(content); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { + ed_wr_content.putContents(content); + } else { + if(typeof put_editor_wr_content == "function") { + put_editor_wr_content(content); + } + } } else { $("#fwrite #wr_content").val(content); } diff --git a/lib/common.lib.php b/lib/common.lib.php index 51561d7b0..749672e5f 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -380,7 +380,7 @@ function get_list($write_row, $board, $skin_url, $subject_len=40) else $list['last2'] = substr($list['last2'],5,5); - $list['wr_homepage'] = get_text(addslashes($list['wr_homepage'])); + $list['wr_homepage'] = get_text($list['wr_homepage']); $tmp_name = get_text(cut_str($list['wr_name'], $config['cf_cut_name'])); // 설정된 자리수 만큼만 이름 출력 if ($board['bo_use_sideview']) @@ -1201,11 +1201,6 @@ function get_sideview($mb_id, $name='', $email='', $homepage='') $email = base64_encode($email); $homepage = set_http(clean_xss_tags($homepage)); - $name = preg_replace("/\'/", "", $name); - $name = preg_replace("/\'/", "", $name); - $name = preg_replace("/\"/", """, $name); - $title_name = $name; - $tmp_name = ""; if ($mb_id) { //$tmp_name = "$name"; @@ -1367,10 +1362,16 @@ function cut_str($str, $len, $suffix="…") // TEXT 형식으로 변환 function get_text($str, $html=0) { - /* 3.22 막음 (HTML 체크 줄바꿈시 출력 오류때문) - $source[] = "/ /"; - $target[] = "  "; - */ + $source[] = "<"; + $target[] = "<"; + $source[] = ">"; + $target[] = ">"; + $source[] = "\""; + $target[] = """; + $source[] = "\'"; + $target[] = "'"; + + $str = str_replace($target, $source, $str); // 3.31 // TEXT 출력일 경우 &   등의 코드를 정상으로 출력해 주기 위함 @@ -1378,21 +1379,12 @@ function get_text($str, $html=0) $str = html_symbol($str); } - $source[] = "//"; - $target[] = ">"; - //$source[] = "/\"/"; - //$target[] = """; - $source[] = "/\'/"; - $target[] = "'"; - //$source[] = "/}/"; $target[] = "}"; if ($html) { - $source[] = "/\n/"; + $source[] = "\n"; $target[] = "
"; } - return preg_replace($source, $target, $str); + return str_replace($source, $target, $str); } @@ -2723,11 +2715,6 @@ function clean_xss_tags($str) { $str = preg_replace('#]*+>#i', '', $str); - $search = array('"', "'"); - $replace = array('"', '''); - - $str = str_replace($search, $replace, $str); - return $str; } diff --git a/lib/icode.lms.lib.php b/lib/icode.lms.lib.php new file mode 100644 index 000000000..e255d1d7b --- /dev/null +++ b/lib/icode.lms.lib.php @@ -0,0 +1,249 @@ +socket_host = $host; + $this->socket_portcode = $portcode; + $this->icode_id = FillSpace($id, 10); + $this->icode_pw = FillSpace($pw, 10); + } + + function Init() { + $this->Data = ""; // 발송하기 위한 패킷내용이 배열로 들어간다. + $this->Result = ""; // 발송결과값이 배열로 들어간다. + } + + function Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate="", $nCount) { + + // 문자 타입별 Port 설정. + $sendType = strlen($strData) > 90 ? 1 : 0; // 0: SMS / 1: LMS + + /* 개발 완료 후 아래 포트를 rand 함수를 이용하는 라인으로 변경 바랍니다.*/ + + // 충전식 + if ($this->socket_portcode == 1) { + if($sendType && $sendType == 1) { + //$this->socket_port = 8200; // LMS + $this->socket_port=(int)rand(8200,8201); // LMS + } else { + //$this->socket_port = 6295; // SMS + $this->socket_port=(int)rand(6295,6297); // SMS + } + } + // 정액제 + else { + if($sendType && $sendType == 1) { + //$this->socket_port = 8300; // LMS + $this->socket_port=(int)rand(8300,8301); // LMS + } else { + //$this->socket_port = 6291; // SMS + $this->socket_port=(int)rand(6291,6293); // SMS + } + } + + $strCallBack = FillSpace($strCallBack, 11); // 회신번호 + $strDate = FillSpace($strDate, 12); // 즉시(12byte 공백), 예약전송(YmdHi) + + if ($sendType && $sendType == 1) { + + /** LMS 제목 **/ + /* + 제목필드의 값이 없을 경우 단말기 기종및 설정에 따라 표기 방법이 다름 + 1.설정에서 제목필드보기 설정 Disable -> 제목필드값을 넣어도 미표기 + 2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시 + + 제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망 + */ + $strSubject = str_replace("\r\n", " ", $strSubject); + $strSubject = str_replace("<", "[", $strSubject); + $strSubject = str_replace(">", "]", $strSubject); + + $strSubject = FillSpace($strSubject,30); + $strData = FillSpace(CutChar($strData,1500),1500); + } else if (!$strURL) { + $strData = FillSpace(CutChar($strData,90),90); + $strCaller = FillSpace($strCaller,10); + } else { + $strURL = FillSpace($strURL,50); + } + + $Error = CheckCommonTypeDest($strDest, $nCount); + $Error = is_vaild_callback($strCallBack); + $Error = CheckCommonTypeDate($strDate); + + for ($i=0; $i<$nCount; $i++) { + + $strDest[$i] = FillSpace($strDest[$i],11); + if ($sendType && $sendType == 1) { + $this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strSubject.$strDate.$strData; + } else if (!$strURL) { + $this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strCaller.$strDate.$strData; + } else { + $strData = FillSpace(CheckCallCenter($strURL, $strDest[$i], $strData),80); + $this->Data[$i] = '05173 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strURL.$strDate.$strData; + } + } + return true; + } + + + function Send() { + $fsocket = fsockopen($this->socket_host,$this->socket_port, $errno, $errstr, 2); + if (!$fsocket) return false; + set_time_limit(300); + + foreach($this->Data as $puts) { + fputs($fsocket, $puts); + while(!$gets) { $gets = fgets($fsocket,30); } + $dest = substr($puts,26,11); + if (substr($gets,0,19) == "0223 00".$dest) { + $this->Result[] = $dest.":".substr($gets,19,10); + } else { + $this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")"; + } + $gets = ""; + } + + fclose($fsocket); + $this->Data = ""; + return true; + } +} + +/** + * 원하는 문자열의 길이를 원하는 길이만큼 공백을 넣어 맞추도록 합니다. + * + * @param text 원하는 문자열입니다. + * size 원하는 길이입니다. + * @return 변경된 문자열을 넘깁니다. + */ +function FillSpace($text,$size) { + for ($i=0; $i<$size; $i++) $text.= " "; + $text = substr($text,0,$size); + return $text; +} + +/** + * 원하는 문자열을 원하는 길에 맞는지 확인해서 조정하는 기능을 합니다. + * + * @param word 원하는 문자열입니다. + * cut 원하는 길이입니다. + * @return 변경된 문자열입니다. + */ +function CutChar($word, $cut) { + $word=substr($word,0,$cut); // 필요한 길이만큼 취함. + for ($k = $cut-1; $k > 1; $k--) { + if (ord(substr($word,$k,1))<128) break; // 한글값은 160 이상. + } + $word = substr($word, 0, $cut-($cut-$k+1)%2); + return $word; +} + +/** +* 수신번호의 값이 정확한 값인지 확인합니다. +* +* @param strDest 발송번호 배열입니다. +* nCount 배열의 크기입니다. +* @return 처리결과입니다. +*/ +function CheckCommonTypeDest($strDest, $nCount) { + for ($i=0; $i<$nCount; $i++) { + $strDest[$i] = preg_replace("/[^0-9]/","",$strDest[$i]); + if(!preg_match("/^01[0-9]{8,9}$/", $strDest[$i])) + return "수신번호오류"; + } +} + + +/** +* 회신번호 유효성 여부조회 * +* @param string callback 회신번호 +* @return 처리결과입니다 +* 한국인터넷진흥원 권고 +*/ +function is_vaild_callback($callback){ + + $_callback = preg_replace('/[^0-9]/', '', $callback); + + if (!preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080|007)\-?\d{3,4}\-?\d{4,5}$/", $_callback) && + !preg_match("/^(15|16|18)\d{2}\-?\d{4,5}$/", $_callback)){ + return "회신번호오류"; + } + + if (preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080)\-?0{3,4}\-?\d{4}$/", $_callback)){ + return "회신번호오류"; + } +} + + +/** +* 예약날짜의 값이 정확한 값인지 확인합니다. +* +* @param string strDate (예약시간) +* @return 처리결과입니다 +*/ +function CheckCommonTypeDate($strDate) { + $strDate = preg_replace("/[^0-9]/", "", $strDate); + if ($strDate){ + if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($rsvTime,0,4))) + return "예약날짜오류"; + if (substr($strDate,8,2)>23 || substr($strDate,10,2)>59) return false; + return "예약날짜오류"; + } +} + +/** +* URL콜백용으로 메세지 크기를 수정합니다. +* +* @param url URL 내용입니다. +* msg 결과메시지입니다. +* desk 문자내용입니다. +*/ +function CheckCallCenter($url, $dest, $data) { + switch (substr($dest,0,3)) { + case '010': //20바이트 + return CutChar($data,20); break; + case '011': //80바이트 + return CutChar($data,80); break; + case '016': // 80바이트 + return CutChar($data,80); break; + case '017': // URL 포함 80바이트 + return CutChar($data,80 - strlen($url)); break; + case '018': // 20바이트 + return CutChar($data,20); break; + case '019': // 20바이트 + return CutChar($data,20); break; + default: + return CutChar($data,80); break; + } +} +?> \ No newline at end of file diff --git a/lib/outlogin.lib.php b/lib/outlogin.lib.php index 7f2916ec9..912777199 100644 --- a/lib/outlogin.lib.php +++ b/lib/outlogin.lib.php @@ -7,7 +7,7 @@ function outlogin($skin_dir='basic') global $config, $member, $g5, $urlencode, $is_admin, $is_member; if (array_key_exists('mb_nick', $member)) { - $nick = cut_str($member['mb_nick'], $config['cf_cut_name']); + $nick = get_text(cut_str($member['mb_nick'], $config['cf_cut_name'])); } if (array_key_exists('mb_point', $member)) { $point = number_format($member['mb_point']); diff --git a/lib/popular.lib.php b/lib/popular.lib.php index fcb9c0801..b2b264aa6 100644 --- a/lib/popular.lib.php +++ b/lib/popular.lib.php @@ -17,7 +17,7 @@ function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3) for ($i=0; $row=sql_fetch_array($result); $i++) { $list[$i] = $row; // 스크립트등의 실행금지 - $list[$i]['pp_word'] = get_text($list[$i]['pp_word']); + //$list[$i]['pp_word'] = get_text($list[$i]['pp_word']); } if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) { diff --git a/mobile/skin/board/basic/write.skin.php b/mobile/skin/board/basic/write.skin.php index b28d9abb7..8d9076d2f 100644 --- a/mobile/skin/board/basic/write.skin.php +++ b/mobile/skin/board/basic/write.skin.php @@ -193,8 +193,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -243,7 +242,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/mobile/skin/board/gallery/write.skin.php b/mobile/skin/board/gallery/write.skin.php index f40d8db61..4aec1baaf 100644 --- a/mobile/skin/board/gallery/write.skin.php +++ b/mobile/skin/board/gallery/write.skin.php @@ -192,8 +192,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -242,7 +241,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/mobile/skin/member/basic/formmail.skin.php b/mobile/skin/member/basic/formmail.skin.php index 3add8546b..bb1c32e7c 100644 --- a/mobile/skin/member/basic/formmail.skin.php +++ b/mobile/skin/member/basic/formmail.skin.php @@ -13,7 +13,7 @@ add_stylesheet('', - + diff --git a/mobile/skin/member/basic/register_form.skin.php b/mobile/skin/member/basic/register_form.skin.php index 9b783960b..941399c9f 100644 --- a/mobile/skin/member/basic/register_form.skin.php +++ b/mobile/skin/member/basic/register_form.skin.php @@ -20,8 +20,8 @@ add_stylesheet('', date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400))) { // 닉네임수정일이 지나지 않았다면 ?> - - + +
@@ -55,7 +55,7 @@ add_stylesheet('', 아이핀 본인확인 후에는 이름이 자동 입력되고 휴대폰 본인확인 후에는 이름과 휴대폰번호가 자동 입력되어 수동으로 입력할수 없게 됩니다. - class="frm_input "> + class="frm_input "> ', 공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
닉네임을 바꾸시면 앞으로 일 이내에는 변경 할 수 없습니다. - - + + @@ -111,14 +111,14 @@ add_stylesheet('', - " maxlength="255" > + " maxlength="255" > - " maxlength="20" > + " maxlength="20" > @@ -126,9 +126,9 @@ add_stylesheet('', - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> - + @@ -145,13 +145,13 @@ add_stylesheet('', class="frm_input " size="5" maxlength="6">
- class="frm_input frm_address " size="50">
+ class="frm_input frm_address " size="50">
- +
- - + + diff --git a/mobile/skin/popular/basic/popular.skin.php b/mobile/skin/popular/basic/popular.skin.php index 463b3b01c..436883642 100644 --- a/mobile/skin/popular/basic/popular.skin.php +++ b/mobile/skin/popular/basic/popular.skin.php @@ -10,7 +10,7 @@ add_stylesheet('',

인기검색어

diff --git a/mobile/skin/qa/basic/write.skin.php b/mobile/skin/qa/basic/write.skin.php index 39118b80b..adbcbdfbb 100644 --- a/mobile/skin/qa/basic/write.skin.php +++ b/mobile/skin/qa/basic/write.skin.php @@ -53,7 +53,7 @@ add_stylesheet('', 0); - class="frm_input email" maxlength="100"> + class="frm_input email" maxlength="100"> > @@ -64,7 +64,7 @@ add_stylesheet('', 0); - class="frm_input" size="30"> + class="frm_input" size="30"> > 답변등록 SMS알림 수신 @@ -75,7 +75,7 @@ add_stylesheet('', 0); - + diff --git a/plugin/editor/smarteditor2/autosave.editor.js b/plugin/editor/smarteditor2/autosave.editor.js new file mode 100644 index 000000000..49978765a --- /dev/null +++ b/plugin/editor/smarteditor2/autosave.editor.js @@ -0,0 +1,13 @@ +function get_editor_wr_content() +{ + return oEditors.getById['wr_content'].getIR();; +} + +function put_editor_wr_content(content) +{ + oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]); + //oEditors.getById["wr_content"].exec("SET_IR", [""]); + oEditors.getById["wr_content"].exec("PASTE_HTML", [content]); + + return; +} \ No newline at end of file diff --git a/plugin/okname/ipin.config.php b/plugin/okname/ipin.config.php index 542ece16b..c4a0098cc 100644 --- a/plugin/okname/ipin.config.php +++ b/plugin/okname/ipin.config.php @@ -29,9 +29,9 @@ if($config['cf_cert_use'] == 2) { } else { // 테스트일 경우 $cpCode = 'P00000000000'; - $idpUrl = 'https://tipin.ok-name.co.kr:8443/tis/ti/POTI90B_SendCertInfo.jsp'; + $idpUrl = 'https://tmpin.ok-name.co.kr:5443/tis/ti/POTI90B_SendCertInfo.jsp'; $EndPointURL = 'http://twww.ok-name.co.kr:8888/KcbWebService/OkNameService'; //EndPointURL, 테스트 서버 - $kcbForm_action = 'https://tipin.ok-name.co.kr:8443/tis/ti/POTI01A_LoginRP.jsp'; + $kcbForm_action = 'https://tmpin.ok-name.co.kr:5443/tis/ti/POTI01A_LoginRP.jsp'; } $idpCode = 'V'; diff --git a/plugin/sms5/sms5.lib.php b/plugin/sms5/sms5.lib.php index ea587384a..8979454dc 100644 --- a/plugin/sms5/sms5.lib.php +++ b/plugin/sms5/sms5.lib.php @@ -26,7 +26,7 @@ function sms5_sub_paging($write_pages, $cur_page, $total_page, $url, $add="", $s if( $starget ){ $url = preg_replace('#&'.$starget.'=[0-9]*#', '', $url) . '&'.$starget.'='; } - + $str = ''; if ($cur_page > 1) { $str .= '처음'.PHP_EOL; @@ -154,180 +154,331 @@ if ( ! function_exists('is_ie')) { * 접속, 발송, URL발송, 결과등의 실질적으로 쓰이는 모든 부분이 포함되어 있다. */ -class SMS5 extends SMS { - var $Log = array(); +if($config['cf_sms_type'] == 'LMS') { + include_once(G5_LIB_PATH.'/icode.lms.lib.php'); - function SMS_con($sms_server,$sms_id,$sms_pw,$port) { - $this->ID=$sms_id; // 계약 후 지정 - $this->PWD=$sms_pw; // 계약 후 지정 - $this->SMS_Server=$sms_server; - $this->SMS_Port=$port; - $this->ID = spacing($this->ID,10); - $this->PWD = spacing($this->PWD,10); - } + class SMS5 extends LMS { + var $icode_id; + var $icode_pw; + var $socket_host; + var $socket_port; + var $socket_portcode; + var $send_type; + var $Data = array(); + var $Result = array(); + var $Log = array(); - /** - * 발송번호의 값이 정확한 값인지 확인합니다. - * - * @param strDest 발송번호 배열입니다. - * nCount 배열의 크기입니다. - * @return 처리결과입니다. - */ - function CheckCommonTypeDest($strDest, $nCount) { - for ($i=0; $i<$nCount; $i++) { - $hp_number = preg_replace("/[^0-9]/","",$strDest[$i]['bk_hp']); - if (strlen($hp_number)<10 || strlen($hp_number)>11) return "휴대폰 번호가 틀렸습니다"; - - $CID=substr($hp_number,0,3); - if ( preg_match("/[^0-9]/",$CID) || ($CID!='010' && $CID!='011' && $CID!='016' && $CID!='017' && $CID!='018' && $CID!='019') ) return "휴대폰 앞자리 번호가 잘못되었습니다"; + // SMS 서버 접속 + function SMS_con($host, $id, $pw, $portcode) { + $this->socket_host = $host; + $this->socket_portcode = $portcode; + $this->icode_id = FillSpace($id, 10); + $this->icode_pw = FillSpace($pw, 10); } - } - /** - * 회신번호의 값이 정확한 값인지 확인합니다. - * - * @param strDest 회신번호입니다. - * @return 처리결과입니다. - */ - function CheckCommonTypeCallBack($strCallBack) { - if (preg_match("/[^0-9]/", $strCallBack)) return "회신 전화번호가 잘못되었습니다"; - } - - - /** - * 예약날짜의 값이 정확한 값인지 확인합니다. - * - * @param text 원하는 문자열입니다. - * size 원하는 길이입니다. - * @return 처리결과입니다. - */ - function CheckCommonTypeDate($strDate) { - $strDate=preg_replace("/[^0-9]/","",$strDate); - if ($strDate) { - if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($rsvTime,0,4))) return "예약날짜가 잘못되었습니다"; - if (substr($strDate,8,2)>23 || substr($strDate,10,2)>59) return "예약시간이 잘못되었습니다"; + function Init() { + $this->Data = ""; // 발송하기 위한 패킷내용이 배열로 들어간다. + $this->Result = ""; // 발송결과값이 배열로 들어간다. } - } + function Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate="", $nCount) { + // EUC-KR로 변환 + $strCaller = iconv_euckr($strCaller); + $strSubject = iconv_euckr($strSubject); + $strData = iconv_euckr($strData); - /** - * URL콜백용으로 메세지 크기를 수정합니다. - * - * @param url URL 내용입니다. - * msg 결과메시지입니다. - * desk 문자내용입니다. - */ - function CheckCallCenter($url, $dest, $data) { - switch (substr($dest,0,3)) { - case '010': //20바이트 - return cut_char($data,20); - break; - case '011': //80바이트 - return cut_char($data,80); - break; - case '016': // 80바이트 - return cut_char($data,80); - break; - case '017': // URL 포함 80바이트 - return cut_char($data,80 - strlen($url)); - break; - case '018': // 20바이트 - return cut_char($data,20); - break; - case '019': // 20바이트 - return cut_char($data,20); - break; - default: - return cut_char($data,80); - break; - } - } - function Add($strDest, $strCallBack, $strCaller, $strURL, $strMessage, $strDate="", $nCount) { - global $g5; + // 문자 타입별 Port 설정. + $sendType = strlen($strData) > 90 ? 1 : 0; // 0: SMS / 1: LMS - $Error = $this->CheckCommonTypeDest($strDest, $nCount); - $Error = $this->CheckCommonTypeCallBack($strCallBack); - $Error = $this->CheckCommonTypeDate($strDate); + /* 개발 완료 후 아래 포트를 rand 함수를 이용하는 라인으로 변경 바랍니다.*/ - $strCallBack = spacing($strCallBack,11); - $strCaller = spacing($strCaller,10); - $strDate = spacing($strDate,12); - - - for ($i=0; $i<$nCount; $i++) { - $hp_number = spacing($strDest[$i]['bk_hp'],11); - $strData = $strMessage; - if( !empty($strDest[$i]['bk_name']) ){ - $strData = str_replace("{이름}", $strDest[$i]['bk_name'], $strData); + // 충전식 + if ($this->socket_portcode == 1) { + if($sendType && $sendType == 1) { + //$this->socket_port = 8200; // LMS + $this->socket_port=(int)rand(8200,8201); // LMS + } else { + //$this->socket_port = 6295; // SMS + $this->socket_port=(int)rand(6295,6297); // SMS + } } - // 아이코드에서는 문자에 utf-8 인코딩 형식을 아직 지원하지 않는다. - $strData = iconv('utf-8', "euc-kr", stripslashes($strData)); - - if (!$strURL) { - $strData = spacing(cut_char($strData,80),80); - - $this->Data[$i] = '01144 '.$this->ID.$this->PWD.$hp_number.$strCallBack.$strCaller.$strDate.$strData; - } else { - $strURL = spacing($strURL,50); - $strData = spacing($this->CheckCallCenter($strURL, $hp_number, $strData),80); - - $this->Data[$i] = '05173 '.$this->ID.$this->PWD.$hp_number.$strCallBack.$strURL.$strDate.$strData; - } - } - return true; // 수정대기 - } - - function Send() { - global $g5; - - $count = 1; - - if ($g5['sms5_demo_send']) { - foreach($this->Data as $puts) { - if (rand(0,10)) { - $phone = substr($puts,26,11); - $code = '47022497 '; + // 정액제 + else { + if($sendType && $sendType == 1) { + //$this->socket_port = 8300; // LMS + $this->socket_port=(int)rand(8300,8301); // LMS } else { - $phone = substr($puts,26,11); - $code = 'Error(02)'; + //$this->socket_port = 6291; // SMS + $this->socket_port=(int)rand(6291,6293); // SMS } - $this->Result[] = "$phone:$code"; - $this->Log[] = $puts; } + + $strCallBack = FillSpace($strCallBack, 11); // 회신번호 + $strDate = FillSpace($strDate, 12); // 즉시(12byte 공백), 예약전송(YmdHi) + + if ($sendType && $sendType == 1) { + + /** LMS 제목 **/ + /* + 제목필드의 값이 없을 경우 단말기 기종및 설정에 따라 표기 방법이 다름 + 1.설정에서 제목필드보기 설정 Disable -> 제목필드값을 넣어도 미표기 + 2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시 + + 제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망 + */ + $strSubject = str_replace("\r\n", " ", $strSubject); + $strSubject = str_replace("<", "[", $strSubject); + $strSubject = str_replace(">", "]", $strSubject); + + $strSubject = FillSpace($strSubject,30); + $strData = FillSpace(CutChar($strData,1500),1500); + } else if (!$strURL) { + $strData = FillSpace(CutChar($strData,90),90); + $strCaller = FillSpace($strCaller,10); + } else { + $strURL = FillSpace($strURL,50); + } + + $Error = CheckCommonTypeDest($strDest, $nCount); + $Error = is_vaild_callback($strCallBack); + $Error = CheckCommonTypeDate($strDate); + + for ($i=0; $i<$nCount; $i++) { + $strDest[$i] = FillSpace($strDest[$i],11); + if ($sendType && $sendType == 1) { + $this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strSubject.$strDate.$strData; + } else if (!$strURL) { + $this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strCaller.$strDate.$strData; + } else { + $strData = FillSpace(CheckCallCenter($strURL, $strDest[$i], $strData),80); + $this->Data[$i] = '05173 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strURL.$strDate.$strData; + } + } + return true; + } + + + function Send() { + global $g5; + + if ($g5['sms5_demo_send']) { + foreach($this->Data as $puts) { + if (rand(0,10)) { + $phone = substr($puts,26,11); + $code = '47022497 '; + } else { + $phone = substr($puts,26,11); + $code = 'Error(02)'; + } + $this->Result[] = "$phone:$code"; + $this->Log[] = $puts; + } + $this->Data = ""; + return true; + exit; + } + + $fsocket = fsockopen($this->socket_host,$this->socket_port, $errno, $errstr, 2); + if (!$fsocket) return false; + set_time_limit(300); + + foreach($this->Data as $puts) { + fputs($fsocket, $puts); + while(!$gets) { $gets = fgets($fsocket,30); } + $dest = substr($puts,26,11); + if (substr($gets,0,19) == "0223 00".$dest) { + $this->Result[] = $dest.":".substr($gets,19,10); + $this->Log[] = $puts; + } else { + $this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")"; + $this->Log[] = $puts; + } + $gets = ""; + } + + fclose($fsocket); $this->Data = ""; return true; - exit; + } + } +} else { + include_once(G5_LIB_PATH.'/icode.sms.lib.php'); + + class SMS5 extends SMS { + var $Log = array(); + + function SMS_con($sms_server,$sms_id,$sms_pw,$port) { + $this->ID=$sms_id; // 계약 후 지정 + $this->PWD=$sms_pw; // 계약 후 지정 + $this->SMS_Server=$sms_server; + $this->SMS_Port=$port; + $this->ID = spacing($this->ID,10); + $this->PWD = spacing($this->PWD,10); } - $fsocket=fsockopen($this->SMS_Server,$this->SMS_Port); - if (!$fsocket) return false; - set_time_limit(300); + /** + * 발송번호의 값이 정확한 값인지 확인합니다. + * + * @param strDest 발송번호 배열입니다. + * nCount 배열의 크기입니다. + * @return 처리결과입니다. + */ + function CheckCommonTypeDest($strDest, $nCount) { + for ($i=0; $i<$nCount; $i++) { + $hp_number = preg_replace("/[^0-9]/","",$strDest[$i]['bk_hp']); + if (strlen($hp_number)<10 || strlen($hp_number)>11) return "휴대폰 번호가 틀렸습니다"; - ## php4.3.10일경우 - ## zend 최신버전으로 업해주세요.. - ## 또는 69번째 줄을 $this->Data as $tmp => $puts 로 변경해 주세요. - - foreach($this->Data as $puts) { - $dest = substr($puts,26,11); - fputs($fsocket, $puts); - while(!$gets) { - $gets = fgets($fsocket,30); - } - if (substr($gets,0,19) == "0223 00".$dest) { - $this->Result[] = $dest.":".substr($gets,19,10); - $this->Log[] = $puts; - } else { - $this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")"; - $this->Log[] = $puts; + $CID=substr($hp_number,0,3); + if ( preg_match("/[^0-9]/",$CID) || ($CID!='010' && $CID!='011' && $CID!='016' && $CID!='017' && $CID!='018' && $CID!='019') ) return "휴대폰 앞자리 번호가 잘못되었습니다"; } - $gets = ""; + } - // 1천건씩 전송 후 5초 쉼 - if ($count++%1000 == 0) sleep(5); - } - fclose($fsocket); - $this->Data = ""; - return true; - } + /** + * 회신번호의 값이 정확한 값인지 확인합니다. + * + * @param strDest 회신번호입니다. + * @return 처리결과입니다. + */ + function CheckCommonTypeCallBack($strCallBack) { + if (preg_match("/[^0-9]/", $strCallBack)) return "회신 전화번호가 잘못되었습니다"; + } + + + /** + * 예약날짜의 값이 정확한 값인지 확인합니다. + * + * @param text 원하는 문자열입니다. + * size 원하는 길이입니다. + * @return 처리결과입니다. + */ + function CheckCommonTypeDate($strDate) { + $strDate=preg_replace("/[^0-9]/","",$strDate); + if ($strDate) { + if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($rsvTime,0,4))) return "예약날짜가 잘못되었습니다"; + if (substr($strDate,8,2)>23 || substr($strDate,10,2)>59) return "예약시간이 잘못되었습니다"; + } + } + + + /** + * URL콜백용으로 메세지 크기를 수정합니다. + * + * @param url URL 내용입니다. + * msg 결과메시지입니다. + * desk 문자내용입니다. + */ + function CheckCallCenter($url, $dest, $data) { + switch (substr($dest,0,3)) { + case '010': //20바이트 + return cut_char($data,20); + break; + case '011': //80바이트 + return cut_char($data,80); + break; + case '016': // 80바이트 + return cut_char($data,80); + break; + case '017': // URL 포함 80바이트 + return cut_char($data,80 - strlen($url)); + break; + case '018': // 20바이트 + return cut_char($data,20); + break; + case '019': // 20바이트 + return cut_char($data,20); + break; + default: + return cut_char($data,80); + break; + } + } + function Add($strDest, $strCallBack, $strCaller, $strURL, $strMessage, $strDate="", $nCount) { + global $g5; + + $Error = $this->CheckCommonTypeDest($strDest, $nCount); + $Error = $this->CheckCommonTypeCallBack($strCallBack); + $Error = $this->CheckCommonTypeDate($strDate); + + $strCallBack = spacing($strCallBack,11); + $strCaller = spacing($strCaller,10); + $strDate = spacing($strDate,12); + + + for ($i=0; $i<$nCount; $i++) { + $hp_number = spacing($strDest[$i]['bk_hp'],11); + $strData = $strMessage; + if( !empty($strDest[$i]['bk_name']) ){ + $strData = str_replace("{이름}", $strDest[$i]['bk_name'], $strData); + } + // 아이코드에서는 문자에 utf-8 인코딩 형식을 아직 지원하지 않는다. + $strData = iconv('utf-8', "euc-kr", stripslashes($strData)); + + if (!$strURL) { + $strData = spacing(cut_char($strData,80),80); + + $this->Data[$i] = '01144 '.$this->ID.$this->PWD.$hp_number.$strCallBack.$strCaller.$strDate.$strData; + } else { + $strURL = spacing($strURL,50); + $strData = spacing($this->CheckCallCenter($strURL, $hp_number, $strData),80); + + $this->Data[$i] = '05173 '.$this->ID.$this->PWD.$hp_number.$strCallBack.$strURL.$strDate.$strData; + } + } + return true; // 수정대기 + } + + function Send() { + global $g5; + + $count = 1; + + if ($g5['sms5_demo_send']) { + foreach($this->Data as $puts) { + if (rand(0,10)) { + $phone = substr($puts,26,11); + $code = '47022497 '; + } else { + $phone = substr($puts,26,11); + $code = 'Error(02)'; + } + $this->Result[] = "$phone:$code"; + $this->Log[] = $puts; + } + $this->Data = ""; + return true; + exit; + } + + $fsocket=fsockopen($this->SMS_Server,$this->SMS_Port); + if (!$fsocket) return false; + set_time_limit(300); + + ## php4.3.10일경우 + ## zend 최신버전으로 업해주세요.. + ## 또는 69번째 줄을 $this->Data as $tmp => $puts 로 변경해 주세요. + + foreach($this->Data as $puts) { + $dest = substr($puts,26,11); + fputs($fsocket, $puts); + while(!$gets) { + $gets = fgets($fsocket,30); + } + if (substr($gets,0,19) == "0223 00".$dest) { + $this->Result[] = $dest.":".substr($gets,19,10); + $this->Log[] = $puts; + } else { + $this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")"; + $this->Log[] = $puts; + } + $gets = ""; + + // 1천건씩 전송 후 5초 쉼 + if ($count++%1000 == 0) sleep(5); + } + fclose($fsocket); + $this->Data = ""; + return true; + } + } } ?> \ No newline at end of file diff --git a/plugin/sms5/write.php b/plugin/sms5/write.php index eb63d2739..4a9cf412e 100644 --- a/plugin/sms5/write.php +++ b/plugin/sms5/write.php @@ -1,6 +1,9 @@ ', 0 +
임시 저장된 글 목록 diff --git a/skin/board/gallery/write.skin.php b/skin/board/gallery/write.skin.php index 898489957..e8bcf7bd6 100644 --- a/skin/board/gallery/write.skin.php +++ b/skin/board/gallery/write.skin.php @@ -111,6 +111,7 @@ add_stylesheet('', 0 +
임시 저장된 글 목록 diff --git a/skin/member/basic/formmail.skin.php b/skin/member/basic/formmail.skin.php index 76e7bc910..9f821b06a 100644 --- a/skin/member/basic/formmail.skin.php +++ b/skin/member/basic/formmail.skin.php @@ -14,7 +14,7 @@ add_stylesheet('', - + diff --git a/skin/member/basic/register_form.skin.php b/skin/member/basic/register_form.skin.php index f531052ae..3f2076758 100644 --- a/skin/member/basic/register_form.skin.php +++ b/skin/member/basic/register_form.skin.php @@ -22,8 +22,8 @@ add_stylesheet('', date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400))) { // 닉네임수정일이 지나지 않았다면 ?> - - + +
@@ -60,7 +60,7 @@ add_stylesheet('', 아이핀 본인확인 후에는 이름이 자동 입력되고 휴대폰 본인확인 후에는 이름과 휴대폰번호가 자동 입력되어 수동으로 입력할수 없게 됩니다. - class="frm_input " size="10"> + class="frm_input " size="10"> ', 공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
닉네임을 바꾸시면 앞으로 일 이내에는 변경 할 수 없습니다. - - + + @@ -116,14 +116,14 @@ add_stylesheet('', - class="frm_input " size="70" maxlength="255"> + class="frm_input " size="70" maxlength="255"> - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> @@ -131,9 +131,9 @@ add_stylesheet('', - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> - + @@ -149,14 +149,14 @@ add_stylesheet('', class="frm_input " size="5" maxlength="6">
- class="frm_input frm_address " size="50"> + class="frm_input frm_address " size="50">
- +
- + - + diff --git a/skin/popular/basic/popular.skin.php b/skin/popular/basic/popular.skin.php index 14fe12281..49e0b99e6 100644 --- a/skin/popular/basic/popular.skin.php +++ b/skin/popular/basic/popular.skin.php @@ -11,7 +11,7 @@ add_stylesheet('',

인기검색어

    -
  • +
diff --git a/skin/qa/basic/write.skin.php b/skin/qa/basic/write.skin.php index d81465a50..088914615 100644 --- a/skin/qa/basic/write.skin.php +++ b/skin/qa/basic/write.skin.php @@ -53,7 +53,7 @@ add_stylesheet('', 0); - class="frm_input email" size="50" maxlength="100"> + class="frm_input email" size="50" maxlength="100"> > @@ -64,7 +64,7 @@ add_stylesheet('', 0); - class="frm_input" size="30"> + class="frm_input" size="30"> > 답변등록 SMS알림 수신 @@ -75,7 +75,7 @@ add_stylesheet('', 0); - + diff --git a/theme/basic/head.sub.php b/theme/basic/head.sub.php index 78a36adff..6eb194fdc 100644 --- a/theme/basic/head.sub.php +++ b/theme/basic/head.sub.php @@ -85,7 +85,7 @@ if ($is_member) { // 회원이라면 로그인 중이라는 메세지를 출력 else if ($is_admin == 'group') $sr_admin_msg = "그룹관리자 "; else if ($is_admin == 'board') $sr_admin_msg = "게시판관리자 "; - echo '
'.$sr_admin_msg.$member['mb_nick'].'님 로그인 중 '; + echo '
'.$sr_admin_msg.get_text($member['mb_nick']).'님 로그인 중 '; echo '로그아웃
'; } ?> \ No newline at end of file diff --git a/theme/basic/mobile/skin/board/basic/write.skin.php b/theme/basic/mobile/skin/board/basic/write.skin.php index b28d9abb7..aa5f5b4ad 100644 --- a/theme/basic/mobile/skin/board/basic/write.skin.php +++ b/theme/basic/mobile/skin/board/basic/write.skin.php @@ -193,8 +193,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -243,7 +242,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/theme/basic/mobile/skin/board/gallery/write.skin.php b/theme/basic/mobile/skin/board/gallery/write.skin.php index f40d8db61..4aec1baaf 100644 --- a/theme/basic/mobile/skin/board/gallery/write.skin.php +++ b/theme/basic/mobile/skin/board/gallery/write.skin.php @@ -192,8 +192,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -242,7 +241,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/theme/basic/mobile/skin/member/basic/formmail.skin.php b/theme/basic/mobile/skin/member/basic/formmail.skin.php index 3add8546b..bb1c32e7c 100644 --- a/theme/basic/mobile/skin/member/basic/formmail.skin.php +++ b/theme/basic/mobile/skin/member/basic/formmail.skin.php @@ -13,7 +13,7 @@ add_stylesheet('', - + diff --git a/theme/basic/mobile/skin/member/basic/register_form.skin.php b/theme/basic/mobile/skin/member/basic/register_form.skin.php index 9b783960b..941399c9f 100644 --- a/theme/basic/mobile/skin/member/basic/register_form.skin.php +++ b/theme/basic/mobile/skin/member/basic/register_form.skin.php @@ -20,8 +20,8 @@ add_stylesheet('', date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400))) { // 닉네임수정일이 지나지 않았다면 ?> - - + +
@@ -55,7 +55,7 @@ add_stylesheet('', 아이핀 본인확인 후에는 이름이 자동 입력되고 휴대폰 본인확인 후에는 이름과 휴대폰번호가 자동 입력되어 수동으로 입력할수 없게 됩니다. - class="frm_input "> + class="frm_input "> ', 공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
닉네임을 바꾸시면 앞으로 일 이내에는 변경 할 수 없습니다. - - + + @@ -111,14 +111,14 @@ add_stylesheet('', - " maxlength="255" > + " maxlength="255" > - " maxlength="20" > + " maxlength="20" > @@ -126,9 +126,9 @@ add_stylesheet('', - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> - + @@ -145,13 +145,13 @@ add_stylesheet('', class="frm_input " size="5" maxlength="6">
- class="frm_input frm_address " size="50">
+ class="frm_input frm_address " size="50">
- +
- - + + diff --git a/theme/basic/mobile/skin/popular/basic/popular.skin.php b/theme/basic/mobile/skin/popular/basic/popular.skin.php index 463b3b01c..436883642 100644 --- a/theme/basic/mobile/skin/popular/basic/popular.skin.php +++ b/theme/basic/mobile/skin/popular/basic/popular.skin.php @@ -10,7 +10,7 @@ add_stylesheet('',

인기검색어

    -
  • +
diff --git a/theme/basic/mobile/skin/qa/basic/write.skin.php b/theme/basic/mobile/skin/qa/basic/write.skin.php index 39118b80b..adbcbdfbb 100644 --- a/theme/basic/mobile/skin/qa/basic/write.skin.php +++ b/theme/basic/mobile/skin/qa/basic/write.skin.php @@ -53,7 +53,7 @@ add_stylesheet('', 0); - class="frm_input email" maxlength="100"> + class="frm_input email" maxlength="100"> > @@ -64,7 +64,7 @@ add_stylesheet('', 0); - class="frm_input" size="30"> + class="frm_input" size="30"> > 답변등록 SMS알림 수신 @@ -75,7 +75,7 @@ add_stylesheet('', 0); - + diff --git a/theme/basic/skin/board/basic/write.skin.php b/theme/basic/skin/board/basic/write.skin.php index f0e7e91e8..34d190e7e 100644 --- a/theme/basic/skin/board/basic/write.skin.php +++ b/theme/basic/skin/board/basic/write.skin.php @@ -111,6 +111,7 @@ add_stylesheet('', 0 +
임시 저장된 글 목록 diff --git a/theme/basic/skin/board/gallery/write.skin.php b/theme/basic/skin/board/gallery/write.skin.php index 898489957..e8bcf7bd6 100644 --- a/theme/basic/skin/board/gallery/write.skin.php +++ b/theme/basic/skin/board/gallery/write.skin.php @@ -111,6 +111,7 @@ add_stylesheet('', 0 +
임시 저장된 글 목록 diff --git a/theme/basic/skin/member/basic/formmail.skin.php b/theme/basic/skin/member/basic/formmail.skin.php index 76e7bc910..5d1ec65b5 100644 --- a/theme/basic/skin/member/basic/formmail.skin.php +++ b/theme/basic/skin/member/basic/formmail.skin.php @@ -14,7 +14,7 @@ add_stylesheet('', - + diff --git a/theme/basic/skin/member/basic/register_form.skin.php b/theme/basic/skin/member/basic/register_form.skin.php index 16d6181e8..8ea552e93 100644 --- a/theme/basic/skin/member/basic/register_form.skin.php +++ b/theme/basic/skin/member/basic/register_form.skin.php @@ -22,8 +22,8 @@ add_stylesheet('', date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400))) { // 닉네임수정일이 지나지 않았다면 ?> - - + +
@@ -60,7 +60,7 @@ add_stylesheet('', 아이핀 본인확인 후에는 이름이 자동 입력되고 휴대폰 본인확인 후에는 이름과 휴대폰번호가 자동 입력되어 수동으로 입력할수 없게 됩니다. - class="frm_input " size="10"> + class="frm_input " size="10"> ', 공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
닉네임을 바꾸시면 앞으로 일 이내에는 변경 할 수 없습니다. - - + + @@ -116,14 +116,14 @@ add_stylesheet('', - class="frm_input " size="70" maxlength="255"> + class="frm_input " size="70" maxlength="255"> - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> @@ -131,9 +131,9 @@ add_stylesheet('', - class="frm_input " maxlength="20"> + class="frm_input " maxlength="20"> - + @@ -149,14 +149,14 @@ add_stylesheet('', class="frm_input " size="5" maxlength="6">
- class="frm_input frm_address " size="50"> + class="frm_input frm_address " size="50">
- +
- + - + diff --git a/theme/basic/skin/popular/basic/popular.skin.php b/theme/basic/skin/popular/basic/popular.skin.php index 14fe12281..49e0b99e6 100644 --- a/theme/basic/skin/popular/basic/popular.skin.php +++ b/theme/basic/skin/popular/basic/popular.skin.php @@ -11,7 +11,7 @@ add_stylesheet('',

인기검색어

    -
  • +
diff --git a/theme/basic/skin/qa/basic/write.skin.php b/theme/basic/skin/qa/basic/write.skin.php index d81465a50..088914615 100644 --- a/theme/basic/skin/qa/basic/write.skin.php +++ b/theme/basic/skin/qa/basic/write.skin.php @@ -53,7 +53,7 @@ add_stylesheet('', 0); - class="frm_input email" size="50" maxlength="100"> + class="frm_input email" size="50" maxlength="100"> > @@ -64,7 +64,7 @@ add_stylesheet('', 0); - class="frm_input" size="30"> + class="frm_input" size="30"> > 답변등록 SMS알림 수신 @@ -75,7 +75,7 @@ add_stylesheet('', 0); - +