merge
This commit is contained in:
@ -31,6 +31,7 @@ $sql = " insert into {$g4['board_table']}
|
||||
bo_subject = '$target_subject',
|
||||
gr_id = '{$board['gr_id']}',
|
||||
bo_admin = '{$board['bo_admin']}',
|
||||
<<<<<<< HEAD
|
||||
bo_list_level = '{$board['bo_list_level']}',
|
||||
bo_read_level = '{$board['bo_read_level']}',
|
||||
bo_write_level = '{$board['bo_write_level']}',
|
||||
@ -48,6 +49,24 @@ $sql = " insert into {$g4['board_table']}
|
||||
bo_comment_point = '{$board['bo_comment_point']}',
|
||||
bo_download_point = '{$board['bo_download_point']}',
|
||||
bo_use_category = '{$board['bo_use_category']}',
|
||||
=======
|
||||
bo_list_level = '{$board[bo_list_level]}',
|
||||
bo_read_level = '{$board[bo_read_level]}',
|
||||
bo_write_level = '{$board[bo_write_level]}',
|
||||
bo_reply_level = '{$board[bo_reply_level]}',
|
||||
bo_comment_level = '{$board[bo_comment_level]}',
|
||||
bo_upload_level = '{$board[bo_upload_level]}',
|
||||
bo_download_level = '{$board[bo_download_level]}',
|
||||
bo_html_level = '{$board[bo_html_level]}',
|
||||
bo_link_level = '{$board[bo_link_level]}',
|
||||
bo_count_modify = '{$board[bo_count_modify]}',
|
||||
bo_count_delete = '{$board[bo_count_delete]}',
|
||||
bo_read_point = '{$board[bo_read_point]}',
|
||||
bo_write_point = '{$board[bo_write_point]}',
|
||||
bo_comment_point = '{$board[bo_comment_point]}',
|
||||
bo_download_point = '{$board[bo_download_point]}',
|
||||
bo_use_category = '{$board[bo_use_category]}',
|
||||
>>>>>>> 6040266aed7f782fddaf6f63366be5b06bdfa780
|
||||
bo_category_list = '{$board['bo_category_list']}',
|
||||
bo_disable_tags = '{$board['bo_disable_tags']}',
|
||||
<<<<<<< HEAD
|
||||
@ -68,8 +87,11 @@ $sql = " insert into {$g4['board_table']}
|
||||
bo_use_nogood = '{$board[bo_use_nogood]}',
|
||||
bo_use_signature = '{$board[bo_use_signature]}',
|
||||
bo_use_ip_view = '{$board[bo_use_ip_view]}',
|
||||
<<<<<<< HEAD
|
||||
bo_use_trackback = '{$board[bo_use_trackback]}',
|
||||
>>>>>>> 35e2a0e57216e9ff77b98266f30f5e8f87800654
|
||||
=======
|
||||
>>>>>>> 6040266aed7f782fddaf6f63366be5b06bdfa780
|
||||
bo_use_list_view = '{$board['o_use_list_view']}',
|
||||
bo_use_list_content = '{$board['bo_use_list_content']}',
|
||||
bo_table_width = '{$board['bo_table_width']}',
|
||||
|
||||
@ -254,17 +254,6 @@ include_once ('./admin.head.php');
|
||||
<label for="chk_html_level">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_trackback_level">트랙백쓰기 권한</label></th>
|
||||
<td>
|
||||
<?=help('트랙백이란? 쉽게 설명하여 "내가 작성하는 글을 다른사람에게 알리는 기능" 입니다.'.PHP_EOL.'자세한 내용은 검색엔진에서 "트랙백"으로 검색을 해보시기 바랍니다.')?>
|
||||
<?=get_member_level_select('bo_trackback_level', 1, 10, $board['bo_trackback_level']) ?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_trackback_level" name="chk_trackback_level" value="1">
|
||||
<label for="chk_trackback_level">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -406,17 +395,6 @@ include_once ('./admin.head.php');
|
||||
<label for="chk_use_ip_view">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_trackback">트랙백 사용</label></th>
|
||||
<td>
|
||||
<input type="checkbox" id="bo_use_trackback" name="bo_use_trackback" value="1" <?=$board['bo_use_trackback']?'checked':'';?>>
|
||||
사용 (트랙백쓰기 권한 보다 우선함)
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_use_trackback" name="chk_use_trackback" value="1">
|
||||
<label for="chk_use_trackback">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_list_content">목록에서 내용 사용</label></th>
|
||||
<td>
|
||||
|
||||
@ -152,7 +152,6 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
|
||||
bo_comment_level = '{$_POST[bo_comment_level]}',
|
||||
bo_html_level = '{$_POST[bo_html_level]}',
|
||||
bo_link_level = '{$_POST[bo_link_level]}',
|
||||
bo_trackback_level = '{$_POST[bo_trackback_level]}',
|
||||
bo_count_modify = '{$_POST[bo_count_modify]}',
|
||||
bo_count_delete = '{$_POST[bo_count_delete]}',
|
||||
bo_upload_level = '{$_POST[bo_upload_level]}',
|
||||
@ -174,7 +173,6 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
|
||||
bo_use_name = '{$_POST[bo_use_name]}',
|
||||
bo_use_signature = '{$_POST[bo_use_signature]}',
|
||||
bo_use_ip_view = '{$_POST[bo_use_ip_view]}',
|
||||
bo_use_trackback = '{$_POST[bo_use_trackback]}',
|
||||
bo_use_list_view = '{$_POST[bo_use_list_view]}',
|
||||
bo_use_list_content = '{$_POST[bo_use_list_content]}',
|
||||
bo_use_email = '{$_POST[bo_use_email]}',
|
||||
@ -331,7 +329,6 @@ if ($chk_link_level) $s .= " , bo_link_level = '{$bo_link_level}' ";
|
||||
if ($chk_upload_level) $s .= " , bo_upload_level = '{$bo_upload_level}' ";
|
||||
if ($chk_download_level) $s .= " , bo_download_level = '{$bo_download_level}' ";
|
||||
if ($chk_html_level) $s .= " , bo_html_level = '{$bo_html_level}' ";
|
||||
if ($chk_trackback_level) $s .= " , bo_trackback_level = '{$bo_trackback_level}' ";
|
||||
if ($chk_count_modify) $s .= " , bo_count_modify = '{$bo_count_modify}' ";
|
||||
if ($chk_count_delete) $s .= " , bo_count_delete = '{$bo_count_delete}' ";
|
||||
if ($chk_read_point) $s .= " , bo_read_point = '{$bo_read_point}' ";
|
||||
@ -352,7 +349,6 @@ if ($chk_use_nogood) $s .= " , bo_use_nogood = '{$bo_use_nogood}' ";
|
||||
if ($chk_use_name) $s .= " , bo_use_name = '{$bo_use_name}' ";
|
||||
if ($chk_use_signature) $s .= " , bo_use_signature = '{$bo_use_signature}' ";
|
||||
if ($chk_use_ip_view) $s .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
|
||||
if ($chk_use_trackback) $s .= " , bo_use_trackback = '{$bo_use_trackback}' ";
|
||||
if ($chk_use_list_view) $s .= " , bo_use_list_view = '{$bo_use_list_view}' ";
|
||||
if ($chk_use_list_content) $s .= " , bo_use_list_content = '{$bo_use_list_content}' ";
|
||||
if ($chk_use_email) $s .= " , bo_use_email = '{$bo_use_email}' ";
|
||||
|
||||
@ -23,17 +23,21 @@ include_once($g4['path'].'/head.sub.php');
|
||||
<article id="validation_check">
|
||||
<header>
|
||||
<hgroup>
|
||||
<h1>회원가입 정보 입력 확인</h1> <!-- 수행 중이던 작업 내용 -->
|
||||
<h2>다음 항목을 입력하지 않으셨거나 입력에 오류가 있습니다.</h2>
|
||||
<!-- <h1>회원가입 정보 입력 확인</h1> --> <!-- 수행 중이던 작업 내용 -->
|
||||
<h1><?=$header?></h1> <!-- 수행 중이던 작업 내용 -->
|
||||
<h2>다음 항목<!-- 을 입력하지 않으셨거나 입력 -->에 오류가 있습니다.</h2>
|
||||
</hgroup>
|
||||
</header>
|
||||
<p>
|
||||
<!-- <strong>항목</strong> 오류내역 -->
|
||||
<!--
|
||||
<strong>이름</strong> 필수 입력입니다. 한글만 입력할 수 있습니다.<br>
|
||||
<strong>이메일</strong> 올바르게 입력하지 않았습니다.<br>
|
||||
-->
|
||||
<?=$msg?>
|
||||
</p>
|
||||
|
||||
<a href="#">돌아가기</a>
|
||||
<a href="<?=$url?>">돌아가기</a>
|
||||
</article>
|
||||
|
||||
<?
|
||||
|
||||
233
bbs/kcaptcha.php
233
bbs/kcaptcha.php
@ -1,233 +0,0 @@
|
||||
<?php
|
||||
|
||||
# KCAPTCHA PROJECT VERSION 1.2.6
|
||||
|
||||
# Automatic test to tell computers and humans apart
|
||||
|
||||
# Copyright by Kruglov Sergei, 2006, 2007, 2008
|
||||
# www.captcha.ru, www.kruglov.ru
|
||||
|
||||
# System requirements: PHP 4.0.6+ w/ GD
|
||||
|
||||
# KCAPTCHA is a free software. You can freely use it for building own site or software.
|
||||
# If you use this software as a part of own sofware, you must leave copyright notices intact or add KCAPTCHA copyright notices to own.
|
||||
# As a default configuration, KCAPTCHA has a small credits text at bottom of CAPTCHA image.
|
||||
# You can remove it, but I would be pleased if you left it. ;)
|
||||
|
||||
# See kcaptcha_config.php for customization
|
||||
|
||||
class KCAPTCHA{
|
||||
|
||||
// generates keystring and image
|
||||
function image(){
|
||||
require(dirname(__FILE__).'/kcaptcha_config.php');
|
||||
|
||||
$fonts=array();
|
||||
$fontsdir_absolute=dirname(__FILE__).'/'.$fontsdir;
|
||||
if ($handle = opendir($fontsdir_absolute)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (preg_match('/\.png$/i', $file)) {
|
||||
$fonts[]=$fontsdir_absolute.'/'.$file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
$alphabet_length=strlen($alphabet);
|
||||
|
||||
do{
|
||||
/*
|
||||
// generating random keystring
|
||||
while(true){
|
||||
$this->keystring='';
|
||||
for($i=0;$i<$length;$i++){
|
||||
$this->keystring.=$allowed_symbols{mt_rand(0,strlen($allowed_symbols)-1)};
|
||||
}
|
||||
if(!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/', $this->keystring)) break;
|
||||
}
|
||||
*/
|
||||
|
||||
$font_file=$fonts[mt_rand(0, count($fonts)-1)];
|
||||
$font=imagecreatefrompng($font_file);
|
||||
imagealphablending($font, true);
|
||||
$fontfile_width=imagesx($font);
|
||||
$fontfile_height=imagesy($font)-1;
|
||||
$font_metrics=array();
|
||||
$symbol=0;
|
||||
$reading_symbol=false;
|
||||
|
||||
// loading font
|
||||
for($i=0;$i<$fontfile_width && $symbol<$alphabet_length;$i++){
|
||||
$transparent = (imagecolorat($font, $i, 0) >> 24) == 127;
|
||||
|
||||
if(!$reading_symbol && !$transparent){
|
||||
$font_metrics[$alphabet{$symbol}]=array('start'=>$i);
|
||||
$reading_symbol=true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if($reading_symbol && $transparent){
|
||||
$font_metrics[$alphabet{$symbol}]['end']=$i;
|
||||
$reading_symbol=false;
|
||||
$symbol++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$img=imagecreatetruecolor($width, $height);
|
||||
imagealphablending($img, true);
|
||||
$white=imagecolorallocate($img, 255, 255, 255);
|
||||
$black=imagecolorallocate($img, 0, 0, 0);
|
||||
|
||||
imagefilledrectangle($img, 0, 0, $width-1, $height-1, $white);
|
||||
|
||||
// draw text
|
||||
$x=1;
|
||||
for($i=0;$i<strlen($this->keystring);$i++){
|
||||
$m=$font_metrics[$this->keystring{$i}];
|
||||
|
||||
$y=mt_rand(-$fluctuation_amplitude, $fluctuation_amplitude)+($height-$fontfile_height)/2+2;
|
||||
|
||||
if($no_spaces){
|
||||
$shift=0;
|
||||
if($i>0){
|
||||
$shift=10000;
|
||||
for($sy=7;$sy<$fontfile_height-20;$sy+=1){
|
||||
for($sx=$m['start']-1;$sx<$m['end'];$sx+=1){
|
||||
$rgb=imagecolorat($font, $sx, $sy);
|
||||
$opacity=$rgb>>24;
|
||||
if($opacity<127){
|
||||
$left=$sx-$m['start']+$x;
|
||||
$py=$sy+$y;
|
||||
if($py>$height) break;
|
||||
for($px=min($left,$width-1);$px>$left-12 && $px>=0;$px-=1){
|
||||
$color=imagecolorat($img, $px, $py) & 0xff;
|
||||
if($color+$opacity<190){
|
||||
if($shift>$left-$px){
|
||||
$shift=$left-$px;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($shift==10000){
|
||||
$shift=mt_rand(4,6);
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
$shift=1;
|
||||
}
|
||||
imagecopy($img, $font, $x-$shift, $y, $m['start'], 1, $m['end']-$m['start'], $fontfile_height);
|
||||
$x+=$m['end']-$m['start']-$shift;
|
||||
}
|
||||
}while($x>=$width-10); // while not fit in canvas
|
||||
|
||||
$center=$x/2;
|
||||
|
||||
// credits. To remove, see configuration file
|
||||
$img2=imagecreatetruecolor($width, $height+($show_credits?12:0));
|
||||
$foreground=imagecolorallocate($img2, $foreground_color[0], $foreground_color[1], $foreground_color[2]);
|
||||
$background=imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]);
|
||||
imagefilledrectangle($img2, 0, 0, $width-1, $height-1, $background);
|
||||
imagefilledrectangle($img2, 0, $height, $width-1, $height+12, $foreground);
|
||||
$credits=empty($credits)?$_SERVER['HTTP_HOST']:$credits;
|
||||
imagestring($img2, 2, $width/2-imagefontwidth(2)*strlen($credits)/2, $height-2, $credits, $background);
|
||||
|
||||
// periods
|
||||
$rand1=mt_rand(750000,1200000)/10000000;
|
||||
$rand2=mt_rand(750000,1200000)/10000000;
|
||||
$rand3=mt_rand(750000,1200000)/10000000;
|
||||
$rand4=mt_rand(750000,1200000)/10000000;
|
||||
// phases
|
||||
$rand5=mt_rand(0,31415926)/10000000;
|
||||
$rand6=mt_rand(0,31415926)/10000000;
|
||||
$rand7=mt_rand(0,31415926)/10000000;
|
||||
$rand8=mt_rand(0,31415926)/10000000;
|
||||
// amplitudes
|
||||
$rand9=mt_rand(330,420)/110;
|
||||
$rand10=mt_rand(330,450)/110;
|
||||
|
||||
//wave distortion
|
||||
|
||||
for($x=0;$x<$width;$x++){
|
||||
for($y=0;$y<$height;$y++){
|
||||
if ($wave) {
|
||||
$sx=$x+(sin($x*$rand1+$rand5)+sin($y*$rand3+$rand6))*$rand9-$width/2+$center+1;
|
||||
$sy=$y+(sin($x*$rand2+$rand7)+sin($y*$rand4+$rand8))*$rand10;
|
||||
}
|
||||
else {
|
||||
$sx=$x-$width/2+$center+1;
|
||||
$sy=$y+(sin($x*$rand2+$rand7)+sin($y*$rand4+$rand8))*1.5;
|
||||
}
|
||||
|
||||
if($sx<0 || $sy<0 || $sx>=$width-1 || $sy>=$height-1){
|
||||
continue;
|
||||
}else{
|
||||
$color=imagecolorat($img, $sx, $sy) & 0xFF;
|
||||
$color_x=imagecolorat($img, $sx+1, $sy) & 0xFF;
|
||||
$color_y=imagecolorat($img, $sx, $sy+1) & 0xFF;
|
||||
$color_xy=imagecolorat($img, $sx+1, $sy+1) & 0xFF;
|
||||
}
|
||||
|
||||
if($color==255 && $color_x==255 && $color_y==255 && $color_xy==255){
|
||||
continue;
|
||||
}else if($color==0 && $color_x==0 && $color_y==0 && $color_xy==0){
|
||||
$newred=$foreground_color[0];
|
||||
$newgreen=$foreground_color[1];
|
||||
$newblue=$foreground_color[2];
|
||||
}else{
|
||||
$frsx=$sx-floor($sx);
|
||||
$frsy=$sy-floor($sy);
|
||||
$frsx1=1-$frsx;
|
||||
$frsy1=1-$frsy;
|
||||
|
||||
$newcolor=(
|
||||
$color*$frsx1*$frsy1+
|
||||
$color_x*$frsx*$frsy1+
|
||||
$color_y*$frsx1*$frsy+
|
||||
$color_xy*$frsx*$frsy);
|
||||
|
||||
if($newcolor>255) $newcolor=255;
|
||||
$newcolor=$newcolor/255;
|
||||
$newcolor0=1-$newcolor;
|
||||
|
||||
$newred=$newcolor0*$foreground_color[0]+$newcolor*$background_color[0];
|
||||
$newgreen=$newcolor0*$foreground_color[1]+$newcolor*$background_color[1];
|
||||
$newblue=$newcolor0*$foreground_color[2]+$newcolor*$background_color[2];
|
||||
}
|
||||
|
||||
imagesetpixel($img2, $x, $y, imagecolorallocate($img2, $newred, $newgreen, $newblue));
|
||||
}
|
||||
}
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
if(function_exists("imagejpeg")){
|
||||
header("Content-Type: image/jpeg");
|
||||
imagejpeg($img2, null, $jpeg_quality);
|
||||
}else if(function_exists("imagegif")){
|
||||
header("Content-Type: image/gif");
|
||||
imagegif($img2);
|
||||
}else if(function_exists("imagepng")){
|
||||
header("Content-Type: image/x-png");
|
||||
imagepng($img2);
|
||||
}
|
||||
}
|
||||
|
||||
// returns keystring
|
||||
function getKeyString(){
|
||||
return $this->keystring;
|
||||
}
|
||||
|
||||
function setKeyString($str){
|
||||
$this->keystring = $str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
# KCAPTCHA configuration file
|
||||
|
||||
$alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; # do not change without changing font files!
|
||||
|
||||
# symbols used to draw CAPTCHA
|
||||
$allowed_symbols = "0123456789"; #digits
|
||||
//$allowed_symbols = "23456789abcdeghkmnpqsuvxyz"; #alphabet without similar symbols (o=0, 1=l, i=j, t=f)
|
||||
|
||||
# folder with fonts
|
||||
$fontsdir = 'fonts';
|
||||
|
||||
# CAPTCHA string length
|
||||
$length = mt_rand(5,6); # random 5 or 6
|
||||
//$length = 5;
|
||||
|
||||
# CAPTCHA image size (you do not need to change it, whis parameters is optimal)
|
||||
$width = 120;
|
||||
$height = 60;
|
||||
|
||||
# symbol's vertical fluctuation amplitude divided by 2
|
||||
$fluctuation_amplitude = 5;
|
||||
|
||||
# increase safety by prevention of spaces between symbols
|
||||
$no_spaces = true;
|
||||
|
||||
# show credits
|
||||
$show_credits = false; # set to false to remove credits line. Credits adds 12 pixels to image height
|
||||
$credits = 'www.captcha.ru'; # if empty, HTTP_HOST will be shown
|
||||
|
||||
# CAPTCHA image colors (RGB, 0-255)
|
||||
//$foreground_color = array(0, 0, 0);
|
||||
//$background_color = array(220, 230, 255);
|
||||
$foreground_color = array(mt_rand(0,100), mt_rand(0,100), mt_rand(0,100));
|
||||
$background_color = array(mt_rand(200,255), mt_rand(200,255), mt_rand(200,255));
|
||||
|
||||
# JPEG quality of CAPTCHA image (bigger is better quality, but larger file size)
|
||||
$jpeg_quality = 90;
|
||||
|
||||
$wave = false;
|
||||
?>
|
||||
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
include_once("_common.php");
|
||||
//error_reporting (E_ALL);
|
||||
include('kcaptcha.php');
|
||||
|
||||
//session_start();
|
||||
$captcha = new KCAPTCHA();
|
||||
$captcha->setKeyString(get_session("captcha_keystring"));
|
||||
$captcha->getKeyString();
|
||||
$captcha->image();
|
||||
?>
|
||||
@ -1,13 +0,0 @@
|
||||
<?
|
||||
// 캡챠 세션값과 비교하여 맞는지? 틀린지? 결과값을 출력합니다.
|
||||
include_once("_common.php");
|
||||
header("Content-Type: text/html; charset=$g4[charset]");
|
||||
|
||||
$count = (int)get_session("captcha_count");
|
||||
if ($count >= 5) { // 설정값 이상이면 자동등록방지 입력 문자가 맞아도 오류 처리
|
||||
echo false;
|
||||
} else {
|
||||
set_session("captcha_count", $count + 1);
|
||||
echo (get_session("captcha_keystring") == $_POST['captcha_key']) ? true : false;
|
||||
}
|
||||
?>
|
||||
@ -1,19 +0,0 @@
|
||||
<?
|
||||
include_once("_common.php");
|
||||
header("Content-Type: text/html; charset=$g4[charset]");
|
||||
require(dirname(__FILE__).'/kcaptcha_config.php');
|
||||
include('kcaptcha.php');
|
||||
|
||||
while(true){
|
||||
$keystring='';
|
||||
for($i=0;$i<$length;$i++){
|
||||
$keystring.=$allowed_symbols{mt_rand(0,strlen($allowed_symbols)-1)};
|
||||
}
|
||||
if(!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/', $keystring)) break;
|
||||
}
|
||||
|
||||
set_session("captcha_count", 0);
|
||||
set_session("captcha_keystring", $keystring);
|
||||
$captcha = new KCAPTCHA();
|
||||
$captcha->setKeyString(get_session("captcha_keystring"));
|
||||
?>
|
||||
@ -1,6 +1,8 @@
|
||||
<?
|
||||
include_once('./_common.php');
|
||||
|
||||
$g4['title'] = "로그인 검사";
|
||||
|
||||
$mb_id = $_POST['mb_id'];
|
||||
$mb_password = $_POST['mb_password'];
|
||||
|
||||
@ -23,23 +25,23 @@ $mb = get_member($mb_id);
|
||||
// 회원아이디를 입력해 보고 맞으면 또 패스워드를 입력해보는 경우를 방지하기 위해서입니다.
|
||||
// 불법사용자의 경우 회원아이디가 틀린지, 패스워드가 틀린지를 알기까지는 많은 시간이 소요되기 때문입니다.
|
||||
if (!$mb['mb_id'] || (sql_password($mb_password) != $mb['mb_password'])) {
|
||||
alert('가입된 회원이 아니거나 패스워드가 틀립니다.\n\n패스워드는 대소문자를 구분합니다.');
|
||||
alert('가입된 회원아이디가 아니거나 패스워드가 틀립니다.\n패스워드는 대소문자를 구분합니다.');
|
||||
}
|
||||
|
||||
// 차단된 아이디인가?
|
||||
if ($mb['mb_intercept_date'] && $mb['mb_intercept_date'] <= date("Ymd", $g4['server_time'])) {
|
||||
$date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1년 \\2월 \\3일", $mb['mb_intercept_date']);
|
||||
alert('회원님의 아이디는 접근이 금지되어 있습니다.\n\n처리일 : '.$date);
|
||||
alert('회원님의 아이디는 접근이 금지되어 있습니다.\n처리일 : '.$date);
|
||||
}
|
||||
|
||||
// 탈퇴한 아이디인가?
|
||||
if ($mb['mb_leave_date'] && $mb['mb_leave_date'] <= date("Ymd", $g4['server_time'])) {
|
||||
$date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1년 \\2월 \\3일", $mb['mb_leave_date']);
|
||||
alert('탈퇴한 아이디이므로 접근하실 수 없습니다.\n\n탈퇴일 : '.$date);
|
||||
alert('탈퇴한 아이디이므로 접근하실 수 없습니다.\n탈퇴일 : '.$date);
|
||||
}
|
||||
|
||||
if ($config['cf_use_email_certify'] && !preg_match("/[1-9]/", $mb['mb_email_certify']))
|
||||
alert('메일인증을 받으셔야 로그인 하실 수 있습니다.\n\n회원님의 메일주소는 '.$mb['mb_email'].' 입니다.');
|
||||
alert('메일인증을 받으셔야 로그인 하실 수 있습니다.\n회원님의 메일주소는 '.$mb['mb_email'].' 입니다.');
|
||||
|
||||
$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin'];
|
||||
@include_once($member_skin_path.'/login_check.skin.php');
|
||||
|
||||
@ -59,7 +59,6 @@ while ($row = sql_fetch_array($result))
|
||||
wr_link2 = '".addslashes($row2[wr_link2])."',
|
||||
wr_link1_hit = '$row2[wr_link1_hit]',
|
||||
wr_link2_hit = '$row2[wr_link2_hit]',
|
||||
wr_trackback = '".addslashes($row2[wr_trackback])."',
|
||||
wr_hit = '$row2[wr_hit]',
|
||||
wr_good = '$row2[wr_good]',
|
||||
wr_nogood = '$row2[wr_nogood]',
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
/*
|
||||
** $norobot_str 와 $_SESSION[ss_norobot_key] 을 반환함
|
||||
*/
|
||||
|
||||
// 자동등록기를 막아볼까요?
|
||||
$is_norobot = false;
|
||||
if ($config[cf_use_norobot]) {
|
||||
// 임의의 md5 문자열을 생성
|
||||
$tmp_str = substr(md5($g4[server_time]),0,12);
|
||||
// 난수 발생기
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
$seed = (float)$sec + ((float)$usec * 100000);
|
||||
srand($seed);
|
||||
$keylen = strlen($tmp_str);
|
||||
$div = (int)($keylen / 2);
|
||||
while (count($arr) < 4)
|
||||
{
|
||||
unset($arr);
|
||||
for ($i=0; $i<$keylen; $i++)
|
||||
{
|
||||
$rnd = rand(1, $keylen);
|
||||
$arr[$rnd] = $rnd;
|
||||
if ($rnd > $div) break;
|
||||
}
|
||||
}
|
||||
|
||||
// 배열에 저장된 숫자를 차례대로 정렬
|
||||
sort($arr);
|
||||
|
||||
$norobot_key = '';
|
||||
$norobot_str = '';
|
||||
$m = 0;
|
||||
for ($i=0; $i<count($arr); $i++)
|
||||
{
|
||||
for ($k=$m; $k<$arr[$i]-1; $k++)
|
||||
$norobot_str .= $tmp_str[$k];
|
||||
$norobot_str .= '<font size=3 color=#FF0000><b>'.$tmp_str[$k].'</b></font>';
|
||||
$norobot_key .= $tmp_str[$k];
|
||||
$m = $k + 1;
|
||||
}
|
||||
|
||||
if ($m < $keylen) {
|
||||
for ($k=$m; $k<$keylen; $k++)
|
||||
$norobot_str .= $tmp_str[$k];
|
||||
}
|
||||
|
||||
$norobot_str = '<font color=#999999>'.$norobot_str.'</font>';
|
||||
|
||||
// 입력, 답변이면서 회원이 아닐 경우만 자동등록방지 사용
|
||||
if (($w == '' || $w == 'r') && !$member[mb_id]) {
|
||||
set_session("ss_norobot_key", $norobot_key);
|
||||
$is_norobot = true;
|
||||
}
|
||||
else
|
||||
set_session("ss_norobot_key", "");
|
||||
}
|
||||
?>
|
||||
<script> var md5_norobot_key = '<?=md5($norobot_key)?>'; </script>
|
||||
@ -1,31 +0,0 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// norobot.inc.php 가 선행된 후 사용
|
||||
|
||||
// 자동등록방지 검사
|
||||
if ($config[cf_use_norobot]) {
|
||||
/*
|
||||
// 우선 이 URL 로 부터 온것인지 검사
|
||||
$parse = parse_url($_SERVER[HTTP_REFERER]);
|
||||
// 3.35
|
||||
// 포트번호가 존재할 경우의 처리 (mumu님께서 알려주셨습니다)
|
||||
$parse2 = explode(':', $_SERVER[HTTP_HOST]);
|
||||
if ($parse[host] != $parse2[0]) {
|
||||
//if ($parse[host] != $_SERVER[HTTP_HOST]) {
|
||||
alert('올바른 접근이 아닌것 같습니다.', './');
|
||||
}
|
||||
*/
|
||||
|
||||
$key = $_SESSION[ss_norobot_key];
|
||||
if (($w=='' || $w=='c') && !$member[mb_id]) {
|
||||
if ($key) {
|
||||
if ($key != $_POST[wr_key]) {
|
||||
alert('정상적인 등록이 아닌것 같습니다.');
|
||||
}
|
||||
} else {
|
||||
alert('정상적인 접근이 아닌것 같습니다.');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,54 +0,0 @@
|
||||
<?
|
||||
include_once('./_common.php');
|
||||
|
||||
function echo_check_image($str, $width, $height, $background_color, $text_color, $grid_color)
|
||||
{
|
||||
$number = $str;
|
||||
|
||||
$background_color = str_replace('#', '', $background_color);
|
||||
$text_color = str_replace('#', '', $text_color);
|
||||
$grid_color = str_replace('#', '', $grid_color);
|
||||
|
||||
// WebColor -> RGB
|
||||
$BR = hexdec(substr($background_color, 0, 2));
|
||||
$BG = hexdec(substr($background_color, 2, 2));
|
||||
$BB = hexdec(substr($background_color, 4, 2));
|
||||
|
||||
$TR = hexdec(substr($text_color, 0, 2));
|
||||
$TG = hexdec(substr($text_color, 2, 2));
|
||||
$TB = hexdec(substr($text_color, 4, 2));
|
||||
|
||||
$GR = hexdec(substr($grid_color, 0, 2));
|
||||
$GG = hexdec(substr($grid_color, 2, 2));
|
||||
$GB = hexdec(substr($grid_color, 4, 2));
|
||||
|
||||
$im = @imagecreate($width, $height) or die("Cannot Initialize new GD image stream");
|
||||
header ("Content-type: image/png");
|
||||
|
||||
$background_color = imagecolorallocate($im, $BR, $BG, $BB);
|
||||
$text_color = imagecolorallocate($im, $TR, $TG, $TB);
|
||||
$grid_color = imagecolorallocate($im, $GR, $GG, $GB);
|
||||
|
||||
|
||||
image_random_grid($im, $width, $height, 5, $grid_color);
|
||||
imagestring($im, rand(4,6), rand(5,15), rand(1,3), $number, $text_color);
|
||||
imagepng($im);
|
||||
imagedestroy($im);
|
||||
}
|
||||
|
||||
function image_random_grid($im, $w, $h, $s, $color)
|
||||
{
|
||||
for($i=1; $i<$w/$s; $i++) {
|
||||
$tmp = rand($s-$s/3, $s+$s/3);
|
||||
imageline($im, $i*$tmp, 0, $i*$tmp, $h, $color);
|
||||
}
|
||||
|
||||
for($i=1; $i<$h/$s; $i++) {
|
||||
$tmp = rand($s-$s/3, $s+$s/3);
|
||||
imageline($im, 0, $i*$tmp, $w, $i*$tmp, $color);
|
||||
}
|
||||
}
|
||||
|
||||
//echo_check_image(rand(4,6), 65, 20, "#FF33CC", "#FFFFFF", "#FF79DE");
|
||||
echo_check_image($_SESSION['ss_norobot_key'], 80, 19, '#FF33CC', '#FFFFFF', '#FF79DE');
|
||||
?>
|
||||
@ -1,35 +1,40 @@
|
||||
<?
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($w == 'u')
|
||||
$action = './write.php';
|
||||
else if ($w == 'd')
|
||||
$action = './delete.php';
|
||||
else if ($w == 'x')
|
||||
$action = './delete_comment.php';
|
||||
else if ($w == 's')
|
||||
{
|
||||
// 패스워드 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
|
||||
if ($is_admin || ($member[mb_id] == $write[mb_id] && $write[mb_id]))
|
||||
goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
|
||||
else
|
||||
$action = './password_check.php';
|
||||
}
|
||||
else
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
|
||||
$g4['title'] = '패스워드 입력';
|
||||
|
||||
switch ($w) {
|
||||
case 'u' :
|
||||
$action = './write.php';
|
||||
break;
|
||||
case 'd' :
|
||||
$action = './delete.php';
|
||||
break;
|
||||
case 'x' :
|
||||
$action = './delete_comment.php';
|
||||
break;
|
||||
case 's' :
|
||||
// 패스워드 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
|
||||
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
|
||||
goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
|
||||
else
|
||||
$action = './password_check.php';
|
||||
break;
|
||||
default :
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
}
|
||||
|
||||
include_once($g4['path'].'/head.sub.php');
|
||||
|
||||
if ($board[bo_include_head]) { @include ($board[bo_include_head]); }
|
||||
if ($board[bo_content_head]) { echo stripslashes($board[bo_content_head]); }
|
||||
if ($board['bo_include_head']) { @include ($board['bo_include_head']); }
|
||||
if ($board['bo_content_head']) { echo stripslashes($board['bo_content_head']); }
|
||||
|
||||
$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin];
|
||||
$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin'];
|
||||
|
||||
include_once($member_skin_path.'/password.skin.php');
|
||||
|
||||
if ($board[bo_content_tail]) { echo stripslashes($board[bo_content_tail]); }
|
||||
if ($board[bo_include_tail]) { @include ($board[bo_include_tail]); }
|
||||
if ($board['bo_content_tail']) { echo stripslashes($board['bo_content_tail']); }
|
||||
if ($board['bo_include_tail']) { @include ($board['bo_include_tail']); }
|
||||
|
||||
include_once($g4['path'].'/tail.sub.php');
|
||||
?>
|
||||
|
||||
194
bbs/tb.php
194
bbs/tb.php
@ -1,194 +0,0 @@
|
||||
<?
|
||||
//
|
||||
// 트랙백 핑 받는 페이지
|
||||
//
|
||||
define("_GNUBOARD_", TRUE);
|
||||
|
||||
include_once('./_common.php');
|
||||
// 오류는 write_log() 함수로 남긴다.
|
||||
include_once($g4['path'].'/lib/etc.lib.php');
|
||||
|
||||
function tb_xml_msg($error, $msg='')
|
||||
{
|
||||
global $g4;
|
||||
|
||||
$s = '';
|
||||
$s .= '<?xml version="1.0" encoding="'.$g4[charset].'"?>'.PHP_EOL;
|
||||
$s .= '<response>'.PHP_EOL;
|
||||
$s .= '<error>'.$error.'</error>'.PHP_EOL;
|
||||
$s .= '<message>'.$msg.'</message>'.PHP_EOL;
|
||||
$s .= '</response>'.PHP_EOL;
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
$arr = explode("/", $_SERVER[PATH_INFO]);
|
||||
// 영문자 숫자 _ 과 일치하지 않는 문자는 삭제한다. (최대 20자)
|
||||
$bo_table = preg_replace("/\W/", "", substr($arr[1],0,20));
|
||||
// 정수형으로 변환
|
||||
$wr_id = (int)$arr[2];
|
||||
// 영소문자 숫자 와 일치하지 않는 문자는 삭제한다. (최대 32자)
|
||||
$to_token = preg_replace("/[^a-z0-9]/", "", substr($arr[3],0,32));
|
||||
|
||||
$write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름
|
||||
|
||||
$sql = " select wr_id, ca_name, wr_email from {$write_table} where wr_id = '{$wr_id}' ";
|
||||
$wr = sql_fetch($sql, FALSE);
|
||||
|
||||
// wr_id가 없거나 트랙백으로 넘어온게 아니라면
|
||||
if (!$wr[wr_id] || !($_POST[title] && $_POST[excerpt] && $_POST[url] && $_POST[blog_name]))
|
||||
{
|
||||
$tmp_dir = str_replace('/tb.php', '', $_SERVER[SCRIPT_NAME]);
|
||||
header('location:'.$tmp_dir.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$to_token)
|
||||
{
|
||||
if (isset($_POST))
|
||||
write_log($g4['path'].'/data/log/tb.log', $_POST);
|
||||
|
||||
echo tb_xml_msg(1, '토큰값이 넘어오지 않았습니다.');
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = " select to_token from {$g4[token_table]} where to_token = '{$to_token}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[to_token] && $to_token)
|
||||
{
|
||||
// 두번 이상 트랙백을 보내지 못하도록 하기 위하여 토큰을 삭제한다
|
||||
sql_query(" delete from {$g4[token_table]} where to_token = '{$to_token}' ");
|
||||
|
||||
// 토큰검사 (3시간 이상 지난 토큰은 삭제)
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
|
||||
$sql = " delete from {$g4[token_table]} where to_datetime < '".date("Y-m-d", $g4[server_time] - 3600 * $g4['token_time'])."' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo tb_xml_msg(1, '트랙백 주소가 올바르지 않습니다. (토큰 유효시간 경과 등)');
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $_POST[title];
|
||||
$excerpt = $_POST[excerpt];
|
||||
|
||||
if (strlen($title) > 255) $title = cut_str($title, 255);
|
||||
if (strlen($excerpt) > 255) $excerpt = cut_str($excerpt, 255);
|
||||
|
||||
$msg = "";
|
||||
// 두번씩 INSERT 되는것을 막기 위해
|
||||
if ($_POST[title])
|
||||
{
|
||||
$board = sql_fetch(" select bo_subject, bo_use_trackback from {$g4[board_table]} where bo_table = '{$bo_table}' ");
|
||||
if (!$board[bo_use_trackback])
|
||||
$msg = '트랙백 사용이 금지된 게시판입니다.';
|
||||
|
||||
if (!$msg)
|
||||
{
|
||||
$next_num = get_next_num($write_table);
|
||||
|
||||
$sql = " select max(wr_comment) as max_comment from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
$row[max_comment] += 1;
|
||||
|
||||
$sql = " insert into {$g4[write_prefix]}{$bo_table}
|
||||
set wr_num = '{$next_num}',
|
||||
wr_parent = '{$wr_id}',
|
||||
wr_is_comment = 1,
|
||||
wr_comment = '{$row[max_comment]}',
|
||||
wr_content = '{$title}\n{$excerpt}',
|
||||
wr_trackback = '{$_POST[url]}',
|
||||
wr_name = '{$_POST[blog_name]}',
|
||||
wr_password = '".sql_password($g4[server_time])."',
|
||||
wr_datetime = '{$g4[time_ymdhis]}',
|
||||
wr_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$result = sql_query($sql, FALSE);
|
||||
if ($result)
|
||||
{
|
||||
$comment_id = mysql_insert_id();
|
||||
sql_query(" update {$write_table} set wr_comment = wr_comment + 1 where wr_id = '{$wr_id}' ", FALSE);
|
||||
sql_query(" insert into {$g4[board_new_table]} ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '{$bo_table}', '{$comment_id}', '{$wr_id}', '{$g4[time_ymdhis]}' ) ");
|
||||
sql_query(" update {$g4[board_table]} set bo_count_comment = bo_count_comment + 1 where bo_table = '{$bo_table}' ", FALSE);
|
||||
} else
|
||||
$msg = "$write_table TABLE INSERT 오류";
|
||||
}
|
||||
|
||||
//write_log("$g4['path']/data/log/aaa", $msg);
|
||||
|
||||
if ($msg) // 비정상(오류)
|
||||
{
|
||||
echo tb_xml_msg(1, $msg);
|
||||
exit;
|
||||
}
|
||||
else // 정상
|
||||
{
|
||||
// 메일발송 사용
|
||||
if ($config[cf_email_use] && $board[bo_use_email])
|
||||
{
|
||||
include_once($g4['path'].'/lib/mailer.lib.php');
|
||||
|
||||
// 관리자의 정보를 얻고
|
||||
$super_admin = get_admin('super');
|
||||
$group_admin = get_admin('group');
|
||||
$board_admin = get_admin('board');
|
||||
|
||||
$wr_name = $blog_name = get_text(stripslashes($_POST[blog_name]));
|
||||
$wr_subject = $title = get_text(stripslashes($title));
|
||||
$wr_content = $excerpt = nl2br(get_text(stripslashes($excerpt)));
|
||||
|
||||
$link_url = 'http://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI];
|
||||
|
||||
$subject = $board[bo_subject].' 게시판에 트랙백에 의한 글이 올라왔습니다.';
|
||||
|
||||
define("_GNUBOARD_", TRUE);
|
||||
ob_start();
|
||||
include_once ('./write_update_mail.php');
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
// 게시판 관리자에게 보내는 메일
|
||||
if ($config[cf_email_wr_board_admin])
|
||||
mailer($blog_name, '', $board_admin[mb_email], $subject, $content, 1);
|
||||
|
||||
// 그룹 관리자에게 보내는 메일
|
||||
if ($group_admin[mb_email] != $board_admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_group_admin])
|
||||
mailer($blog_name, '', $group_admin[mb_email], $subject, $content, 1);
|
||||
}
|
||||
|
||||
// 최고관리자에게 보내는 메일
|
||||
if ($super_admin[mb_email] != $board_admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_super_admin])
|
||||
mailer($blog_name, '', $super_admin[mb_email], $subject, $content, 1);
|
||||
}
|
||||
|
||||
// 답변 메일받기 (원게시자에게 보내는 메일)
|
||||
//if ($wr[wr_recv_email] && $wr[wr_email] && $wr[wr_email] != $admin[mb_email])
|
||||
if (strstr($wr[wr_option], 'mail') && $wr[wr_email] && $wr[wr_email] != $admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_write])
|
||||
mailer($blog_name, "", $wr[wr_email], $subject, $content, 1);
|
||||
|
||||
// 코멘트 쓴 모든이에게 메일 발송
|
||||
if ($config[cf_email_wr_comment_all])
|
||||
{
|
||||
$sql = " select wr_email from {$write_table}
|
||||
where wr_email not in ( '{$admin[mb_email]}' , '{$wr[wr_email]}', '' )
|
||||
and wr_parent = '{$wr_id}'
|
||||
group by wr_email ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result))
|
||||
mailer($blog_name, '', $row[wr_email], $subject, $content, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo tb_xml_msg(0, '');
|
||||
?>
|
||||
@ -1,37 +0,0 @@
|
||||
<?
|
||||
// 토큰 생성
|
||||
include_once('./_common.php');
|
||||
|
||||
// 오류는 write_log() 로 잡는다.
|
||||
include_once($g4['path'].'/lib/etc.lib.php');
|
||||
//write_log($g4['path'].'/lib/log/aaa', 1);
|
||||
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
|
||||
$sql = " delete from {$g4[token_table]}
|
||||
where to_datetime < '".date("Y-m-d", $g4[server_time] - 86400 * $g4['token_time'])."' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " select count(*) as cnt from {$g4[token_table]}
|
||||
where to_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] >= 100)
|
||||
return;
|
||||
|
||||
$i=0;
|
||||
while(1) {
|
||||
$token = md5(uniqid(rand(), true));
|
||||
$sql = " insert into g4_token
|
||||
set to_token = '{$token}',
|
||||
to_datetime = '{$g4['time_ymdhis']}',
|
||||
to_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$result = sql_query($sql, FALSE);
|
||||
if ($result)
|
||||
break;
|
||||
// 무한루프방지
|
||||
if ($i++ >= 10)
|
||||
break;
|
||||
}
|
||||
echo $token;
|
||||
?>
|
||||
@ -126,14 +126,6 @@ if (strstr($sfl, 'content'))
|
||||
//$view['rich_content'] = preg_replace("/{img\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view['content']);
|
||||
$view['rich_content'] = preg_replace("/{이미지\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view['content']);
|
||||
|
||||
// 트랙백
|
||||
$trackback_url = '';
|
||||
if ($member['mb_level'] >= $board['bo_trackback_level']) {
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
$trackback_url = $g4['url'].'/'.$g4['bbs'].'/tb.php/'.$bo_table.'/'.$wr_id;
|
||||
}
|
||||
|
||||
$is_signature = false;
|
||||
$signature = '';
|
||||
if ($board['bo_use_signature'] && $view['mb_id']) {
|
||||
|
||||
@ -45,7 +45,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
|
||||
}
|
||||
|
||||
$list[$i]['trackback'] = url_auto_link($row['wr_trackback']);
|
||||
$list[$i]['datetime'] = substr($row['wr_datetime'],2,14);
|
||||
|
||||
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?
|
||||
include_once('./_common.php');
|
||||
if ($editor->lib)
|
||||
include_once($editor->lib);
|
||||
|
||||
if (isset($editor->lib)) include_once($editor->lib);
|
||||
if (isset($captcha->lib)) include_once($captcha->lib);
|
||||
|
||||
set_session('ss_bo_table', $bo_table);
|
||||
set_session('ss_wr_id', $wr_id);
|
||||
@ -252,12 +253,6 @@ if ($board['bo_use_file_content']) {
|
||||
$is_file_content = true;
|
||||
}
|
||||
|
||||
// 트랙백
|
||||
$is_trackback = false;
|
||||
if ($board['bo_use_trackback'] && $member['mb_level'] >= $board['bo_trackback_level']) {
|
||||
$is_trackback = true;
|
||||
}
|
||||
|
||||
$name = "";
|
||||
$email = "";
|
||||
$homepage = "";
|
||||
@ -274,7 +269,6 @@ if ($w == "" || $w == "r") {
|
||||
$html_checked = "";
|
||||
$html_value = "";
|
||||
$secret_checked = "";
|
||||
$trackback = "";
|
||||
|
||||
if ($w == '') {
|
||||
$password_required = 'required';
|
||||
@ -298,8 +292,6 @@ if ($w == '') {
|
||||
$link[$i] = $write['wr_link'.$i];
|
||||
}
|
||||
|
||||
$trackback = $write['wr_trackback'];
|
||||
|
||||
if (strstr($write['wr_option'], 'html1')) {
|
||||
$html_checked = 'checked';
|
||||
$html_value = 'html1';
|
||||
@ -360,9 +352,15 @@ if ($is_admin) {
|
||||
$write_max = (int)$board['bo_write_max'];
|
||||
}
|
||||
|
||||
if ($is_dhtml_editor && $editor->js) {
|
||||
array_push($g4['js_file'], $editor->js);
|
||||
array_push($g4['js_file'], $editor->config_js);
|
||||
if ($is_dhtml_editor && isset($editor->js)) {
|
||||
$g4['js_file'][] = $editor->js;
|
||||
if (isset($editor->config_js)) {
|
||||
$g4['js_file'][] = $editor->config_js;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($captcha->js)) {
|
||||
$g4['js_file'][] = $captcha->js;
|
||||
}
|
||||
|
||||
include_once($g4['path'].'/head.sub.php');
|
||||
@ -396,6 +394,11 @@ if ($file_length < 0) {
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
if ($g4['https_url'])
|
||||
$action_url = "{$g4['https_url']}/{$g4['bbs']}/write_update.php";
|
||||
else
|
||||
$action_url = "{$g4['bbs_path']}/write_update.php";
|
||||
|
||||
include_once ($board_skin_path.'/write.skin.php');
|
||||
|
||||
include_once('./board_tail.php');
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<?
|
||||
include_once('./_common.php');
|
||||
|
||||
if (isset($captcha->lib)) include_once($captcha->lib);
|
||||
|
||||
// 090710
|
||||
if (substr_count($wr_content, '&#') > 50) {
|
||||
alert('내용에 올바르지 않은 코드가 다수 포함되어 있습니다.');
|
||||
@ -9,8 +11,6 @@ if (substr_count($wr_content, '&#') > 50) {
|
||||
|
||||
@include_once($board_skin_path.'/write_update.head.skin.php');
|
||||
|
||||
include_once($g4['path'].'/lib/trackback.lib.php');
|
||||
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
|
||||
if (empty($_POST))
|
||||
@ -124,17 +124,8 @@ if ($w == "" || $w == "r")
|
||||
alert('동일한 내용을 연속해서 등록할 수 없습니다.');
|
||||
}
|
||||
|
||||
// 자동등록방지 검사
|
||||
//include_once ("./norobot_check.inc.php");
|
||||
|
||||
if (!$is_member) {
|
||||
if ($w=='' || $w=='r') {
|
||||
$key = get_session("captcha_keystring");
|
||||
if (!($key && $key == $_POST['wr_key'])) {
|
||||
session_unregister("captcha_keystring");
|
||||
alert('정상적인 접근이 아닌것 같습니다.');
|
||||
}
|
||||
}
|
||||
if (!chk_captcha()) {
|
||||
alert('자동등록방지의 답변으로 입력한 숫자가 틀렸습니다.');
|
||||
}
|
||||
|
||||
if (!isset($_POST['wr_subject']) || !trim($_POST['wr_subject']))
|
||||
@ -298,7 +289,6 @@ if ($w == '' || $w == 'r')
|
||||
wr_link2 = '{$wr_link2}',
|
||||
wr_link1_hit = 0,
|
||||
wr_link2_hit = 0,
|
||||
wr_trackback = '{$wr_trackback}',
|
||||
wr_hit = 0,
|
||||
wr_good = 0,
|
||||
wr_nogood = 0,
|
||||
@ -602,18 +592,6 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
|
||||
// 사용자 코드 실행
|
||||
@include_once ($board_skin_path.'/write_update.skin.php');
|
||||
|
||||
// 트랙백 주소가 있다면
|
||||
if (($w != 'u' && $wr_trackback) || ($w=='u' && $wr_trackback && $re_trackback))
|
||||
{
|
||||
$trackback_url = $g4['url'].'/'.$g4['bbs'].'/tb.php/'.$bo_table.'/'.$wr_id;
|
||||
$msg = "";
|
||||
$msg = send_trackback($wr_trackback, $trackback_url, $wr_subject, $board['bo_subject'], $_POST['wr_content']);
|
||||
if ($msg) {
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset='.$g4['charset'].'">'.PHP_EOL;
|
||||
echo '<script>alert('.$msg.' '.$wr_trackback.');</script>';
|
||||
}
|
||||
}
|
||||
|
||||
@include_once($board_skin_path.'/write_update.tail.skin.php');
|
||||
if ($g4['https_url'])
|
||||
$https_url = $g4['url'].'/'.$g4['bbs'];
|
||||
|
||||
@ -466,7 +466,7 @@ if (!get_cookie('ck_first_referer')) set_cookie('ck_first_referer', $_SERVER['H
|
||||
// 회원, 비회원 구분
|
||||
$is_member = $is_guest = false;
|
||||
$is_admin = "";
|
||||
if (array_key_exists('mb_id', $member)) {
|
||||
if (isset($member['mb_id'])) {
|
||||
$is_member = true;
|
||||
$is_admin = is_admin($member['mb_id']);
|
||||
$member['mb_dir'] = substr($member['mb_id'],0,2);
|
||||
|
||||
8
extend/tcaptcha.extend.php
Normal file
8
extend/tcaptcha.extend.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$captcha = (object)array(
|
||||
'lib' => $g4['path']."/plugin/tcaptcha/tcaptcha.lib.php",
|
||||
'js' => $g4['path']."/plugin/tcaptcha/tcaptcha.js"
|
||||
);
|
||||
?>
|
||||
@ -4,7 +4,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$begin_time = get_microtime();
|
||||
|
||||
if (!$g4['title'])
|
||||
if (!isset($g4['title']))
|
||||
$g4['title'] = $config['cf_title'];
|
||||
|
||||
// 쪽지를 받았나?
|
||||
@ -59,8 +59,8 @@ var g4_path = "<?=$g4['path']?>";
|
||||
var g4_bbs = "<?=$g4['bbs']?>";
|
||||
var g4_bbs_img = "<?=$g4['bbs_img']?>";
|
||||
var g4_url = "<?=$g4['url']?>";
|
||||
var g4_is_member = "<?=$is_member?>";
|
||||
var g4_is_admin = "<?=$is_admin?>";
|
||||
var g4_is_member = "<?=isset($is_member)?$is_member:'';?>";
|
||||
var g4_is_admin = "<?=isset($is_admin)?$is_admin:'';?>";
|
||||
var g4_bo_table = "<?=isset($bo_table)?$bo_table:'';?>";
|
||||
var g4_sca = "<?=isset($sca)?$sca:'';?>";
|
||||
var g4_charset = "<?=$g4['charset']?>";
|
||||
|
||||
19
js/ajax.js
19
js/ajax.js
@ -20,22 +20,3 @@ function create_request() {
|
||||
else
|
||||
return request;
|
||||
}
|
||||
|
||||
// 트랙백을 사용한다면 토큰을 실시간으로 생성
|
||||
var trackback_url = "";
|
||||
function trackback_send_server(url) {
|
||||
req = create_request();
|
||||
trackback_url = url;
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4) {
|
||||
if (req.status == 200) {
|
||||
var token = req.responseText;
|
||||
prompt("아래 주소를 복사하세요. 이 주소는 스팸을 막기 위하여 한번만 사용 가능합니다.", trackback_url+"/"+token);
|
||||
trackback_url = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
req.open("POST", g4_path+'/'+g4_bbs+'/'+'tb_token.php', true);
|
||||
//req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
req.send(null);
|
||||
}
|
||||
|
||||
@ -112,10 +112,15 @@ function get_cookie($cookie_name)
|
||||
// 경고메세지를 경고창으로
|
||||
function alert($msg='', $url='')
|
||||
{
|
||||
global $g4;
|
||||
global $g4, $config, $member;
|
||||
global $is_admin;
|
||||
|
||||
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
|
||||
$msg = str_replace("\\n", "<br>", $msg);
|
||||
|
||||
if (!$url) $url = "javascript:history.go(-1);";
|
||||
|
||||
/*
|
||||
//header("Content-Type: text/html; charset=$g4['charset']");
|
||||
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset={$g4['charset']}\">";
|
||||
echo "<script>alert('$msg');";
|
||||
@ -127,6 +132,13 @@ function alert($msg='', $url='')
|
||||
//echo "<meta http-equiv='refresh' content='0;url=$url'>";
|
||||
goto_url($url);
|
||||
exit;
|
||||
*/
|
||||
$header = '';
|
||||
if (isset($g4['title'])) {
|
||||
$header = $g4['title'];
|
||||
}
|
||||
include_once("{$g4['bbs_path']}/alert.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -1479,6 +1491,13 @@ function bad_tag_convert($code)
|
||||
}
|
||||
|
||||
|
||||
// 토큰 생성
|
||||
function _token()
|
||||
{
|
||||
return md5(uniqid(rand(), true));
|
||||
}
|
||||
|
||||
|
||||
// 불법접근을 막도록 토큰을 생성하면서 토큰값을 리턴
|
||||
function get_token()
|
||||
{
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
/////////////////////////////////////////
|
||||
// //
|
||||
// mics'php - Trackback Sender //
|
||||
// //
|
||||
// COPYLEFT (c) by micsland.com //
|
||||
// //
|
||||
// MODIFIED (c) by sir.co.kr //
|
||||
// //
|
||||
/////////////////////////////////////////
|
||||
|
||||
// return 값이 있으면 오류, 없으면 정상
|
||||
function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
{
|
||||
/*
|
||||
// allow_url_fopen = Off 일 경우 트랙백 사용할 수 없었던 오류를 수정
|
||||
// allow_url_fopen = On 일 경우에만 사용 가능
|
||||
//주소가 유효한지 검사
|
||||
$p_fp = fopen($tb_url,"r");
|
||||
if($p_fp)
|
||||
@fclose($p_fp);
|
||||
else
|
||||
return "트랙백 URL이 존재하지 않습니다.";
|
||||
*/
|
||||
|
||||
//내용 정리
|
||||
$title = strip_tags($title);
|
||||
$excerpt = strip_tags($excerpt);
|
||||
|
||||
$tmp_data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt);
|
||||
|
||||
//주소 처리
|
||||
$uinfo = parse_url($tb_url);
|
||||
if($uinfo['query']) $tmp_data .= "&".$uinfo['query'];
|
||||
if(!$uinfo['port']) $uinfo['port'] = "80";
|
||||
|
||||
//최종 전송 자료
|
||||
$send_str = 'POST '.$uinfo['path'].' HTTP/1.1\r\n'.
|
||||
'Host: '.$uinfo['host'].'\r\n'.
|
||||
'User-Agent: GNUBOARD\r\n'.
|
||||
'Content-Type: application/x-www-form-urlencoded\r\n'.
|
||||
'Content-length: ".strlen($tmp_data)."\r\n'.
|
||||
'Connection: close\r\n\r\n'.
|
||||
$tmp_data;
|
||||
$fp = @fsockopen($uinfo['host'],$uinfo['port']);
|
||||
if(!$fp)
|
||||
return '트랙백 URL이 존재하지 않습니다.';
|
||||
|
||||
//전송
|
||||
//$fp = fsockopen($uinfo[host],$uinfo[port]);
|
||||
fputs($fp,$send_str);
|
||||
|
||||
//응답 받음
|
||||
while(!feof($fp)) $response .= fgets($fp,128);
|
||||
fclose($fp);
|
||||
|
||||
//트랙백 URL인지 확인
|
||||
if(!strstr($response,'<response>'))
|
||||
return '올바른 트랙백 URL이 아닙니다.';
|
||||
|
||||
//XML 부분만 뽑음
|
||||
$response = strchr($response,'<?');
|
||||
$response = substr($response,0,strpos($response,'</response>'));
|
||||
|
||||
//에러 검사
|
||||
if(strstr($response,'<error>0</error>'))
|
||||
return '';
|
||||
else {
|
||||
$tb_error_str = strchr($response,'<message>');
|
||||
$tb_error_str = substr($tb_error_str,0,strpos($tb_error_str,'</message>'));
|
||||
$tb_error_str = str_replace('<message>','',$tb_error_str);
|
||||
return '트랙백 전송중 오류가 발생했습니다: '.$tb_error_str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
function editor_textarea($id, $content="", $class="")
|
||||
{
|
||||
global $g4;
|
||||
|
||||
4
plugin/tcaptcha/_common.php
Normal file
4
plugin/tcaptcha/_common.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$g4_path = "../.."; // common.php 의 상대 경로
|
||||
include_once("$g4_path/common.php");
|
||||
?>
|
||||
32
plugin/tcaptcha/chk_answer.ajax.php
Normal file
32
plugin/tcaptcha/chk_answer.ajax.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
include_once("$g4[path]/plugin/tcaptcha/tcaptcha.lib.php");
|
||||
|
||||
$user_token = trim($_POST['user_token']);
|
||||
$tcaptcha_token = get_session("ss_tcaptcha_token");
|
||||
if (!$user_token) {
|
||||
die("{\"error\":\"자동등록방지용 사용자 토큰값이 없습니다.\"}");
|
||||
}
|
||||
|
||||
if ($user_token != $tcaptcha_token) {
|
||||
die("{\"error\":\"자동등록방지용 토큰값이 틀립니다.\"}");
|
||||
}
|
||||
|
||||
$tcaptcha_error_count = (int)get_session("ss_tcaptcha_error_count");
|
||||
if ($tcaptcha_error_count >= _ANSWER_COUNT_) {
|
||||
die("{\"error\":\"입력하신 답변 횟수가 "._ANSWER_COUNT_."회를 넘었습니다.\n\n문제를 클릭하신후 다시 답변해 주십시오.\"}");
|
||||
}
|
||||
|
||||
$user_answer = $_POST['user_answer'];
|
||||
$is_answer = (get_session("ss_tcaptcha_answer") == $user_answer);
|
||||
if ($is_answer == false) {
|
||||
$tcaptcha_error_count++;
|
||||
set_session("ss_tcaptcha_error_count", $tcaptcha_error_count);
|
||||
// 토큰을 다시 생성
|
||||
$token = _token();
|
||||
set_session("ss_tcaptcha_token", $token);
|
||||
die("{\"error\":\"입력하신 답이 틀렸습니다.\",\"token\":\"$token\"}");
|
||||
}
|
||||
|
||||
die("{\"error\":\"\"}");
|
||||
?>
|
||||
8
plugin/tcaptcha/run.php
Normal file
8
plugin/tcaptcha/run.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
include_once("$g4[path]/plugin/tcaptcha/tcaptcha.lib.php");
|
||||
|
||||
$tcaptcha = new tcaptcha("kr");
|
||||
$tcaptcha->run();
|
||||
die("{\"tcaptcha\":\"{$tcaptcha->question}\",\"token\":\"{$tcaptcha->token}\"}");
|
||||
?>
|
||||
33
plugin/tcaptcha/sample.php
Normal file
33
plugin/tcaptcha/sample.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
include_once("$g4[path]/head.sub.php");
|
||||
?>
|
||||
<script src="<?="{$g4['path']}/plugin/tcaptcha/tcaptcha.js"?>"></script>
|
||||
|
||||
<h2>텍스트 캡챠 샘플 페이지</h2>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<form method="post" onsubmit="return form_submit(this);">
|
||||
<h2>문) <span id="tcaptcha"></span></h2>
|
||||
<div>
|
||||
답) 반드시 숫자로 입력하세요. <input type='text' id='user_answer' name='user_answer' size='3' maxlength='3' title='자동가입방지' required='required' />
|
||||
<input type='hidden' id='user_token' name='user_token' />
|
||||
<input type='submit' />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function form_submit(f)
|
||||
{
|
||||
if (!chk_tcaptcha(f.user_answer, f.user_token)) {
|
||||
return false;
|
||||
}
|
||||
alert("정답");
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?
|
||||
include_once("$g4[path]/tail.sub.php");
|
||||
?>
|
||||
45
plugin/tcaptcha/tcaptcha.js
Normal file
45
plugin/tcaptcha/tcaptcha.js
Normal file
@ -0,0 +1,45 @@
|
||||
function chk_tcaptcha(user_answer, user_token)
|
||||
{
|
||||
if (typeof(user_answer) == "undefined") return false;
|
||||
if (typeof(user_token ) == "undefined") return false;
|
||||
|
||||
var error = false;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: g4_path+"/plugin/tcaptcha/chk_answer.ajax.php",
|
||||
async: false,
|
||||
data: {
|
||||
"user_answer": user_answer.value,
|
||||
"user_token" : user_token.value
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
error = data.error;
|
||||
if (data.token) {
|
||||
$("#user_token").val(data.token);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
//alert('답이 틀렸거나 입력 횟수가 넘었습니다.\n\n문제를 클릭하신후 답을 다시 입력해 주십시오.');
|
||||
alert(error);
|
||||
user_answer.select();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#tcaptcha").click(function() {
|
||||
$.ajax({
|
||||
url: g4_path+"/plugin/tcaptcha/run.php?t="+(new Date).getTime(),
|
||||
dataType: "json",
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
$("#tcaptcha").html(data.tcaptcha);
|
||||
$("#user_token").val(data.token);
|
||||
}
|
||||
})
|
||||
})
|
||||
.css("cursor", "pointer");
|
||||
});
|
||||
360
plugin/tcaptcha/tcaptcha.lib.php
Normal file
360
plugin/tcaptcha/tcaptcha.lib.php
Normal file
@ -0,0 +1,360 @@
|
||||
<?php
|
||||
define('_ANSWER_COUNT_', 3);
|
||||
|
||||
$text_number = new stdClass;
|
||||
$text_number->kr = new stdClass;
|
||||
$text_number->en = new stdClass;
|
||||
|
||||
//$text_number->kr = (object)array('a'=>1);
|
||||
|
||||
// 기수 cardinal (양을 나타낼때 사용하는 수)
|
||||
$text_number->kr = (object)array(
|
||||
'number' => array(
|
||||
array("영","일","이","삼","사","오","육","칠","팔","구","십"),
|
||||
array("영","하나","둘","셋","넷","다섯","여섯","일곱","여덟","아홉","열")
|
||||
),
|
||||
// 서수 ordinal (순서를 나타낼때 사용하는 수)
|
||||
'ordinal' => array("영","첫번째","두번째","세번째","네번째","다섯번째","여섯번째","일곱번째","여덟번째","아홉번째","열번째"),
|
||||
'high' => array("다음 중 가장 큰 수는? %s.", "%s 중에서 가장 큰 수는?"),
|
||||
'low' => array("다음 중 가장 작은 수는? %s.", "%s 중에서 가장 작은 수는?"),
|
||||
'position0' => array("다음 중 %s 숫자는? %s."), // 인수가 두개 있으며 첫번째에 위치가, 두번째 인수에 질문이 나열된다.
|
||||
'position1' => array("%s 중 %s 숫자는?"), // 인수가 두개 있으며 첫번째에 인수가 두반째에 위치에 대한 질문이 나열된다.
|
||||
'add' => array("%s 더하기 %s ?", "%s + %s = ?"),
|
||||
'subtract' => array("%s 빼기 %s ?", "%s - %s = ?"),
|
||||
'multiply' => array("%s 곱하기 %s ?"),
|
||||
//'multiply' => array("%s 곱하기 %s ?", "%s 의 %s 배는 ?"),
|
||||
'and' => "그리고",
|
||||
);
|
||||
/*
|
||||
// 서수 ordinal (순서를 나타낼때 사용하는 수)
|
||||
$text_number->kr->ordinal = array("영","첫번째","두번째","세번째","네번째","다섯번째","여섯번째","일곱번째","여덟번째","아홉번째","열번째");
|
||||
$text_number->kr->plus = array("+","+","더하기");
|
||||
$text_number->kr->minus = array("-","-","빼기");
|
||||
$text_number->kr->multiply = array("x","×","*","곱하기");
|
||||
$text_number->kr->high = array("다음 중 가장 큰 수는? %s.", "%s 중에서 가장 큰 수는?");
|
||||
$text_number->kr->low = array("다음 중 가장 작은 수는? %s.", "%s 중에서 가장 작은 수는?");
|
||||
$text_number->kr->position0 =array("다음 중 %s 숫자는? %s."); // 인수가 두개 있으며 첫번째에 위치가, 두번째 인수에 질문이 나열된다.
|
||||
$text_number->kr->position1 =array("%s 중 %s 숫자는?"); // 인수가 두개 있으며 첫번째에 인수가 두반째에 위치에 대한 질문이 나열된다.
|
||||
$text_number->kr->add = array("%s 더하기 %s ?", "%s + %s = ?");
|
||||
$text_number->kr->subtract = array("%s 빼기 %s ?", "%s - %s = ?");
|
||||
$text_number->kr->and = "그리고";
|
||||
*/
|
||||
|
||||
$text_number->en = (object)array(
|
||||
'number' => array(
|
||||
array("zero","one","two","three","four","five","six","seven","eight","nine","ten"),
|
||||
array("zero","first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth")
|
||||
),
|
||||
'ordinal' => array("zero","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th"),
|
||||
'high' => array("%s : which of these is the largest?"),
|
||||
'low' => array("%s : which of these is the smallest?"),
|
||||
'position0' => array("lists %s postion number ? %s."), // 인수가 두개 있으며 첫번째에 위치가, 두번째 인수에 질문이 나열된다.
|
||||
'position1' => array("%s lists %s postion number ?"), // 인수가 두개 있으며 첫번째에 인수가 두반째에 위치에 대한 질문이 나열된다.
|
||||
'add' => array("%s add %s ?", "%s plus %s ?", "%s + %s = ?"),
|
||||
'subtract' => array("%s subtract %s ?", "%s minus %s ?", "%s - %s = ?"),
|
||||
'multiply' => array("%s multiply %s ?"),
|
||||
'and' => "and"
|
||||
);
|
||||
|
||||
class tcaptcha
|
||||
{
|
||||
var $language;
|
||||
var $tnum; // text number 의 약어
|
||||
var $min_count = 3; // 최소 문제 갯수
|
||||
var $max_count = 4; // 최대 문제 갯수
|
||||
var $select; // 결과값 배열
|
||||
var $arabia; // 결과값 아라비아 숫자 배열
|
||||
var $count; // 결과값 수
|
||||
var $high; // 결과값 배열 중 가장 큰 값
|
||||
var $low; // 결과값 배열 중 가장 작은 값
|
||||
var $position; // 몇번째 숫자는 값이 얼마인가?
|
||||
var $question; // 문제
|
||||
var $answer; // 더하기, 빼기 시에 답
|
||||
|
||||
function tcaptcha($language='') {
|
||||
if (trim($language) == '')
|
||||
$language = 'kr';
|
||||
$this->set_language($language);
|
||||
}
|
||||
|
||||
function set_language($language) {
|
||||
$this->language = $language;
|
||||
}
|
||||
|
||||
function set_min_count($min_count) {
|
||||
$this->min_count = $min_count;
|
||||
}
|
||||
|
||||
function set_max_count($max_count) {
|
||||
$this->max_count = $max_count;
|
||||
}
|
||||
|
||||
function random_question() {
|
||||
$this->count = $count = rand($this->min_count, $this->max_count); // 숫자를 몇개 뿌려줄것인지?
|
||||
$select = array(); // 선택된 값들
|
||||
$arabia = array(); // 선택된 값들의 아라비아 숫자
|
||||
$high = 0;
|
||||
$low = 9999;
|
||||
while ($count != count($select)) {
|
||||
$choice = rand(0, count($this->tnum->number)-1); // 여러개의 숫자 형식중 하나를 선택한다.
|
||||
$number = $this->tnum->number[$choice];
|
||||
$index = rand(1, count($number)-1); // 영은 빼고
|
||||
if (in_array($index, $arabia)) continue;
|
||||
if (rand(0, 3) < 3) { // 아라비아 숫자도 들어가도록 한다.
|
||||
array_push($select, $number[$index]);
|
||||
} else {
|
||||
array_push($select, $index);
|
||||
}
|
||||
array_push($arabia, $index);
|
||||
if ($index > $high) {
|
||||
$high = $index;
|
||||
}
|
||||
if ($index < $low) {
|
||||
$low = $index;
|
||||
}
|
||||
}
|
||||
|
||||
$this->select = $select;
|
||||
$this->arabia = $arabia;
|
||||
$this->high = $high; // 배열중 가장 큰 값
|
||||
$this->low = $low; // 배열중 가장 작은 값
|
||||
|
||||
return $select;
|
||||
}
|
||||
|
||||
// 숫자의 중간에 , 나 and 를 넣는다.
|
||||
function comma_question($question) {
|
||||
$str = "";
|
||||
$and = false;
|
||||
$comma = "";
|
||||
for ($qi=0; $qi<count($question)-1; $qi++) {
|
||||
$comma = ", ";
|
||||
if ($and == false) {
|
||||
if (rand(0,2) == 0) {
|
||||
$comma = " {$this->tnum->and} ";
|
||||
$and = true;
|
||||
}
|
||||
}
|
||||
|
||||
//$unicode_array = utf8_to_unicode($question[$qi]);
|
||||
//array_walk($unicode_array, create_function('&$v,$k', '$v = "&#" . $v . ";";'));
|
||||
//print_r($unicode_array);
|
||||
//$unicode = implode("", $unicode_array);
|
||||
$str = $str . "<strong>" . $question[$qi] . "</strong>" . $comma;
|
||||
}
|
||||
return $str . "<strong>" . $question[$qi] . "</strong>";
|
||||
}
|
||||
|
||||
// 가장 큰수나 가장 작은수의 질문을 만든다.
|
||||
function series_question($question, $highlow) {
|
||||
$question = $this->comma_question($question);
|
||||
$highlow_array = $this->tnum->$highlow;
|
||||
return sprintf($highlow_array[rand(0, count($highlow_array)-1)], $question);
|
||||
}
|
||||
|
||||
// 몇번째 어떤수가 있는지의 질문을 만든다.
|
||||
function position_question($question) {
|
||||
$question = $this->comma_question($question);
|
||||
$position = rand(0, $this->count-1);
|
||||
$ordinal = $this->get_ordinal_value($position+1);
|
||||
$this->position = $this->arabia[$position]; // 몇번째 숫자는?의 답
|
||||
// 포지션 배열에 따라 인수의 위치가 다르다.
|
||||
if (rand(0,1) == 0) {
|
||||
$position_array = $this->tnum->position0;
|
||||
return sprintf($position_array[rand(0, count($position_array)-1)], $ordinal, $question);
|
||||
} else {
|
||||
$position_array = $this->tnum->position1;
|
||||
return sprintf($position_array[rand(0, count($position_array)-1)], $question, $ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
// 더하기 계산 문제
|
||||
function add_question($question) {
|
||||
$add_array = $this->tnum->add;
|
||||
$rand = rand(0, count($add_array)-1);
|
||||
$first_number = $this->arabia[0];
|
||||
$second_number = $this->arabia[1];
|
||||
$this->answer = $first_number + $second_number;
|
||||
return sprintf($add_array[rand(0, count($add_array)-1)], $question[0], $question[1] );
|
||||
}
|
||||
|
||||
// a, b 변수값을 바꾼다.
|
||||
function swap(&$a, &$b)
|
||||
{
|
||||
$temp = $a;
|
||||
$a = $b;
|
||||
$b = $temp;
|
||||
}
|
||||
|
||||
// 빼기 계산 문제
|
||||
function subtract_question($question) {
|
||||
$subtract_array = $this->tnum->subtract;
|
||||
$rand = rand(0, count($subtract_array)-1);
|
||||
$first_number = $this->arabia[0];
|
||||
$second_number = $this->arabia[1];
|
||||
if ($first_number < $second_number) {
|
||||
$this->swap($first_number, $second_number);
|
||||
$this->swap($question[0], $question[1]);
|
||||
}
|
||||
$this->answer = $first_number - $second_number;
|
||||
return sprintf($subtract_array[$rand], $question[0], $question[1] );
|
||||
}
|
||||
|
||||
// 곱하기 계산 문제
|
||||
function multiply_question($question) {
|
||||
$multiply_array = $this->tnum->multiply;
|
||||
$rand = rand(0, count($multiply_array)-1);
|
||||
$first_number = $this->arabia[0];
|
||||
$second_number = $this->arabia[1];
|
||||
$this->answer = $first_number * $second_number;
|
||||
return sprintf($multiply_array[$rand], $question[0], $question[1] );
|
||||
}
|
||||
|
||||
// 서수값을 반환
|
||||
function get_ordinal_value($index) {
|
||||
return $this->tnum->ordinal[$index];
|
||||
}
|
||||
|
||||
// ajax 비교를 위한 코드 : 답을 저장해 놓는다.
|
||||
function set_session($answer) {
|
||||
$this->token = _token();
|
||||
set_session("ss_tcaptcha_token", $this->token);
|
||||
set_session("ss_tcaptcha_answer", $answer);
|
||||
set_session("ss_tcaptcha_error_count", 0);
|
||||
}
|
||||
|
||||
function run() {
|
||||
global $text_number;
|
||||
$this->tnum = $text_number->{$this->language};
|
||||
$random_question = $this->random_question();
|
||||
switch (rand(0,5)) {
|
||||
case 0 :
|
||||
$question = $this->series_question( $random_question, 'high' );
|
||||
$this->set_session($this->high);
|
||||
break;
|
||||
case 1 :
|
||||
$question = $this->series_question( $random_question, 'low' );
|
||||
$this->set_session($this->low);
|
||||
break;
|
||||
case 2 :
|
||||
$question = $this->add_question( $random_question );
|
||||
$this->set_session($this->answer);
|
||||
break;
|
||||
case 3 :
|
||||
$question = $this->subtract_question( $random_question );
|
||||
$this->set_session($this->answer);
|
||||
break;
|
||||
case 4 :
|
||||
$question = $this->multiply_question( $random_question );
|
||||
$this->set_session($this->answer);
|
||||
break;
|
||||
default :
|
||||
$question = $this->position_question( $random_question );
|
||||
$this->set_session($this->position);
|
||||
break;
|
||||
}
|
||||
$this->question = $question;
|
||||
return $question;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function html_unicode($unicode)
|
||||
{
|
||||
return "&#".$unicode.";";
|
||||
}
|
||||
|
||||
|
||||
function utf8_to_unicode( $str )
|
||||
{
|
||||
$unicode = array();
|
||||
$values = array();
|
||||
$lookingFor = 1;
|
||||
|
||||
for ($i = 0; $i < strlen( $str ); $i++ ) {
|
||||
|
||||
$thisValue = ord( $str[ $i ] );
|
||||
|
||||
if ( $thisValue < 128 ) $unicode[] = $thisValue;
|
||||
else {
|
||||
|
||||
if ( count( $values ) == 0 ) $lookingFor = ( $thisValue < 224 ) ? 2 : 3;
|
||||
|
||||
$values[] = $thisValue;
|
||||
|
||||
if ( count( $values ) == $lookingFor ) {
|
||||
|
||||
$number = ( $lookingFor == 3 ) ?
|
||||
( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):
|
||||
( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );
|
||||
|
||||
$unicode[] = $number;
|
||||
$values = array();
|
||||
$lookingFor = 1;
|
||||
|
||||
} // if
|
||||
|
||||
} // if
|
||||
|
||||
} // for
|
||||
|
||||
return $unicode;
|
||||
|
||||
}
|
||||
|
||||
function unicode_to_utf8($dec)
|
||||
{
|
||||
$unicode_hex = dechex($dec);
|
||||
$unicode = hexdec($unicode_hex);
|
||||
|
||||
$utf8 = "";
|
||||
|
||||
if ($unicode < 128) {
|
||||
$utf8 = chr($unicode);
|
||||
} elseif ( $unicode < 2048 ) {
|
||||
$utf8 .= chr( 192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ) );
|
||||
$utf8 .= chr( 128 + ( $unicode % 64 ) );
|
||||
} else {
|
||||
$utf8 .= chr( 224 + ( ( $unicode - ( $unicode % 4096 ) ) / 4096 ) );
|
||||
$utf8 .= chr( 128 + ( ( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ) );
|
||||
$utf8 .= chr( 128 + ( $unicode % 64 ) );
|
||||
}
|
||||
return $utf8;
|
||||
}
|
||||
|
||||
|
||||
function chk_captcha()
|
||||
{
|
||||
$token = get_session("ss_tcaptcha_token");
|
||||
if ($token && $token == $_POST['user_token']) {
|
||||
$answer = get_session("ss_tcaptcha_answer");
|
||||
if ($answer && $answer == $_POST['user_answer']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
set_session("ss_tcaptcha_token", "");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function chk_js_captcha()
|
||||
{
|
||||
return "if (!chk_tcaptcha(f.user_answer, f.user_token)) { return false; }\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
function run_captcha($encoding='kr')
|
||||
{
|
||||
$captcha = new tcaptcha($encoding);
|
||||
|
||||
$str = "<fieldset id=\"captcha\">\n";
|
||||
$str .= "<legend>자동등록방지</legend>\n";
|
||||
$str .= "<div><a href=\"javascript:;\" id=\"tcaptcha\">".$captcha->run()."</a></div>\n";
|
||||
$str .= "<span>답은 반드시 숫자로 입력하세요.</span>\n";
|
||||
$str .= "<input type=\"text\" id=\"user_answer\" name=\"user_answer\" title=\"자동등록방지 숫자\" size=\"10\" required=\"required\" />\n";
|
||||
$str .= "<input type=\"hidden\" id=\"user_token\" name=\"user_token\" value=\"{$captcha->token}\" />";
|
||||
$str .= "</fieldset>\n";
|
||||
return $str;
|
||||
}
|
||||
?>
|
||||
@ -45,7 +45,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
</td>
|
||||
<td align="right" style="padding:6px 6px 0 0;" width=120>
|
||||
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
|
||||
<? if ($trackback_url) { ?><a href="javascript:trackback_send_server('<?=$trackback_url?>');" style="letter-spacing:0;" title='주소 복사'><img src="<?=$board_skin_path?>/img/btn_trackback.gif" border='0' align="absmiddle"></a><?}?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -58,7 +58,6 @@ for ($i=0; $i<count($list); $i++) {
|
||||
echo $str;
|
||||
?>
|
||||
</div>
|
||||
<? if ($list[$i]['trackback']) { echo "<p>".$list[$i]['trackback']."</p>"; } ?>
|
||||
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
|
||||
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 -->
|
||||
</div>
|
||||
|
||||
@ -225,15 +225,6 @@ if ($option) {
|
||||
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
|
||||
<? } ?>
|
||||
|
||||
<? if ($is_trackback) { ?>
|
||||
<tr>
|
||||
<td class=write_head>트랙백주소</td>
|
||||
<td><input class='ed' size=50 name=wr_trackback itemname="트랙백" value="<?=$trackback?>">
|
||||
<? if ($w=='u') { ?><input type=checkbox name="re_trackback" value="1">핑 보냄<? } ?></td>
|
||||
</tr>
|
||||
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
|
||||
<? } ?>
|
||||
|
||||
<? if ($is_guest) { ?>
|
||||
<tr>
|
||||
<td class=write_head><img id='kcaptcha_image' /></td>
|
||||
|
||||
@ -7,7 +7,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
<aside>
|
||||
<h2>게시물 상단 링크</h2>
|
||||
<!-- 링크 버튼 -->
|
||||
<? if ($update_href || $deleter_href) {?>
|
||||
<? if ($update_href || $delete_href) {?>
|
||||
<ul>
|
||||
<? if ($update_href) { ?>
|
||||
<li><a href="<?=$update_href?>">수정</a></li>
|
||||
@ -133,10 +133,9 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<? if ($is_signature) { ?><p><?=$signature?></p><? } ?>
|
||||
|
||||
<? if ($scrap_href || $trackback_url || $good_href || $nogood_href) { ?>
|
||||
<? if ($scrap_href || $good_href || $nogood_href) { ?>
|
||||
<ul>
|
||||
<? if ($scrap_href) { ?><li><a href="javascript:;" onclick="win_scrap('<?=$scrap_href?>');">스크랩</a></li><? } ?>
|
||||
<? if ($trackback_url) { ?><li><a href="javascript:trackback_send_server('<?=$trackback_url?>');">트랙백주소</a></li><?}?>
|
||||
<? if ($good_href) {?><li>추천 <?=number_format($view['wr_good'])?> <a href="<?=$good_href?>" target="hiddenframe">추천</a></li><? } ?>
|
||||
<? if ($nogood_href) {?><li>비추천 <?=number_format($view['wr_nogood'])?> <a href="<?=$nogood_href?>" target="hiddenframe">비추천</a></li><? } ?>
|
||||
</ul>
|
||||
|
||||
@ -45,9 +45,6 @@ var char_max = parseInt(<?=$comment_max?>); // 최대
|
||||
<!-- 댓글 출력 -->
|
||||
<p><?=$str?></p>
|
||||
|
||||
<? if ($list[$i]['trackback']) { ?>
|
||||
<p><?=$list[$i]['trackback']?></p>
|
||||
<? } ?>
|
||||
<span id="edit_<?=$comment_id?>"></span><!-- 수정 -->
|
||||
<span id="reply_<?=$comment_id?>"></span><!-- 답변 -->
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ var char_min = parseInt(<?=$write_min?>); // 최소
|
||||
var char_max = parseInt(<?=$write_max?>); // 최대
|
||||
</script>
|
||||
|
||||
<form id="fwrite" name="fwrite" action="./write_update.php" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data">
|
||||
<form id="fwrite" name="fwrite" method="post" action="<?=$action_url?>" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data">
|
||||
<input type="hidden" name="w" value="<?=$w?>">
|
||||
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
|
||||
<input type="hidden" name="wr_id" value="<?=$wr_id?>">
|
||||
@ -26,7 +26,7 @@ var char_max = parseInt(<?=$write_max?>); // 최대
|
||||
<? if ($is_name) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_name">이름</label></th>
|
||||
<td><input type="text" id="wr_name" name="wr_name" maxlength="20" class="required" value="<?=$name?>" title="이름"></td>
|
||||
<td><input type="text" id="wr_name" name="wr_name" maxlength="20" class="required" required="required" value="<?=$name?>" title="이름"></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
|
||||
@ -40,7 +40,7 @@ var char_max = parseInt(<?=$write_max?>); // 최대
|
||||
<? if ($is_email) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_email">이메일</label></th>
|
||||
<td><input type="text" id="wr_email" name="wr_email" maxlength="100" value="<?=$email?>"></td>
|
||||
<td><input type="text" id="wr_email" name="wr_email" class="email" value="<?=$email?>" title="이메일" maxlength="100"></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
|
||||
@ -104,7 +104,7 @@ if ($option) {
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_subject">제목</label></th>
|
||||
<td><input id="wr_subject" name="wr_subject" required value="<?=$subject?>"></td>
|
||||
<td><input id="wr_subject" name="wr_subject" required="required" value="<?=$subject?>" title="제목"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -173,8 +173,7 @@ if ($option) {
|
||||
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
|
||||
var file_length = <?=(int)$file_length?>;
|
||||
var objTbl = document.getElementById("variableFiles");
|
||||
if (objTbl.rows.length - 1 > file_length)
|
||||
{
|
||||
if (objTbl.rows.length - 1 > file_length) {
|
||||
objTbl.deleteRow(objTbl.rows.length - 1);
|
||||
flen--;
|
||||
}
|
||||
@ -189,30 +188,14 @@ if ($option) {
|
||||
<span onclick="del_file();" style="cursor:pointer;">파일감소</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
|
||||
<? } ?>
|
||||
|
||||
<? if ($is_trackback) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_trackback">트랙백주소</label></th>
|
||||
<td>
|
||||
<input id="wr_trackback" name="wr_trackback" value="<?=$trackback?>">
|
||||
<? if ($w=='u') { ?><input type="checkbox" id="re_trackback" name="re_trackback" value="1">핑 보냄<? } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<? if ($is_guest) { ?>
|
||||
<fieldset id="captcha">
|
||||
<legend>자동등록방지</legend>
|
||||
<div><img id="kcaptcha_image" alt="" /></div>
|
||||
<label for="wr_key">자동등록방지</label>
|
||||
<input type="text" id="wr_key" name="wr_key" required>
|
||||
왼쪽의 글자를 입력하세요.
|
||||
</fieldset>
|
||||
<? } ?>
|
||||
<?
|
||||
echo run_captcha();
|
||||
?>
|
||||
|
||||
<div class="btn_confirm">
|
||||
<input type="submit" id="btn_submit" value="글쓰기" accesskey="s">
|
||||
@ -279,6 +262,7 @@ function fwrite_submit(f)
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if (document.getElementById('char_count')) {
|
||||
if (char_min > 0 || char_max > 0) {
|
||||
var cnt = parseInt(document.getElementById('char_count').innerHTML);
|
||||
@ -292,6 +276,7 @@ function fwrite_submit(f)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (document.getElementById('tx_wr_content')) {
|
||||
if (!ed_wr_content.outputBodyText()) {
|
||||
@ -301,10 +286,6 @@ function fwrite_submit(f)
|
||||
}
|
||||
}
|
||||
|
||||
<?
|
||||
if ($is_dhtml_editor) echo cheditor3('wr_content');
|
||||
?>
|
||||
|
||||
var subject = "";
|
||||
var content = "";
|
||||
$.ajax({
|
||||
@ -338,18 +319,8 @@ function fwrite_submit(f)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!check_kcaptcha(f.wr_key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//document.getElementById('btn_submit').disabled = true;
|
||||
//document.getElementById('btn_list').disabled = true;
|
||||
|
||||
<?
|
||||
if ($g4['https_url'])
|
||||
echo "f.action = '{$g4['https_url']}/{$g4['bbs']}/write_update.php';";
|
||||
else
|
||||
echo "f.action = './write_update.php';";
|
||||
echo chk_js_captcha();
|
||||
?>
|
||||
|
||||
return true;
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
|
||||
<script src="<?=$g4[path]?>/js/capslock.js"></script>
|
||||
|
||||
<form name="fboardpassword" method="post" onsubmit="return fboardpassword_submit(this);">
|
||||
<input type="hidden" name="w" value="<?=$w?>">
|
||||
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
|
||||
@ -17,7 +15,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
<legend>패스워드 확인</legend>
|
||||
<p>비밀글 기능으로 보호된 글입니다. 작성자와 관리자만 열람하실 수 있습니다. 작성자 본인이시라면 패스워드를 입력하세요.</p>
|
||||
<label for="password_wr_password">패스워드</label>
|
||||
<input type="password" id="password_wr_password" name="wr_password" maxLength="20" size="15" required onkeypress="check_capslock(event, 'password_wr_password');">
|
||||
<input type="password" id="password_wr_password" name="wr_password" maxLength="20" size="15" required="required" title="패스워드">
|
||||
<input type="submit" value="확인">
|
||||
</fieldset>
|
||||
|
||||
|
||||
@ -23,11 +23,18 @@ if ($g4['https_url']) {
|
||||
else {
|
||||
$outlogin_url = $urlencode;
|
||||
}
|
||||
|
||||
|
||||
if ($g4['https_url'])
|
||||
$action_url = "{$g4['https_url']}/$g4[bbs]/login_check.php";
|
||||
else
|
||||
$action_url = "{$g4['bbs_path']}/login_check.php";
|
||||
?>
|
||||
|
||||
<section id="ol_before" class="outlogin">
|
||||
<h2>사이트 회원</h2>
|
||||
<!-- 로그인 전 외부로그인 시작 -->
|
||||
<<<<<<< HEAD
|
||||
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off">
|
||||
<fieldset>
|
||||
<legend>로그인</legend>
|
||||
@ -44,30 +51,27 @@ else {
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
=======
|
||||
<form name="fhead" method="post" action="<?=$action_url?>" onsubmit="return fhead_submit(this);" autocomplete="off">
|
||||
<fieldset>
|
||||
<legend>로그인</legend>
|
||||
<input type="hidden" name="url" value="<?=$outlogin_url?>">
|
||||
<label for="mb_id">아이디</label>
|
||||
<input type="text" id="mb_id" name="mb_id" maxlength="20" required>
|
||||
<label for="mb_password">패스워드</label>
|
||||
<input type="password" id="mb_password" name="mb_password" maxlength="20">
|
||||
<input type="checkbox" id="auto_login" name="auto_login" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }">
|
||||
<label for="auto_login">자동로그인</label>
|
||||
<input type="submit" value="로그인">
|
||||
<a href="javascript:win_password_lost();">아이디/패스워드 찾기</a>
|
||||
<a href="<?=$g4['bbs_path']?>/register.php">회원가입</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
>>>>>>> 6040266aed7f782fddaf6f63366be5b06bdfa780
|
||||
|
||||
<script src="<?=$g4[path]?>/js/capslock.js"></script>
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
function fhead_submit(f)
|
||||
{
|
||||
if (!f.mb_id.value) {
|
||||
alert("회원아이디를 입력하십시오.");
|
||||
f.mb_id.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!f.mb_password.value) {
|
||||
alert("패스워드를 입력하십시오.");
|
||||
f.mb_password.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
<?
|
||||
if ($g4['https_url'])
|
||||
echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
|
||||
else
|
||||
echo "f.action = '$g4[bbs_path]/login_check.php';";
|
||||
?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user