+
+
+###############################################################################
+# 게시판 기본 설정
+###############################################################################
+#
+$board['title'] = 'Test BOARD'; # 게시판 제목
+$board['wrap'] = 1; # 본문 길게 늘어지는것 방지
+$board['wwrap'] = 120; # $board['wrap']이 적용안될시 강제 적용
+$board['width'] = '550'; # 게시판 너비
+$board['tit_l'] = 42; # 제목 필드 최대 길이
+$board['nam_l'] = 8; # 글쓴이 필드 최대 길이
+$board['perno'] = 10; # 페이지 당 게시물 수
+$board['plist'] = 2; # 페이지 목록 출력 갯수 (x2+1)
+
+# 쿠키 기간 설정 (日)
+$board['cookie'] = 30;
+
+
+###############################################################################
+# FORM SIZE
+###############################################################################
+#
+$size['name'] = 14; # 이름 폼 길이
+$size['pass'] = 4; # submit button 길이
+$size['titl'] = 25; # 제목 폼 길이
+$size['text'] = 32; # TEXTAREA 길이
+$size['uplo'] = 19; # UPLOAD 폼 길이
+
+
+###############################################################################
+# 호스트 정보 출력 설정 0 - Failed, 1 - True
+###############################################################################
+#
+$enable['dhost'] = 0; # IP address 출력 여부(상단 메뉴 출력 안할시)
+$enable['dlook'] = 0; # DNS lookup 여부
+$enable['dwho'] = 0; # WHOIS 검색 여부
+
+
+###############################################################################
+# Theme Configuration
+###############################################################################
+#
+$print['theme'] = 'EN-default'; # Theme 이름
+
+
+###############################################################################
+# file upload 관련 설정
+# 전체 관리자가 허락 하지 않으면 여기서 yes를 선택해서 이기능도 사용할수 없다
+###############################################################################
+#
+$cupload['yesno'] = 0; # upload 사용 여부
+$cupload['dnlink'] = 0; # 0: 헤더를통해 1: 다이렉트 링크
+
+
+###############################################################################
+# url,email 사용 여부 설정
+###############################################################################
+#
+$view['url'] = 1;
+$view['email'] = 1;
+
+
+###############################################################################
+# mail 발송 여부 설정
+# 전체 관리자의 기능 on에 의해 사용을 할수 있다
+###############################################################################
+#
+$rmail['admin'] = 0;
+$rmail['user'] = 0;
+$rmail['toadmin'] = 'user@localhost'; # 메일을 받을 게시판 관리자의 메일 주소
+
+
+###############################################################################
+# 아래의 정보를 사용하여 글 등록시 관리자의 password를 요구
+###############################################################################
+#
+$ccompare['name'] = '관리자';
+$ccompare['email'] = 'username@domain.com';
+
+
+###############################################################################
+# IP Blocking 기능
+# 설정값의 구분자는 ';' 로 한다.
+# 설정 예) 1.1.1.1;2.2.2.2;3.3.3.3
+###############################################################################
+$enable['ipbl'] = '';
+
+
+###############################################################################
+# dhyper : 0 -> 등록된 값만 허락
+# 1 -> 등록된 값만 막음
+# plink 가 없을 경우에는 작동 안함
+# plink : dhyper 가 작동할 ip 주소. ';' 를 구분자로 사용
+# 설정 예) 1.1.1.1;2.2.2.2;3.3.3.3
+###############################################################################
+#
+$enable['dhyper'] = 0;
+$enable['plink'] = '';
+
+###############################################################################
+# 게시판 공지사항
+#
+# 배열로 하여 여러개를 지정할 수 있음
+# $notice['subject'] -> 공지사항 제목
+# $notice['body'] -> 공지사항 내용
+# 공지사항 내용이 없을 경우에는 제목 링크가 안되게 출력
+###############################################################################
+#
+$notice['subject'] = '';
+$notice['contents'] = "";
+
+###############################################################################
+# 게시판 RSS 설정
+#
+# $rss['use'] -> rss 사용여부
+# $rss['channel'] -> rss 리더의 채널목록 이름
+# $rss['is_des'] -> 기사의 설명 출력 여부
+# $rss['align'] -> rss link 의 위치 ( left/right )
+# $rss['color'] -> rss link 의 color
+###############################################################################
+#
+$rss['use'] = 0;
+$rss['is_des'] = 0;
+$rss['channel'] = 'JSBoard 게시판';
+$rss['align'] = 1;
+$rss['color'] = '#999999';
+?>
diff --git a/INSTALLER/sample/data/html_head.php b/INSTALLER/sample/data/html_head.php
new file mode 100644
index 00000000..ce8678e4
--- /dev/null
+++ b/INSTALLER/sample/data/html_head.php
@@ -0,0 +1,3 @@
+
+
+
diff --git a/INSTALLER/sample/data/html_tail.php b/INSTALLER/sample/data/html_tail.php
new file mode 100644
index 00000000..c1851acf
--- /dev/null
+++ b/INSTALLER/sample/data/html_tail.php
@@ -0,0 +1,7 @@
+
+{$langs['u_print']}
";
+}
+?>
+
diff --git a/INSTALLER/sample/data/stylesheet.php b/INSTALLER/sample/data/stylesheet.php
new file mode 100644
index 00000000..a5707175
--- /dev/null
+++ b/INSTALLER/sample/data/stylesheet.php
@@ -0,0 +1,4 @@
+
diff --git a/INSTALLER/script/LANG/en.conf b/INSTALLER/script/LANG/en.conf
new file mode 100644
index 00000000..d5b4499e
--- /dev/null
+++ b/INSTALLER/script/LANG/en.conf
@@ -0,0 +1,23 @@
+#################################################################
+# English Language File
+# $Id: en.conf,v 1.5 2009/11/19 05:29:50 oops Exp $
+#################################################################
+SYSTEM_IN="# System INFORMATION"
+SYSTEM_LN="# System Language : English"
+SYSTEM_OS="# System OS : ${DIST}"
+SYSTEM_HU="# Apache User : ${Auser}"
+SYSTEM_HG="# Apache Group : ${Agroup}"
+SYSTEM_MN="If isn't right upper informations, you types N and appoint new value."
+SYSTEM_AL="Is right upper information? [Y/N](default Y) :"
+RECONF_HU="Input value of User directive in httpd.conf : "
+RECONF_HG="Input value of Group directive in httpd.conf : "
+ENDMSG="DONE !!!"
+
+SYSTEM_GE="#-1 is not system group.\n\
+Excute again this script, after changed GROUP\n\
+directive in httpd.conf that existed group on system"
+
+ACC_END_MSG="Group Owner of \"config/global.php\n\
+config/allow_browser.txt\" must set GROUP value in httpd.conf\n\
+that is operation group of Web Server. If can't set as value of\n\
+GROUP directive in httpd.conf, you will set the permission 606."
diff --git a/INSTALLER/script/LANG/ko.conf b/INSTALLER/script/LANG/ko.conf
new file mode 100644
index 00000000..39b385b4
--- /dev/null
+++ b/INSTALLER/script/LANG/ko.conf
@@ -0,0 +1,23 @@
+#################################################################
+# 한국어 언어 파일
+# $Id: ko.conf,v 1.5 2014/03/02 17:11:30 oops Exp $
+#################################################################
+SYSTEM_IN="## 시스템 정보"
+SYSTEM_LN="# 시스템 언어 : 한국어"
+SYSTEM_OS="# 시스템 타입 : ${DIST}"
+SYSTEM_HU="# 아파치 유저권한 : ${Auser}"
+SYSTEM_HG="# 아파치 그룹권한 : ${Agroup}"
+SYSTEM_MN="위의 정보가 틀리면 N 을 선택해서 재조정 해 주십시오."
+SYSTEM_AL="위의 정보가 맞습니까? [Y/N](default Y) : "
+RECONF_HU="httpd.conf 의 User 지시자의 값을 적어 주십시오 : "
+RECONF_HG="httpd.conf 의 Group 지시자의 값을 적어 주십시오 : "
+ENDMSG="설정 완료!!!"
+
+SYSTEM_GE="#-1 은 시스템에 존재하지 않는 그룹입니다. httpd.conf 의 GROUP\n\
+지시자의 값을 시스템에 존재하는 그룹으로 지정하고 이 스크립트\n\
+를 다시 시작하십시오."
+
+ACC_END_MSG="config/global.php config/spam_list.txt\n\
+file 의 group 소유권이 nobody 에게 있어야 합니다. 만약 위의 파\n\
+일들의 그룹 소유권을 변경할 수 없다면 permission 을 606으로 맞\n\
+춰 주십시오"
diff --git a/INSTALLER/script/account b/INSTALLER/script/account
new file mode 100755
index 00000000..0f817384
--- /dev/null
+++ b/INSTALLER/script/account
@@ -0,0 +1,52 @@
+#!/bin/sh
+# $Id: account,v 1.5 2009/11/19 05:29:50 oops Exp $
+clear
+echo "########################################################"
+echo "# JSBoard Config File Installer v2.0 #"
+echo "# Scripted By JoungKyun Kim < http://www.oops.org > #"
+echo "########################################################"
+echo
+
+echo "STEP 1 Language Check"
+echo "---------------------"
+echo -n "Do you want to use Koean during the installation? [Y/N](default Y) : "
+read langs
+
+case "${langs}" in
+ N*|n*)
+ langs=en ;;
+ *)
+ langs=ko ;;
+esac
+
+if [ "${langs}" = "ko" ]; then
+ . ./LANG/ko.conf
+else
+ . ./LANG/en.conf
+fi
+
+cp -Rp ../sample/admin/global.php.orig ../../config/global.php
+cp -Rp ../sample/admin/spam_list.txt.orig ../../config/spam_list.txt
+if [ -d "../../data/test" ]; then
+ cp -Rp ../sample/data/* ../../data/test/
+else
+ cp -Rp ../sample/data/ ../../data/test
+fi
+
+# permission configuration
+chmod 707 ../../config
+chmod 707 ../../data
+chmod 707 ../../data/test
+chmod 707 ../../data/test/files
+chmod 660 ../../config/global.php
+chmod 660 ../../config/spam_list.txt
+chmod 606 ../../data/test/config.php
+chmod 606 ../../data/test/html_head.php
+chmod 606 ../../data/test/html_tail.php
+chmod 606 ../../data/test/stylesheet.php
+
+echo
+echo -e ${ACC_END_MSG}
+echo
+
+exit 0
diff --git a/INSTALLER/script/account_p b/INSTALLER/script/account_p
new file mode 100755
index 00000000..f2795bfc
--- /dev/null
+++ b/INSTALLER/script/account_p
@@ -0,0 +1,40 @@
+#!/bin/sh
+# $Id: account_p,v 1.5 2009/11/19 05:29:50 oops Exp $
+clear
+echo "########################################################"
+echo "# JSBoard Config File Installer v2.0 #"
+echo "# Scripted By JoungKyun Kim < http://www.oops.org > #"
+echo "########################################################"
+echo
+
+echo "STEP 1 Language Check"
+echo "---------------------"
+echo -n "Do you want to use Korean during the installation? [Y/N](default Y) : "
+read langs
+
+case "${langs}" in
+ N*|n*)
+ langs=en ;;
+ *)
+ langs=ko ;;
+esac
+
+if [ "${langs}" = "ko" ]; then
+ . ./LANG/ko.conf
+else
+ . ./LANG/en.conf
+fi
+
+# permission configuration
+chmod 707 ../../config
+chmod 707 -R ../../data
+chmod 606 ../../data/*/files/*/*
+chmod 606 ../../data/*/*.*
+chmod 660 ../../config/global.php
+chmod 660 ../../config/spam_list.txt
+
+echo
+echo -e ${ACC_END_MSG}
+echo
+
+exit 0
diff --git a/INSTALLER/script/conv_udate b/INSTALLER/script/conv_udate
new file mode 100755
index 00000000..4f78cc95
--- /dev/null
+++ b/INSTALLER/script/conv_udate
@@ -0,0 +1,499 @@
+#!/bin/sh
+# $Id: conv_udate,v 1.16 2014/03/02 17:11:30 oops Exp $
+PERL_PATH="/usr/bin/perl"
+DEFAULTPATH="../.."
+
+echo "global.php 변환중.."
+echo
+ACONFFILE="${DEFAULTPATH}/config/global.php"
+
+rm -rf ${DEFAULTPATH}/config/themes
+rm -f ${DEFAULTPATH}/config/README.THEME
+rm -f ${DEFAULTPATH}/config/default.themes
+rm -f ${DEFAULTPATH}/config/allow_browser.txt
+
+ASERVER=$(sed -n -e '/db\[server\]/ s/.*db\[server\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ASERVER}" = "" ] && ASERVER=""
+
+AUSER=$(sed -n -e '/db\[user\]/ s/.*db\[user\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${AUSER}" = "" ] && AUSER=""
+
+APASS=$(sed -n -e '/db\[pass\]/ s/.*db\[pass\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${APASS}" = "" ] && APASS=""
+
+ANAME=$(sed -n -e '/db\[name\]/ s/.*db\[name\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ANAME}" = "" ] && ANAME=""
+
+ATITLE=$(sed -n -e '/board\[title\]/ s/.*board\[title\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ATITLE}" = "" ] && ATITLE="WebBoard"
+
+AWIDTH=$(sed -n -e '/board\[width\]/ s/.*board\[width\][^=]*=[^\"0-9%]*[\"]*\([0-9%]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${AWIDTH}" = "" ] && AWIDTH="550"
+
+ATIT_L=$(sed -n -e '/board\[tit_l\]/ s/.*board\[tit_l\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${ATIT_L}" = "" ] && ATIT_L=42
+
+ANAM_L=$(sed -n -e '/board\[nam_l\]/ s/.*board\[nam_l\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${ANAM_L}" = "" ] && ANAM_L=8
+
+APERNO=$(sed -n -e '/board\[perno\]/ s/.*board\[perno\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${APERNO}" = "" ] && APERNO=10
+
+APLIST=$(sed -n -e '/board\[plist\]/ s/.*board\[plist\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${APLIST}" = "" ] && APLIST=3
+
+ALANG=$(sed -n -e '/langs\[code\]/ s/.*langs\[code\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+case ${ALANG} in
+ ko|KO|Ko|kO) ATHEME="KO-default" ;;
+ en|EN|En|eN) ATHEME="EN-default" ;;
+ *) ATHEME="EN-default"
+esac
+
+ADATEF=$(sed -n -e '/board\[date_fmt\]/ s/.*board\[date_fmt\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ADATEF}" = "" ] && ADATEF="Y.m.d"
+
+AHL=$(sed -n -e '/board\[hl\]/ s/.*board\[hl\][^=]*=[^\"0-9a-zA-Z<>]*[\"]*\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+if [ "${AHL}" = "" ]; then
+ AHL="#000000"
+else
+ AHL=${AHL##*=}
+ AHL=${AHL%%>*}
+fi
+
+AALIGN=$(sed -n -e '/board\[align\]/ s/.*board\[align\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${AALIGN}" = "" ] && AALIGN="center"
+
+AYESNO=$(sed -n -e '/upload\[yesno\]/ s/.*upload\[yesno\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+case ${AYESNO} in
+ y*|Y*) AYESNO=1;;
+ *) AYESNO=0;;
+esac
+
+ADIR=$(sed -n -e '/upload\[dir\]/ s/.*upload\[dir\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ADIR}" = "" ] && ADIR="files"
+
+AMAX=$(sed -n -e '/upload\[maxsize\]/ s/.*upload\[maxsize\][^=]*=[^\"0-9%]*[\"]*\([0-9%]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${AMAX}" = "" ] && AMAX="2000000"
+
+AUSES=$(sed -n -e '/rmail\[uses\]/ s/.*rmail\[uses\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+case ${AUSES} in
+ y*|Y*) AUSES=1;;
+ *) AUSES=0;;
+esac
+
+ASMTP=$(sed -n -e '/rmail\[smtp\]/ s/.*rmail\[smtp\][^=]*=[^\"0-9a-zA-Z\xA1-\xFE\.]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ASMTP}" = "" ] && ASMTP="127.0.0.1"
+
+ABBS=$(sed -n -e '/rmail\[bbshome\]/ s/.*rmail\[bbshome\][^=]*=[^\"0-9a-zA-Z\xA1-\xFE\.]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ABBS}" = "" ] && ABBS="http://127.0.0.1/jsboard/"
+
+APRE=$(sed -n -e '/list\[pre\]/ s/.*list\[pre\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${APRE}" = "" ] && APRE=0
+
+APREN=$(sed -n -e '/list\[preren\]/ s/.*list\[preren\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${ACONFFILE})
+[ "${APREN}" = "" ] && APREN=100
+
+ACNAME=$(sed -n -e '/compare\[name\]/ s/.*compare\[name\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ACNAME}" = "" ] && ACNAME=""
+
+ACMAIL=$(sed -n -e '/compare\[email\]/ s/.*compare\[email\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${ACONFFILE})
+[ "${ACMAIL}" = "" ] && ACMAIL=""
+
+cp -af ${DEFAULTPATH}/config/global.php ${DEFAULTPATH}/config/global.php.orig
+
+echo "STR\";
+
+# Table Align of board
+\$board[align] = \"${AALIGN}\";
+
+# web path of installed jsboard
+\$board[path] = \"${ABBS}\";
+
+
+##############################################################################
+# login mode Configuration
+##############################################################################
+# login variation name (This value must be modified as security problem)
+\$jsboard = \"login\";
+
+# Don't touch this line.
+\$jsboard = \"jsboard\".\$jsboard;
+
+# location of default page after login
+\$print[dpage] = \"${ABBS}list.php?table=test\";
+
+# location of default page after logout
+\$print[dopage] = \"${ABBS}list.php?table=test\";
+
+# permition of user registration
+# 1 -> everyone
+# 0 -> admin only
+\$board[regist] = 0;
+
+
+##############################################################################
+# Theme Configuration
+##############################################################################
+# Theme Name
+\$print[theme] = \"${ATHEME}\";
+
+
+##############################################################################
+# UPLOAD Configuration
+# if value of \$upload[yesno] is 0, then all board disable upload
+##############################################################################
+\$upload[yesno] = ${AYESNO}; # enable upload
+\$upload[dir] = \"${ADIR}\"; # directory name of upload file
+\$upload[maxsize] = \"${AMAX}\"; # upload max size
+
+
+##############################################################################
+# Config of IP Blocking
+# if value of \$board[useipbl] is 0, then all board disable check ip blocking.
+##############################################################################
+\$board[useipbl] = 0;
+
+
+##############################################################################
+# Control Access From Remote Hyper Link
+# if value of \$board[usedhyper] is 0, then all board disable check dhyper.
+##############################################################################
+\$board[usedhyper] = 0;
+
+
+##############################################################################
+# Mail Configuration
+##############################################################################
+\$rmail[uses] = ${AUSES};
+# MTA configuration
+# no value -> send mail with self method of JSBoard
+# mail server address -> send mail with selected mail server
+# WARN : windows version can't select self method of JSBoard
+\$rmail[mta] = \"${ASMTP}\";
+# charactor of converted mail address
+\$rmail[chars] = \"__at__\";
+
+
+##############################################################################
+# Preview article contents
+##############################################################################
+\$list[pre] = ${APRE}; # enable preview
+\$list[preren] = ${APREN}; # if enable preview, lenth of contents
+
+
+##############################################################################
+# If registed article as follow information, requried passwd of super user
+##############################################################################
+\$compare[name] = \"${ACNAME}\";
+\$compare[email] = \"${ACMAIL}\";
+?>" > ${DEFAULTPATH}/config/global.php
+
+
+# 게시판 목록을 구함
+TARGET=$(ls -l ${DEFAULTPATH}/data | grep -e "^d" | awk '{print $9}' | sed -e 's/\///')
+
+for i in ${TARGET}
+do
+
+ echo "${i} 게시판 작업중"
+
+ # 필요 없는 테마 파일을 삭제
+ rm -f "${DEFAULTPATH}/data/${i}/default.themes"
+ CONFFILE="${DEFAULTPATH}/data/${i}/config.php"
+
+ # 미리보기 허가 설정값
+ PRE=$(sed -n -e '/enable\[pre\]/ s/.*enable\[pre\][^=]*=[^\"0-9]*[\"]*\([0-9 ]*\)[\"]*;.*/\1/p;' ${CONFFILE})
+ [ "${PRE}" = "" ] && PRE=0
+
+ # 미리보기 허가 글길이 값
+ PREREN=$(sed -n -e '/enable\[preren\]/ s/.*enable\[preren\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${PREREN}" = "" ] && PREREN=100
+
+ # 원본글 포함 여부 값
+ ORE=$(sed -n -e '/enable\[ore\]/ s/.*enable\[ore\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${ORE}" = "" ] && ORE=0
+
+ # 관련글 리스트 값
+ RE_LIST=$(sed -n -e '/enable\[re_list\]/ s/.*enable\[re_list\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${RE_LIST}" = "" ] && RE_LIST=0
+
+ # 보드 align 값
+ ALIGN=$(sed -n -e '/board\[align\]/ s/.*board\[align\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${ALIGN}" = "" ] && ALIGN="center"
+
+ # 게시판 제목
+ TITLE=$(sed -n -e '/board\[title\]/ s/.*board\[title\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${TITLE}" = "" ] && TITLE=""
+
+ # 본문 길게 늘어지는것 방지
+ WRAP=$(sed -n -e '/board\[wrap\]/ s/.*board\[wrap\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${WRAP}" = "" ] && WRAP=0
+
+ WWRAP=$(sed -n -e '/board\[wwrap\]/ s/.*board\[wwrap\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${WWRAP}" = "" ] && WWRAP=120
+
+ # 게시판 너비
+ WIDTH=$(sed -n -e '/board\[width\]/ s/.*board\[width\][^=]*=[^\"0-9%]*[\"]*\([0-9%]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${WIDTH}" = "" ] && WIDTH=550
+
+ # 제목 필드 최대 길이
+ TIT_L=$(sed -n -e '/board\[tit_l\]/ s/.*board\[tit_l\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${TIT_L}" = "" ] && TIT_L=38
+
+ # 글쓴이 필드 최대 길이
+ NAM_L=$(sed -n -e '/board\[nam_l\]/ s/.*board\[nam_l\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${NAM_L}" = "" ] && NAM_L=8
+
+ # 페이지 당 게시물 수
+ PERNO=$(sed -n -e '/board\[perno\]/ s/.*board\[perno\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${PERNO}" = "" ] && PERNO=10
+
+ # 페이지 목록 출력 갯수
+ PLIST=$(sed -n -e '/board\[plist\]/ s/.*board\[plist\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${PLIST}" = "" ] && PLIST=3
+
+ # 쿠키값
+ COOKIE=$(sed -n -e '/board\[cookie\]/ s/.*board\[cookie\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${COOKIE}" = "" ] && COOKIE=30
+
+ # IP address 출력 여부(상단 메뉴 출력 안할시)
+ DHOST=$(sed -n -e '/enable\[dhost\]/ s/.*enable\[dhost\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${DHOST}" = "" ] && DHOST=0
+
+ # DNS lookup 여부
+ DLOOK=$(sed -n -e '/enable\[dlook\]/ s/.*enable\[dlook\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${DLOOK}" = "" ] && DLOOK=0
+
+ # WHOIS 검색 여부
+ DWHO=$(sed -n -e '/enable\[dwho\]/ s/.*enable\[dwho\][^=]*=[^\"0-9]*[\"]*\([0-9]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${DWHO}" = "" ] && DWHO=0
+
+ # upload 사용 여부
+ YESNO=$(sed -n -e '/cupload\[yesno\]/ s/.*cupload\[yesno\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+
+ case ${YESNO} in
+ y*|Y*) YESNO=1;;
+ *) YESNO=0;;
+ esac
+
+ # URL 출력 여부
+ VURL=$(sed -n -e '/view\[url\]/ s/.*view\[url\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+
+ case ${VURL} in
+ y*|Y*) VURL=1;;
+ *) VURL=0;;
+ esac
+
+ # EMAIL 출력 여부
+ VEMAIL=$(sed -n -e '/view\[email\]/ s/.*view\[email\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+
+ case ${VEMAIL} in
+ y*|Y*) VEMAIL=1;;
+ *) VEMAIL=0;;
+ esac
+
+ # 메일 발송 여부(어드민)
+ RADMIN=$(sed -n -e '/rmail\[admin\]/ s/.*rmail\[admin\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+
+ case ${RADMIN} in
+ y*|Y*) RADMIN=1;;
+ *) RADMIN=0;;
+ esac
+
+ # 메일 발송 여부(유저)
+ RUSER=$(sed -n -e '/rmail\[user\]/ s/.*rmail\[user\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+
+ case ${RUSER} in
+ y*|Y*) RUSER=1;;
+ *) RUSER=0;;
+ esac
+
+ # 메일 발송 주소(어드민)
+ TOADMIN=$(sed -n -e '/rmail\[toadmin\]/ s/.*rmail\[toadmin\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${TOADMIN}" = "" ] && TOADMIN=""
+
+
+ # 패스워드 요구 정보(이름)
+ CNAME=$(sed -n -e '/ccompare\[name\]/ s/.*ccompare\[name\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${CNAME}" = "" ] && CNAME=""
+
+ # 패스워드 요구 정보(메일)
+ CEMAIL=$(sed -n -e '/ccompare\[email\]/ s/.*ccompare\[email\][^=]*=[^\"a-zA-Z\xA1-\xFE]*[\"]\([^\"]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ [ "${CEMAIL}" = "" ] && CEMAIL=""
+
+ # LANGUAGE 체크
+ CLANG=$(sed -n -e '/langs\[code\]/ s/.*langs\[code\][^=]*=[^\"a-zA-Z]*[\"]*\([a-zA-Z]*\)[\" ]*;.*/\1/p;' ${CONFFILE})
+ case ${CLANG} in
+ ko|KO|Ko|kO) CTHEME="KO-default" ;;
+ en|EN|En|eN) CTHEME="EN-default" ;;
+ *) CTHEME="EN-default"
+ esac
+
+ cp -af ${DEFAULTPATH}/data/${i}/config.php ${DEFAULTPATH}/data/${i}/config.php.old
+
+ echo " 게시판 관리자 id
+# mode -> 게시판 관리 모드
+# 0 -> 공개 게시판
+# 1 -> 공지 게시판 (admin only write)
+# 2 -> 회원 전용 게시판
+# 3 -> 회원 전용 공지 게시판 (admin only write)
+# 4 -> 공개 게시판 (read, reply only)
+# 5 -> 회원 전용 게시판 (read, reply only)
+# 6 -> 공개 게시판 (reply only admin)
+# 7 -> 회원 전용 게시판 (reply only admin)
+###############################################################################
+#
+\$board[ad] = \"admin\";
+\$board[mode] = 0;
+
+# 로그인 모드시에 이름 출력을 실명으로 할지 Nickname 으로 할지 결정
+# 이 변수값이 설정이 안되어 있으면 Nickname 으로 출력
+\$board[rnname] = 0;
+
+# 로그아웃 후에 이동할 페이지를 지정
+\$print[dopage] = \"${ABBS}list.php?table=${i}\";
+
+
+###############################################################################
+# 게시판 허가 설정
+###############################################################################
+#
+\$enable[pre] = ${PRE}; # 미리 보기 허가
+\$enable[preren] = ${PREREN}; # 미리 보기 허가시 글 길이
+
+# 답장시 원본글 포함을 선택사항으로 설정
+#
+\$enable[ore] = ${ORE}; # 0 - 무조건 출력 1 - 선택사항
+
+# 글읽기에서 관련글이 있을 경우 관련글 리스트를 보여줄지 여부 설정
+#
+\$enable[re_list] = ${RE_LIST}; # 0 - 보여주지 않음 1 - 보여줌
+
+
+###############################################################################
+# 게시판 정렬 상태를 설정
+###############################################################################
+#
+\$board[align] = \"${ALIGN}\"; #
+
+
+###############################################################################
+# 게시판 기본 설정
+###############################################################################
+#
+\$board[title] = \"${TITLE}\"; # 게시판 제목
+\$board[wrap] = ${WRAP}; # 본문 길게 늘어지는것 방지
+\$board[wwrap] = ${WWRAP}; # \$board[wrap]이 적용안될시 강제 적용
+\$board[width] = \"${WIDTH}\"; # 게시판 너비
+\$board[tit_l] = ${TIT_L}; # 제목 필드 최대 길이
+\$board[nam_l] = ${NAM_L}; # 글쓴이 필드 최대 길이
+\$board[perno] = ${PERNO}; # 페이지 당 게시물 수
+\$board[plist] = ${PLIST}; # 페이지 목록 출력 갯수 (x2)
+
+# 쿠키 기간 설정 (日)
+\$board[cookie] = ${COOKIE};
+
+
+###############################################################################
+# 호스트 정보 출력 설정 0 - Failed, 1 - True
+###############################################################################
+#
+\$enable[dhost] = ${DHOST}; # IP address 출력 여부(상단 메뉴 출력 안할시)
+\$enable[dlook] = ${DLOOK}; # DNS lookup 여부
+\$enable[dwho] = ${DWHO}; # WHOIS 검색 여부
+
+
+###############################################################################
+# Theme Configuration
+###############################################################################
+#
+\$print[theme] = \"${CTHEME}\"; # Theme 이름
+
+
+###############################################################################
+# file upload 관련 설정
+# 전체 관리자가 허락 하지 않으면 여기서 yes를 선택해도 이기능을 사용할수 없다
+###############################################################################
+#
+\$cupload[yesno] = ${YESNO}; # upload 사용 여부
+
+
+###############################################################################
+# url,email 사용 여부 설정
+###############################################################################
+#
+\$view[url] = ${VURL};
+\$view[email] = ${VEMAIL};
+
+
+###############################################################################
+# mail 발송 여부 설정
+# 전체 관리자의 기능 on에 의해 사용을 할수 있다
+###############################################################################
+#
+\$rmail[admin] = ${RADMIN};
+\$rmail[user] = ${RUSER};
+\$rmail[toadmin] = \"${TOADMIN}\"; # 메일을 받을 게시판 관리자의 메일 주소
+
+
+###############################################################################
+# 아래의 정보를 사용하여 글 등록시 관리자의 password를 요구
+###############################################################################
+#
+\$ccompare[name] = \"${CNAME}\";
+\$ccompare[email] = \"${CEMAIL}\";
+
+
+###############################################################################
+# IP Blocking 기능
+# 설정값의 구분자는 ';' 로 한다.
+# 설정 예) 1.1.1.1;2.2.2.2;3.3.3.3
+###############################################################################
+\$enable[ipbl] = \"\";
+
+
+###############################################################################
+# 원격의 하이퍼링크를 통해 들어오는 접속제어
+# dhyper : 0 -> 등록된 값만 허락
+# 1 -> 등록된 값만 막음
+# plink 가 없을 경우에는 작동 안함
+# plink : dhyper 가 작동할 ip 주소. ';' 를 구분자로 사용
+# 설정 예) 1.1.1.1;2.2.2.2;3.3.3.3
+###############################################################################
+#
+\$enable[dhyper] = 0;
+\$enable[plink] = \"\";
+?>" > ${DEFAULTPATH}/data/${i}/config.php
+
+done
+
+exit 0
diff --git a/INSTALLER/script/dbconv_to_20 b/INSTALLER/script/dbconv_to_20
new file mode 100755
index 00000000..0d1bc46f
--- /dev/null
+++ b/INSTALLER/script/dbconv_to_20
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id: dbconv_to_20,v 1.6 2014/03/02 17:11:30 oops Exp $
+
+# 아래의 정보들은 global.php 의 DB 정보와 동일하게 입력함.
+# jsboard 에 접근할 유저이름
+DB_USER=
+
+# jsboard 에 접근할 유저 패스워드
+DB_PASS=
+
+# jsboard 가 사용할 database 이름
+DB_NAME=
+
+# 만약 사용하는 database 에 JSBoard 가 사용하는 table 외의 다른
+# 테이블이 존재할 경우에는 JSBoard 가 사용할 table 들을 직접 지
+# 정해 줘야 한다.
+# ex> TARGET="qna faq freeboard"
+#
+TARGET=""
+
+# mysql client path
+# find /usr -name mysql 로 찾도록 한다.
+MPATH=/usr/bin/mysql
+
+if [ "${TARGET}" = "" ]; then
+ TARGET=$(mysql -u${DB_USER} -p${DB_PASS} ${DB_NAME} -e "show tables" | grep -v "Tables_in_\|userdb")
+fi
+
+for i in ${TARGET}
+do
+ if [ "${TARGET}" != "userdb" ]; then
+ echo "Converting ${i} table ......."
+ ${MPATH} -u${DB_USER} -p${DB_PASS} ${DB_NAME} -e "ALTER TABLE ${i} ADD rname tinytext"
+ ${MPATH} -u${DB_USER} -p${DB_PASS} ${DB_NAME} -e "ALTER TABLE ${i} DROP moder"
+ ${MPATH} -u${DB_USER} -p${DB_PASS} ${DB_NAME} -e "ALTER TABLE ${i} MODIFY passwd varchar(56)"
+ fi
+done
+
+exit 0
diff --git a/INSTALLER/script/preinstall b/INSTALLER/script/preinstall
new file mode 100755
index 00000000..e8b31663
--- /dev/null
+++ b/INSTALLER/script/preinstall
@@ -0,0 +1,156 @@
+#!/bin/sh
+# $Id: preinstall,v 1.10 2014/03/02 17:11:30 oops Exp $
+clear
+echo "########################################################"
+echo "# JSBoard Pre Installer v2.0 #"
+echo "# Scripted By JoungKyun Kim < http://www.oops.org > #"
+echo "########################################################"
+echo
+
+EXE=
+
+echo "STEP 1 Language Check"
+echo "---------------------"
+echo -n "Can you enable to use KOREAN in this console? [Y/N](default Y) : "
+read langs
+
+case "${langs}" in
+ N*|n*)
+ langs=en ;;
+ *)
+ langs=ko ;;
+esac
+
+me=$(whoami)
+
+if [ "${me}" != "root" ]; then
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "주의 !!!"
+ echo "현재 당신은 ${me} 유저로 이 파일을 실행하고 있습니다."
+ echo "만약 루트의 권한이 있으면 이 파일을 루트의 권한으로 실행하십시오"
+ echo
+ else
+ echo
+ echo "Attention !!!"
+ echo "Now, U are running this file as ${me} user."
+ echo "If u have root privilege, U must excute this file as root user."
+ echo
+ fi
+
+ if [ "${langs}" = "ko" ]; then
+ echo "Root 유저로 다시 작업 하시겠습니까?"
+ echo -n "Root 권한을 얻을수 없다면 N 을 선택하십시오. [Y/N](default N) : "
+ else
+ echo "Do you continue as root user?"
+ echo -n "If you can't login as root, type N. [Y/N](default N) : "
+ fi
+ read priv
+
+ case "${priv}" in
+ Y*|y*)
+ priv=y ;;
+ *)
+ priv=n ;;
+ esac
+
+ if [ "${priv}" = "y" ]; then
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "root 로 로그인을 하신 후에 다시 실행해 주십시오"
+ else
+ echo
+ echo "Excute this file after login as root user"
+ fi
+ exit 0
+ fi
+fi
+
+if [ ! -d "../../data" ]; then
+ mkdir ../../data
+fi
+
+if [ ! -d "../../config" ]; then
+ mkdir ../../config
+fi
+
+if [ "${me}" = "root" ]; then
+ #AUSER=$(ps aux | grep -E "apache|httpd" | grep -v ^root | grep -v grep | awk '{print $1}' | uniq)
+ AUSER=$(ps aux|awk '{print $1,$2}'|grep "$(ps ax|grep -E 'apache|httpd|www|www-data'|grep -v grep|awk '{print $1}')"|grep -v ^root|awk '{print $1}'|uniq)
+
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "웹서버가 ${AUSER} 의 권한으로 작동하고 있는듯 싶습니다."
+ echo -n "맞습니까? 있는 값과 일치해야 합니다. [Y/N](default Y) : "
+ else
+ echo
+ echo "Maybe web server is running as ${AUSER} privilege."
+ echo -n "Is Right? [Y/N](default Y) : "
+ fi
+
+ read achk
+
+ case "${achk}" in
+ N*|n*)
+ achk=n ;;
+ *)
+ achk=y ;;
+ esac
+
+ if [ "${achk}" = "n" ]; then
+ AUSER=
+ while [ true ]
+ do
+ if [ "${AUSER}" != "" ]; then
+ break
+ else
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo -n "웹서버의 Group 권한을 입력 하십시오 : "
+ else
+ echo
+ echo -n "Input value of Group privilege on web server : "
+ fi
+ read AUSER
+ fi
+ done
+ fi
+
+ chgrp ${AUSER} ../../config > /dev/null 2>&1
+ [ "$?" != "0" ] && EXE=1
+ chgrp ${AUSER} ../../data > /dev/null 2>&1
+ [ "$?" != "0" ] && EXE=1
+ chmod 731 ../../config > /dev/null 2>&1
+ [ "$?" != "0" ] && EXE=1
+ chmod 775 ../../data > /dev/null 2>&1
+ [ "$?" != "0" ] && EXE=1
+
+ if [ "${EXE}" = "1" ]; then
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "${AUSER} 는 잘못된 값입니다. httpd.conf 에서 Group 지시자의"
+ echo "값을 확인하시고 다시 시도하십시오"
+ else
+ echo
+ echo "Value ${AUSER} is incollect. Retry after confirms value of"
+ echo "Group directive in httpd.conf"
+ fi
+ exit 1
+ fi
+
+else
+ chmod 707 ../../config
+ chmod 707 ../../data
+fi
+
+if [ "${langs}" = "ko" ]; then
+ echo
+ echo "작업이 완료 되었습니다. jsboard/INSTALLER/include/passwd.php의 정보를"
+ echo "적절히 수정한 후에, 브라우져로 jsboard/INSTALLER/ 로 접속하여 echo 설"
+ echo "치를 계속 하시기 바랍니다."
+else
+ echo
+ echo "Complete this working. After Edit jsboard/INSTALLER/include/passwd.php and"
+ echo " access jsboard/INSTALLER with web browser, continue install jop"
+fi
+exit 0
diff --git a/INSTALLER/script/root b/INSTALLER/script/root
new file mode 100755
index 00000000..a3a2c901
--- /dev/null
+++ b/INSTALLER/script/root
@@ -0,0 +1,153 @@
+#!/bin/sh
+# $Id: root,v 1.11 2014/03/02 17:11:30 oops Exp $
+clear
+echo "########################################################"
+echo "# JSBoard Config File Installer v2.1 #"
+echo "# Scripted By JoungKyun Kim < http://oops.org > #"
+echo "########################################################"
+echo
+
+echo "STEP 1 Language Check"
+echo "---------------------"
+echo -n "Do you want to use Korean during the installation? [Y/N](default Y) : "
+read langs
+
+case "${langs}" in
+ N*|n*)
+ langs=en ;;
+ *)
+ langs=ko ;;
+esac
+
+# location of apache configuration file
+if [ -f "/etc/httpd/conf/httpd.conf" ] ;then
+ CONF="/etc/httpd/conf/httpd.conf"
+elif [ -f "/etc/www/conf/httpd.conf" ]; then
+ CONF="/etc/www/conf/httpd.conf"
+elif [ -f "/etc/www/httpd.conf" ]; then
+ CONF="/etc/www/httpd.conf"
+elif [ -f "/usr/local/apache/conf/httpd.conf" ]; then
+ CONF="/usr/local/apache/conf/httpd.conf"
+elif [ -f "/usr/local/etc/apache/httpd.conf" ]; then
+ CONF="/usr/local/etc/apache/httpd.conf"
+elif [ -f "/etc/apache/conf/commonapache.conf" ]; then
+ CONF="/etc/apache/conf/commonapache.conf"
+else
+ while [ true ];
+ do
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "[1;31mERROR[7;0m : httpd.conf 를 찾을 수가 없습니다."
+ echo -n "httpd.conf 의 절대 경로를 지정해 주십시오 : "
+ else
+ echo
+ echo "[1;31mERROR[7;0m : Can't find httpd.conf"
+ echo -n "Please specify the location of httpd.conf : "
+
+ fi
+ read CONF
+
+ [ -f "${CONF}" ] && break
+ done
+fi
+
+DIST=`uname -s`
+Auser=$(ps uax | grep -E "apache|httpd|www|www-data" | grep -v ^root | grep -v grep | awk '{print $1}' | uniq)
+Agroup=$(cat ${CONF} | grep -E "^(`echo -ne "\t"`|[ ])*Group " | awk '{print $2}')
+
+if [ "${langs}" = "ko" ]; then
+ . ./LANG/ko.conf
+else
+ . ./LANG/en.conf
+fi
+
+echo
+echo "########################################################"
+echo "${SYSTEM_IN}"
+echo "########################################################"
+echo "#"
+echo "${SYSTEM_LN}"
+echo "${SYSTEM_OS}"
+echo "${SYSTEM_HU}"
+echo "${SYSTEM_HG}"
+echo "#"
+echo "########################################################"
+echo
+echo
+
+if [ "${Agroup}" = "#-1" ]; then
+ echo -e "${SYSTEM_GE}"
+ exit 1
+else
+ echo "${SYSTEM_MN}"
+ echo -n "${SYSTEM_AL}"
+ read INFO
+fi
+
+case "${INFO}" in
+ N*|n*)
+ INFO=N ;;
+ *)
+ INFO=Y ;;
+esac
+
+if [ "$INFO" = "N" ] ; then
+ echo
+ echo "1. Webserver user configuration"
+ echo -n "${RECONF_HU}"
+ read Auser
+
+ while [ true ]; do
+ if [ ${Auser} ]; then
+ break;
+ else
+ echo -n "${RECONF_HU}"
+ read Auser
+ fi
+ done
+
+ echo
+ echo "2. Webserver group configuration"
+ echo -n "${RECONF_HG}"
+ read Agroup
+
+ while [ true ]; do
+ if [ ${Agroup} ]; then
+ break;
+ else
+ echo -n "${RECONF_HG}"
+ read Agroup
+ fi
+ done
+fi
+
+cp -Rp ../sample/admin/global.php.orig ../../config/global.php
+cp -Rp ../sample/admin/spam_list.txt.orig ../../config/spam_list.txt
+if [ -d "../../data/test" ]; then
+ cp -Rp ../sample/data/* ../../data/test/
+else
+ cp -Rp ../sample/data ../../data/test
+fi
+
+# owner configuration
+chgrp ${Agroup} ../../config
+chgrp -R ${Agroup} ../../data/
+chgrp ${Agroup} ../../config/global.php
+chgrp ${Agroup} ../../config/spam_list.txt
+
+# permission configuration
+chmod 731 ../../config
+chmod 775 ../../data
+chmod 775 ../../data/test
+chmod 775 ../../data/test/files
+chmod 664 ../../config/spam_list.txt
+chmod 660 ../../config/global.php
+chmod 664 ../../data/test/config.php
+chmod 664 ../../data/test/html_head.php
+chmod 664 ../../data/test/html_tail.php
+chmod 664 ../../data/test/stylesheet.php
+
+echo
+echo "${ENDMSG}"
+echo
+exit 0
diff --git a/INSTALLER/script/root_p b/INSTALLER/script/root_p
new file mode 100755
index 00000000..b8de0f33
--- /dev/null
+++ b/INSTALLER/script/root_p
@@ -0,0 +1,144 @@
+#!/bin/sh
+# $Id: root_p,v 1.10 2014/03/02 17:11:30 oops Exp $
+clear
+echo "########################################################"
+echo "# JSBoard Config File Permissioner v2.0 #"
+echo "# Scripted By JoungKyun Kim < http://www.oops.org > #"
+echo "########################################################"
+echo
+
+echo "STEP 1 Language Check"
+echo "---------------------"
+echo -n "Do you want to use Korean during the installation? [Y/N](default Y) : "
+read langs
+
+case "${langs}" in
+ N*|n*)
+ langs=en ;;
+ *)
+ langs=ko ;;
+esac
+
+# location of apache configuration file
+if [ -f "/etc/httpd/conf/httpd.conf" ] ;then
+ CONF="/etc/httpd/conf/httpd.conf"
+elif [ -f "/etc/www/conf/httpd.conf" ]; then
+ CONF="/etc/www/conf/httpd.conf"
+elif [ -f "/etc/www/httpd.conf" ]; then
+ CONF="/etc/www/httpd.conf"
+elif [ -f "/usr/local/apache/conf/httpd.conf" ]; then
+ CONF="/usr/local/apache/conf/httpd.conf"
+elif [ -f "/usr/local/etc/apache/httpd.conf" ]; then
+ CONF="/usr/local/etc/apache/httpd.conf"
+elif [ -f "/etc/apache/conf/commonapache.conf" ]; then
+ CONF="/etc/apache/conf/commonapache.conf"
+else
+ while [ true ];
+ do
+ if [ "${langs}" = "ko" ]; then
+ echo
+ echo "^[[1;31mERROR^[[7;0m : httpd.conf 를 찾을 수가 없습니다."
+ echo -n "httpd.conf 의 절대 경로를 지정해 주십시오 : "
+ else
+ echo
+ echo "^[[1;31mERROR^[[7;0m : Can't find httpd.conf"
+ echo -n "Please specify the location of httpd.conf : "
+ fi
+ read CONF
+
+ [ -f "${CONF}" ] && break
+ done
+fi
+
+DIST=`uname -s`
+Auser=$(ps uax | grep -E "apache|httpd" | grep -v ^root | grep -v grep | awk '{print $1}' | uniq)
+Agroup=$(cat ${CONF} | grep -E "^(`echo -ne "\t"`|[ ])*Group " | awk '{print $2}')
+
+if [ "${langs}" = "ko" ]; then
+ . ./LANG/ko.conf
+else
+ . ./LANG/en.conf
+fi
+
+echo
+echo "########################################################"
+echo "${SYSTEM_IN}"
+echo "########################################################"
+echo "#"
+echo "${SYSTEM_LN}"
+echo "${SYSTEM_OS}"
+echo "${SYSTEM_HU}"
+echo "${SYSTEM_HG}"
+echo "#"
+echo "########################################################"
+echo
+echo
+
+if [ "${Agroup}" = "#-1" ]; then
+ echo -e "${SYSTEM_GE}"
+ exit 1
+else
+ echo "${SYSTEM_MN}"
+ echo -n "${SYSTEM_AL}"
+ read INFO
+fi
+
+case "${INFO}" in
+ N*|n*)
+ INFO=N ;;
+ *)
+ INFO=Y ;;
+esac
+
+if [ "$INFO" = "N" ] ; then
+ echo
+ echo "1. Webserver user configuration"
+ echo -n "${RECONF_HU}"
+ read Auser
+
+ while [ true ]; do
+ if [ ${Auser} ]; then
+ break;
+ else
+ echo -n "${RECONF_HU}"
+ read Auser
+ fi
+ done
+
+ echo
+ echo "2. Webserver group configuration"
+ echo -n "${RECONF_HG}"
+ read Agroup
+
+ while [ true ]; do
+ if [ ${Agroup} ]; then
+ break;
+ else
+ echo -n "${RECONF_HG}"
+ read Agroup
+ fi
+ done
+fi
+
+# owner configuration
+chgrp ${Agroup} ../../config
+chgrp -R ${Agroup} ../../data/
+chgrp ${Agroup} ../../config/global.php
+chgrp ${Agroup} ../../config/spam_list.txt
+
+# permission configuration
+chmod 731 ../../config
+chmod 775 ../../data
+chmod 775 ../../data/*
+chmod 775 ../../data/*/files
+chmod 775 ../../data/*/files/*
+chmod 664 ../../data/*/files/*/*
+chmod 664 ../../data/*/*.*
+chmod 664 ../../config/spam_list.txt
+chmod 660 ../../config/global.php
+
+echo
+echo "${ENDMSG}"
+echo
+
+exit 0
diff --git a/INSTALLER/session.php b/INSTALLER/session.php
new file mode 100644
index 00000000..ce21af17
--- /dev/null
+++ b/INSTALLER/session.php
@@ -0,0 +1,58 @@
+\n",$str);
+}
+?>
+
+
+
+
JSBoard Initialize
+
+
+
+
+
+ Message:
+ And If you want to go main administrator's page, click here !
+
+
+
diff --git a/README b/README
index 28f61e9f..5124ea88 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
-$Id: README,v 1.3 2009-11-16 21:52:45 oops Exp $
+$Id: README,v 1.2 2009/11/19 05:29:49 oops Exp $
ENGLISH message
-goto doc/en
+goto jsboard/doc/en
KOREAN message
-goto doc/ko
+goto jsboard/doc/ko
diff --git a/SQL/mysql/board.sql b/SQL/mysql/board.sql
deleted file mode 100644
index 883abf74..00000000
--- a/SQL/mysql/board.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@ (
- no int(6) NOT NULL auto_increment,
- num int(6) DEFAULT '0' NOT NULL,
- idx int(6) DEFAULT '0' NOT NULL,
- date int(11) DEFAULT '0' NOT NULL,
- host tinytext,
- name tinytext,
- rname tinytext,
- passwd varchar(56),
- email tinytext,
- url tinytext,
- title tinytext,
- text mediumtext,
- refer int(6) DEFAULT '0' NOT NULL,
- reyn int(1) DEFAULT '0' NOT NULL,
- reno int(6) DEFAULT '0' NOT NULL,
- rede int(6) DEFAULT '0' NOT NULL,
- reto int(6) DEFAULT '0' NOT NULL,
- html int(1) DEFAULT '1' NOT NULL,
- comm int(6) DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int(4),
- KEY no (no),
- KEY num (num),
- KEY idx (idx),
- KEY reno (reno),
- KEY date (date),
- KEY reto (reto),
- KEY comm (comm),
- PRIMARY KEY (no)
- ) TYPE=MyISAM;
diff --git a/SQL/mysql/comment.sql b/SQL/mysql/comment.sql
deleted file mode 100644
index c0bcad85..00000000
--- a/SQL/mysql/comment.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@_comm (
- no int(6) NOT NULL auto_increment,
- reno int(20) NOT NULL default '0',
- rname tinytext,
- name tinytext,
- passwd varchar(56) default NULL,
- text mediumtext,
- host tinytext,
- date int(11) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY parent (reno)
- ) TYPE=MyISAM;
-
diff --git a/SQL/mysql/userdb.sql b/SQL/mysql/userdb.sql
deleted file mode 100644
index 14e2edbf..00000000
--- a/SQL/mysql/userdb.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE userdb (
- no int(6) NOT NULL auto_increment,
- nid varchar(30) NOT NULL default '',
- name varchar(30) NOT NULL default '',
- email tinytext NOT NULL,
- url tinytext NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int(1) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY no (no),
- UNIQUE KEY nid (nid),
- KEY name (name),
- KEY position (position)
- ) TYPE=MyISAM;
-
diff --git a/SQL/mysql3/board.sql b/SQL/mysql3/board.sql
deleted file mode 100644
index bc4b057c..00000000
--- a/SQL/mysql3/board.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@ (
- no int(6) NOT NULL auto_increment,
- num int(6) DEFAULT '0' NOT NULL,
- idx int(6) DEFAULT '0' NOT NULL,
- date int(11) DEFAULT '0' NOT NULL,
- host tinytext,
- name tinytext,
- rname tinytext,
- passwd varchar(56),
- email tinytext,
- url tinytext,
- title tinytext,
- text mediumtext,
- refer int(6) DEFAULT '0' NOT NULL,
- reyn int(1) DEFAULT '0' NOT NULL,
- reno int(6) DEFAULT '0' NOT NULL,
- rede int(6) DEFAULT '0' NOT NULL,
- reto int(6) DEFAULT '0' NOT NULL,
- html int(1) DEFAULT '1' NOT NULL,
- comm int(6) DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int(4),
- KEY no (no),
- KEY num (num),
- KEY idx (idx),
- KEY reno (reno),
- KEY date (date),
- KEY reto (reto),
- KEY comm (comm),
- PRIMARY KEY (no)
- );
diff --git a/SQL/mysql3/comment.sql b/SQL/mysql3/comment.sql
deleted file mode 100644
index 5a652e38..00000000
--- a/SQL/mysql3/comment.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@_comm (
- no int(6) NOT NULL auto_increment,
- reno int(20) NOT NULL default '0',
- rname tinytext,
- name tinytext,
- passwd varchar(56) default NULL,
- text mediumtext,
- host tinytext,
- date int(11) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY parent (reno)
- );
-
diff --git a/SQL/mysql3/userdb.sql b/SQL/mysql3/userdb.sql
deleted file mode 100644
index e23889d4..00000000
--- a/SQL/mysql3/userdb.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE userdb (
- no int(6) NOT NULL auto_increment,
- nid varchar(30) NOT NULL default '',
- name varchar(30) NOT NULL default '',
- email tinytext NOT NULL,
- url tinytext NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int(1) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY no (no),
- UNIQUE KEY nid (nid),
- KEY name (name),
- KEY position (position)
- );
-
diff --git a/SQL/mysql4/board.sql b/SQL/mysql4/board.sql
deleted file mode 100644
index 6bc2a35f..00000000
--- a/SQL/mysql4/board.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@ (
- no int(6) NOT NULL auto_increment,
- num int(6) DEFAULT '0' NOT NULL,
- idx int(6) DEFAULT '0' NOT NULL,
- date int(11) DEFAULT '0' NOT NULL,
- host tinytext,
- name tinytext,
- rname tinytext,
- passwd varchar(56),
- email tinytext,
- url tinytext,
- title tinytext,
- text mediumtext,
- refer int(6) DEFAULT '0' NOT NULL,
- reyn int(1) DEFAULT '0' NOT NULL,
- reno int(6) DEFAULT '0' NOT NULL,
- rede int(6) DEFAULT '0' NOT NULL,
- reto int(6) DEFAULT '0' NOT NULL,
- html int(1) DEFAULT '1' NOT NULL,
- comm int(6) DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int(4),
- KEY no (no),
- KEY num (num),
- KEY idx (idx),
- KEY reno (reno),
- KEY date (date),
- KEY reto (reto),
- KEY comm (comm),
- PRIMARY KEY (no)
- )
diff --git a/SQL/mysql4/comment.sql b/SQL/mysql4/comment.sql
deleted file mode 100644
index e84024a8..00000000
--- a/SQL/mysql4/comment.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@_comm (
- no int(6) NOT NULL auto_increment,
- reno int(20) NOT NULL default '0',
- rname tinytext,
- name tinytext,
- passwd varchar(56) default NULL,
- text mediumtext,
- host tinytext,
- date int(11) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY parent (reno)
- )
-
diff --git a/SQL/mysql4/userdb.sql b/SQL/mysql4/userdb.sql
deleted file mode 100644
index 65a6de4d..00000000
--- a/SQL/mysql4/userdb.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE userdb (
- no int(6) NOT NULL auto_increment,
- nid varchar(30) NOT NULL default '',
- name varchar(30) NOT NULL default '',
- email tinytext NOT NULL,
- url tinytext NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int(1) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY no (no),
- UNIQUE KEY nid (nid),
- KEY name (name),
- KEY position (position)
- )
-
diff --git a/SQL/mysql41/board.sql b/SQL/mysql41/board.sql
deleted file mode 100644
index bf492fd9..00000000
--- a/SQL/mysql41/board.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@ (
- no int(6) NOT NULL auto_increment,
- num int(6) DEFAULT '0' NOT NULL,
- idx int(6) DEFAULT '0' NOT NULL,
- date int(11) DEFAULT '0' NOT NULL,
- host tinytext,
- name tinytext,
- rname tinytext,
- passwd varchar(56),
- email tinytext,
- url tinytext,
- title tinytext,
- text mediumtext,
- refer int(6) DEFAULT '0' NOT NULL,
- reyn int(1) DEFAULT '0' NOT NULL,
- reno int(6) DEFAULT '0' NOT NULL,
- rede int(6) DEFAULT '0' NOT NULL,
- reto int(6) DEFAULT '0' NOT NULL,
- html int(1) DEFAULT '1' NOT NULL,
- comm int(6) DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int(4),
- KEY no (no),
- KEY num (num),
- KEY idx (idx),
- KEY reno (reno),
- KEY date (date),
- KEY reto (reto),
- KEY comm (comm),
- PRIMARY KEY (no)
- ) CHARSET=euckr
diff --git a/SQL/mysql41/comment.sql b/SQL/mysql41/comment.sql
deleted file mode 100644
index 84d8bd3e..00000000
--- a/SQL/mysql41/comment.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE @table@_comm (
- no int(6) NOT NULL auto_increment,
- reno int(20) NOT NULL default '0',
- rname tinytext,
- name tinytext,
- passwd varchar(56) default NULL,
- text mediumtext,
- host tinytext,
- date int(11) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY parent (reno)
- ) CHARSET=euckr
-
diff --git a/SQL/mysql41/userdb.sql b/SQL/mysql41/userdb.sql
deleted file mode 100644
index c8a3e4cf..00000000
--- a/SQL/mysql41/userdb.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-# sql
-# # ڴ ּ ó
-# sql ̾ tab ؾ .
-# õ
-
-CREATE TABLE userdb (
- no int(6) NOT NULL auto_increment,
- nid varchar(30) NOT NULL default '',
- name varchar(30) NOT NULL default '',
- email tinytext NOT NULL,
- url tinytext NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int(1) NOT NULL default '0',
- PRIMARY KEY (no),
- KEY no (no),
- UNIQUE KEY nid (nid),
- KEY name (name),
- KEY position (position)
- ) CHARSET=euckr
-
diff --git a/SQL/pgsql/board.sql b/SQL/pgsql/board.sql
deleted file mode 100644
index 16d77b29..00000000
--- a/SQL/pgsql/board.sql
+++ /dev/null
@@ -1,38 +0,0 @@
---
--- sql
--- ù -- ϸ ش ּ ó
--- sql ̾ tab ؾ .
--- õ
---
-
-CREATE TABLE @table@ (
- no serial NOT NULL,
- num int DEFAULT '0' NOT NULL,
- idx int DEFAULT '0' NOT NULL,
- date int DEFAULT '0' NOT NULL,
- host text,
- name text,
- rname text,
- passwd varchar(56),
- email text,
- url text,
- title text,
- text text,
- refer int DEFAULT '0' NOT NULL,
- reyn int DEFAULT '0' NOT NULL,
- reno int DEFAULT '0' NOT NULL,
- rede int DEFAULT '0' NOT NULL,
- reto int DEFAULT '0' NOT NULL,
- html int DEFAULT '1' NOT NULL,
- comm int DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int,
- PRIMARY KEY (no)
- ) without oids;
-CREATE INDEX @table@_num_i on @table@ (num);
-CREATE INDEX @table@_idx_i on @table@ (idx);
-CREATE INDEX @table@_reno_i on @table@ (reno);
-CREATE INDEX @table@_date_i on @table@ (date);
-CREATE INDEX @table@_reto_i on @table@ (reto);
-CREATE INDEX @table@_comm_i on @table@ (comm);
diff --git a/SQL/pgsql/comment.sql b/SQL/pgsql/comment.sql
deleted file mode 100644
index 91dca8ce..00000000
--- a/SQL/pgsql/comment.sql
+++ /dev/null
@@ -1,19 +0,0 @@
---
--- sql
--- ù -- ϸ ش ּ ó
--- sql ̾ tab ؾ .
--- õ
---
-
-CREATE TABLE @table@_comm (
- no serial NOT NULL,
- reno int NOT NULL default '0',
- rname text,
- name text,
- passwd varchar(56) default NULL,
- text text,
- host text,
- date int NOT NULL default '0',
- PRIMARY KEY (no)
- ) without oids;
-CREATE INDEX @table@_comm_reno_i on @table@_comm (reno);
diff --git a/SQL/pgsql/userdb.sql b/SQL/pgsql/userdb.sql
deleted file mode 100644
index e6a612a1..00000000
--- a/SQL/pgsql/userdb.sql
+++ /dev/null
@@ -1,21 +0,0 @@
---
--- sql
--- ù -- ϸ ش ּ ó
--- sql ̾ tab ؾ .
--- õ
---
-
-CREATE TABLE userdb (
- no serial NOT NULL,
- nid varchar(30) NOT NULL default '',
- name varchar(30) NOT NULL default '',
- email text NOT NULL,
- url text NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int NOT NULL default '0',
- PRIMARY KEY (no)
- ) without oids;
-CREATE UNIQUE INDEX userdb_nid_i on userdb (nid);
-CREATE INDEX userdb_name_i on userdb (name);
-CREATE INDEX userdb_position_i on userdb (position);
-
diff --git a/SQL/sqlite/board.sql b/SQL/sqlite/board.sql
deleted file mode 100644
index 356a89c0..00000000
--- a/SQL/sqlite/board.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-CREATE TABLE @table@ (
- no integer NOT NULL PRIMARY KEY,
- num int(6) DEFAULT '0' NOT NULL,
- idx int(6) DEFAULT '0' NOT NULL,
- date int(11) DEFAULT '0' NOT NULL,
- host tinytext,
- name tinytext,
- rname tinytext,
- passwd varchar(56),
- email tinytext,
- url tinytext,
- title tinytext,
- text mediumtext,
- refer int(6) DEFAULT '0' NOT NULL,
- reyn int(1) DEFAULT '0' NOT NULL,
- reno int(6) DEFAULT '0' NOT NULL,
- rede int(6) DEFAULT '0' NOT NULL,
- reto int(6) DEFAULT '0' NOT NULL,
- html int(1) DEFAULT '1' NOT NULL,
- comm int(6) DEFAULT '0' NOT NULL,
- bofile varchar(100),
- bcfile varchar(100),
- bfsize int(4)
- );
-CREATE INDEX @table@_num_i on @table@(num);
-CREATE INDEX @table@_idx_i on @table@(idx);
-CREATE INDEX @table@_date_i on @table@(date);
-CREATE INDEX @table@_reno_i on @table@(reno);
-CREATE INDEX @table@_reto_i on @table@(reto);
-CREATE INDEX @table@_comm_i on @table@(comm);
diff --git a/SQL/sqlite/comment.sql b/SQL/sqlite/comment.sql
deleted file mode 100644
index 562decef..00000000
--- a/SQL/sqlite/comment.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE @table@_comm (
- no integer NOT NULL PRIMARY KEY,
- reno int(20) NOT NULL default '0',
- rname tinytext,
- name tinytext,
- passwd varchar(56) default NULL,
- text mediumtext,
- host tinytext,
- date int(11) NOT NULL default '0'
- );
-CREATE INDEX @table@_comm_reno_i on @table@_comm(reno);
diff --git a/SQL/sqlite/userdb.sql b/SQL/sqlite/userdb.sql
deleted file mode 100644
index 98d2c4cf..00000000
--- a/SQL/sqlite/userdb.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-CREATE TABLE userdb (
- no integer NOT NULL PRIMARY KEY,
- nid varchar(30) UNIQUE NOT NULL,
- name varchar(30) NOT NULL,
- email tinytext NOT NULL,
- url tinytext NOT NULL,
- passwd varchar(100) NOT NULL default '',
- position int(1) NOT NULL default '0'
- );
-CREATE INDEX userdb_nid_i on userdb(nid);
-CREATE INDEX userdb_name_i on userdb(name);
-CREATE INDEX userdb_pos_i on userdb(position);
-
diff --git a/act.php b/act.php
index 4ae20259..6be347c1 100644
--- a/act.php
+++ b/act.php
@@ -1,18 +1,19 @@
check ($atc['ckey'], $atc['ckeyv']) === false )
- print_error ($_('captinvalid'),250,150,1);
+ print_error ($langs['captinvalid'],250,150,1);
}
- # Խù ۼ Լ
- function article_post($table, $atc) {
- global $jsboard, $board, $upload, $cupload, $rmail, $_, $agent;
- global $print, $max_file_size, $c, $db, $o;
+ # 게시물 작성 함수
+ function article_post(&$c, $table, $atc) {
+ global $jsboard, $board, $upload, $cupload, $rmail, $langs, $agent;
+ global $print, $max_file_size, $o;
- if($board['mode'] == 4 && $board['super'] != 1 && !$board['adm']) print_error($_('login_err'));
+ if($board['mode'] == 4 && $board['super'] != 1 && !$board['adm']) print_error($langs['login_err']);
- $atc['date'] = time(); # ð
- $atc['host'] = get_hostname(0); # ۾ ּ
+ $atc['date'] = time(); # 현재 시각
+ $atc['host'] = get_hostname(0); # 글쓴이 주소
- # Injection html Ѵ.
- # phpbb bb tag ó
+ # Injection 등의 위험 요소 때문에 html 쓰기 지원을 포기한다.
+ # phpbb 의 bb tag 처럼 대안을 제시
$atc['html'] = 2;
- # ȣȯ ÿ html header tag ϴ Ѵ.
+ # 글 등록 호환 모드시에 html header tag를 사용하는 것을 방지한다.
delete_tag($atc);
- $atc = article_check($table, $atc);
+ $atc = article_check($c, $table, $atc);
if(preg_match("/^0|4|6$/",$board['mode'])) $atc['passwd'] = crypt($atc['passwd']);
- # ü ڰ Ͽÿ upload Ҽ
+ # 전체 관리자가 허락하였을시에만 upload 기능을 사용할수 있음
if ($upload['yesno'] && $cupload['yesno'] && !$agent['tx']) {
$bfilename = date("YmdHis",$atc['date']);
$upfile = file_upload("userfile",$bfilename);
@@ -82,32 +83,29 @@ function article_post($table, $atc) {
$upfile['name'] = "";
}
} else {
- # winchild 99/11/26 fileupload = "no" 쿡 ʱȭ ־ Ѵ.
+ # winchild 99/11/26 fileupload = "no" 일 경우에는 초기화를 시켜주어야 한다.
$bfilename = "";
$upfile['size'] = 0;
$upfile['name'] = "";
}
- sql_escape ($c, $table);
- sql_escape ($c, $atc);
+ sql_escape($table,$c);
+ sql_escape($atc,$c);
- $result = sql_query("SELECT MAX(num) AS num, MAX(idx) AS idx FROM $table", $c);
- $_rr = sql_fetch_array ($result);
+ $result = sql_query("SELECT MAX(num) AS num, MAX(idx) AS idx FROM $table",$c);
+ $atc['mxnum'] = sql_result($result, 0, 'num', $c) + 1; # 최고 번호
+ $atc['mxidx'] = sql_result($result, 0, 'idx', $c) + 1; # 최고 인덱스 번호
+ sql_free_result($result, $c);
- $atc['mxnum'] = $_rr['num'] + 1; # ְ ȣ
- $atc['mxidx'] = $_rr['idx'] + 1; # ְ ε ȣ
+ sql_query("INSERT INTO $table (no,num,idx,date,host,name,rname,passwd,email,url,
+ title,text,refer,reyn,reno,rede,reto,html,comm,bofile,
+ bcfile,bfsize)
+ VALUES ('','{$atc['mxnum']}','{$atc['mxidx']}',{$atc['date']},'{$atc['host']}',
+ '{$atc['name']}','{$atc['rname']}','{$atc['passwd']}','{$atc['email']}',
+ '{$atc['url']}','{$atc['title']}','{$atc['text']}',0,0,0,0,0,'{$atc['html']}', 0,
+ '{$upfile['name']}','{$bfilename}','{$upfile['size']}')", $c);
- sql_free_result($result);
-
- sql_query("INSERT INTO $table (num,idx,date,host,name,rname,passwd,email,url,
- title,text,refer,reyn,reno,rede,reto,html,comm,bofile,
- bcfile,bfsize)
- VALUES ('{$atc['mxnum']}','{$atc['mxidx']}',{$atc['date']},'{$atc['host']}',
- '{$atc['name']}','{$atc['rname']}','{$atc['passwd']}','{$atc['email']}',
- '{$atc['url']}','{$atc['title']}','{$atc['text']}',0,0,0,0,0,'{$atc['html']}', 0,
- '{$upfile['name']}','{$bfilename}','{$upfile['size']}')", $c);
-
- # mail κ
+ # mail 보내는 부분
if ($rmail['uses']) {
if ($rmail['admin'] || $rmail['user']) {
$rmail['name'] = $atc['rtname'];
@@ -118,8 +116,8 @@ function article_post($table, $atc) {
$rmail['version'] = $board['ver'];
$rmail['path'] = $board['path'];
$rmail['table'] = $table;
- $rmail['noquery'] = sql_query("SELECT MAX(no) AS no FROM $table", $c);
- $rmail['no'] = sql_result($rmail['noquery'], 0, "no"); # ְ ȣ
+ $rmail['noquery'] = sql_query("SELECT MAX(no) AS no FROM $table",$c);
+ $rmail['no'] = sql_result($rmail['noquery'], 0, "no",$c); # 최고 번호
$rmail['reply_orig_email'] = $rmail['origmail'];
$rmail['theme'] = $print['theme'];
$rmail['html'] = $atc['html'];
@@ -133,76 +131,76 @@ function article_post($table, $atc) {
return $page;
}
- # Խù Լ
- function article_reply($table, $atc) {
- global $board,$upload,$cupload,$rmail,$_,$agent,$jsboard,$page;
- global $print, $max_file_size, $c, $db, $referer;
+ # 게시물 답장 함수
+ function article_reply(&$c, $table, $atc) {
+ global $board,$upload,$cupload,$rmail,$langs,$agent,$jsboard,$page;
+ global $print, $max_file_size, $o, $referer;
- $atc['date'] = time(); # ð
- $atc['host'] = get_hostname(0); # ۾ ּ
+ $atc['date'] = time(); # 현재 시각
+ $atc['host'] = get_hostname(0); # 글쓴이 주소
- # Injection html Ѵ.
- # phpbb bb tag ó
+ # Injection 등의 위험 요소 때문에 html 쓰기 지원을 포기한다.
+ # phpbb 의 bb tag 처럼 대안을 제시
$atc['html'] = 2;
- # ȣȯ ÿ html header tag ϴ Ѵ.
+ # 글 등록 호환 모드시에 html header tag를 사용하는 것을 방지한다.
delete_tag($atc);
- # ۿ : и Ѵ.
+ # 댓글에서 : 때문에 글이 밀리는 것을 복구한다.
$atc['text'] = preg_replace("/(^[:]+ [^\r\n]+)\r?\n([^:\r\n]+\r?\n)/mi","\\1 \\2",$atc['text']);
- $atc = article_check($table, $atc);
- if(preg_match("/^(0|4)$/",$board['mode']) || !session_is_registered($jsboard)) $atc['passwd'] = crypt($atc['passwd']);
+ $atc = article_check($c, $table, $atc);
+ if(preg_match("/^(0|4)$/",$board['mode']) || !isset($_SESSION[$jsboard])) $atc['passwd'] = crypt($atc['passwd']);
- # 亯 file upload κ, ü ڰ ÿ
+ # 답변시 file upload 설정 부분, 전체 관리자가 허락시에만 가능
if ($upload['yesno'] && $cupload['yesno'] && !$agent['tx']) {
$bfilename = date("YmdHis",$atc['date']);
$upfile = file_upload("userfile",$bfilename);
if(!trim($upfile['name'])) {
$bfilename = "";
$upfile['size'] = 0;
- $upfile['name'] = "";
+ $upfile['name'] = '';
}
} else {
- # winchild 99/11/26 fileupload = "no" 쿡 ʱȭ ־ Ѵ.
+ # winchild 99/11/26 fileupload = "no" 일 경우에는 초기화를 시켜주어야 한다.
$bfilename = "";
$upfile['size'] = 0;
- $upfile['name'] = "";
+ $upfile['name'] = '';
}
- # referer ȣ θ ȣ ٸ ó
+ # referer 의 글 번호와 부모글의 번호가 다를 경우 스팸 처리
if ( $atc['reno'] != $referer['no'] )
- print_error($_('act_s'),250,150,1);
+ print_error($langs['act_s'],250,150,1);
- # ۿ
- table_lock ($c, $table, 1);
- $reply = get_article($table, $atc['reno']);
- $atc['rede'] = $reply['rede'] + 1; #
- $atc['idx'] = $reply['idx']; # θ ε ȣ
+ sql_escape($table, $c);
+ sql_escape($atc, $c);
- if($reply['reto']) $atc['reto'] = $reply['reto']; # ֻ θ ȣ
- else $atc['reto'] = $reply['no']; # θ ȣ
+ # 답장글에 대한 정보를 가져옴
+ sql_query("LOCK TABLES $table WRITE",$c);
+ $reply = get_article($table, $atc['reno']);
+ $atc['rede'] = $reply['rede'] + 1; # 답장글의 깊이
+ $atc['idx'] = $reply['idx']; # 부모글의 인덱스 번호 상속
- sql_escape ($c, $table);
- sql_escape ($c, $atc);
+ if($reply['reto']) $atc['reto'] = $reply['reto']; # 최상위 부모글 번호
+ else $atc['reto'] = $reply['no']; # 부모글 번호
- # θ ̻ ε ȣ ۵ ε 1
+ # 부모글 이상의 인덱스 번호를 가진 글들의 인덱스를 1씩 더함
sql_query("UPDATE $table SET idx = idx + 1 WHERE (idx + 0) >= '{$atc['idx']}'", $c);
- sql_query("UPDATE $table SET reyn = 1 WHERE no = '{$atc['reno']}'", $c, $db['name']);
- sql_query("INSERT INTO $table (num,idx,date,host,name,rname,passwd,email,url,
- title,text,refer,reyn,reno,rede,reto,html,comm,bofile,
- bcfile,bfsize)
- VALUES (0,'{$atc['idx']}','{$atc['date']}','{$atc['host']}','{$atc['name']}','{$atc['rname']}',
- '{$atc['passwd']}','{$atc['email']}','{$atc['url']}','{$atc['title']}','{$atc['text']}',
- 0,0,'{$atc['reno']}','{$atc['rede']}','{$atc['reto']}','{$atc['html']}',0,'{$upfile['name']}',
- '{$bfilename}','{$upfile['size']}')", $c);
- table_lock ($c, $table, 0);
-
- # mail κ
+ sql_query("UPDATE $table SET reyn = 1 WHERE no = '{$atc['reno']}'", $c);
+ sql_query("INSERT INTO $table (no,num,idx,date,host,name,rname,passwd,email,url,
+ title,text,refer,reyn,reno,rede,reto,html,comm,bofile,
+ bcfile,bfsize)
+ VALUES ('',0,'{$atc['idx']}','{$atc['date']}','{$atc['host']}','{$atc['name']}','{$atc['rname']}',
+ '{$atc['passwd']}','{$atc['email']}','{$atc['url']}','{$atc['title']}','{$atc['text']}',
+ 0,0,'{$atc['reno']}','{$atc['rede']}','{$atc['reto']}','{$atc['html']}',0,'{$upfile['name']}',
+ '{$bfilename}','{$upfile['size']}')", $c);
+ sql_query('UNLOCK TABLES', $c);
+
+ # mail 보내는 부분
if ($rmail['uses']) {
if ($rmail['admin'] || $rmail['user']) {
$result = sql_query("SELECT MAX(no) AS no FROM $table", $c);
- $rmail['no'] = sql_result($result, 0, "no"); # ְ ȣ
+ $rmail['no'] = sql_result($result, 0, 'no', $c); # 최고 번호
$rmail['name'] = $atc['rtname'];
$rmail['text'] = $atc['text'];
$rmail['title'] = $atc['rtitle'];
@@ -225,34 +223,35 @@ function article_reply($table, $atc) {
return $gopage;
}
- # Խù Լ
- function article_edit($table, $atc, $passwd) {
- global $max_file_size, $jsboard, $board, $_, $agent, $rmail;
- global $upload, $cupload, $c, $db;
+ # 게시물 수정 함수
+ function article_edit(&$c, $table, $atc, $passwd) {
+ global $max_file_size, $jsboard, $board, $langs, $agent, $rmail;
+ global $upload, $cupload;
- # 尡 ƴ н
+ # 어드민 모드가 아닐 경우 패스워드 인증
if($board['super'] != 1 && !$board['adm']) {
- if(!check_passwd($table,$atc['no'],trim($passwd))) print_error($_('act_pw'), 250, 150, 1);
+ if(!check_passwd($table,$atc['no'],trim($passwd))) print_error($langs['act_pw'],250,150,1);
}
- $atc['date'] = time(); # ð
- $atc['host'] = get_hostname(0); # ۾ ּ
- $atc = article_check($table, $atc);
+ $atc['date'] = time(); # 현재 시각
+ $atc['host'] = get_hostname(0); # 글쓴이 주소
+ if(eregi($rmail['chars'],$atc['email'])) $atc['email'] = str_replace($rmail['chars'],"@",$atc['email']);
+ $atc = article_check($c, $table, $atc);
- # ȣȯ ÿ html header tag ϴ Ѵ.
+ # 글 등록 호환 모드시에 html header tag를 사용하는 것을 방지한다.
delete_tag($atc);
- # ۿ : и Ѵ.
+ # 댓글에서 : 때문에 글이 밀리는 것을 복구한다.
$atc['text'] = preg_replace("/(^[:]+ [^\r\n]+)\r?\n([^:\r\n]+\r?\n)/mi","\\1 \\2",$atc['text']);
- sql_escape ($c, $table);
- sql_escape ($c, $atc);
+ sql_escape($table, $c);
+ sql_escape($atc, $c);
- # file ƾ
+ # file 삭제 루틴
if($atc['fdel']) {
$fdelqy = sql_query("SELECT bcfile, bofile FROM {$table} WHERE no = '{$atc['no']}'", $c);
- $fdelinfo = sql_fetch_array($fdelqy);
- sql_free_result($fdelqy);
+ $fdelinfo = sql_fetch_array($fdelqy, $c);
+ sql_free_result($fdelqy, $c);
sql_query("UPDATE $table SET bcfile='', bofile='', bfsize='' WHERE no = '{$atc['no']}'", $c);
if(file_exists("data/$table/files/{$fdelinfo['bcfile']}/{$fdelinfo['bofile']}")) {
@@ -261,16 +260,16 @@ function article_edit($table, $atc, $passwd) {
}
}
- # file ƾ
+ # file 수정 루틴
if($upload['yesno'] && $cupload['yesno'] && !$agent['tx']) {
- # file ƾ
+ # file 수정 루틴
$bfilename = date("YmdHis",$atc['date']);
$upfile = file_upload("userfile",$bfilename);
if (trim($upfile['name'])) {
$fdelqy = sql_query("SELECT bcfile, bofile FROM {$table} WHERE no = '{$atc['no']}'", $c);
- $fdelinfo = sql_fetch_array($fdelqy);
- sql_free_result($fdelqy);
+ $fdelinfo = sql_fetch_array($fdelqy, $c);
+ sql_free_result($fdelqy, $c);
if(file_exists("data/$table/files/{$fdelinfo['bcfile']}/{$fdelinfo['bofile']}") && trim($fdelinfo['bofile'])) {
unlink("data/$table/files/{$fdelinfo['bcfile']}/{$fdelinfo['bofile']}");
rmdir("data/$table/files/{$fdelinfo['bcfile']}");
@@ -291,53 +290,53 @@ function article_edit($table, $atc, $passwd) {
return $atc['no'];
}
- # Խù Լ
- function article_delete($table, $no, $passwd) {
- global $jsboard, $o, $_, $board, $page, $c, $db;
+ # 게시물 삭제 함수
+ function article_delete(&$c, $table, $no, $passwd) {
+ global $jsboard, $o, $langs, $board, $page;
global $delete_filename, $delete_dir, $upload, $agent;
$atc = get_article($table, $no);
- # 尡 ƴ н
+ # 어드민 모드가 아닐 경우 패스워드 인증
if($board['super'] != 1 && !$board['adm']) {
$admchk = check_passwd($table,$atc['no'],trim($passwd));
- if(!$admchk) print_error($_('act_pwm'),250,150,1);
+ if(!$admchk) print_error($langs['act_pwm'],250,150,1);
}
- # 尡 ƴ ϸ
+ # 관리자 모드가 아닐 경우 댓글이 존재하면 에러메세지
if($atc['reyn'] && ($board['super'] != 1 && !$board['adm'] && $admchk != 2))
- print_error($_('act_c'),250,150,1);
+ print_error($langs['act_c'],250,150,1);
- sql_escape ($c, $table);
- sql_escape ($c, $atc);
+ sql_escape($table,$c);
+ sql_escape($atc,$c);
- # θ ڽ ۿ θ reyn ʱȭ ( )
+ # 부모글의 답장글이 자신 밖에 없을 때 부모글의 reyn을 초기화 (답장글 여부)
if($atc['reno']) {
- $result = sql_query("SELECT COUNT(*) AS cnt FROM $table WHERE reno = '{$atc['reno']}'", $c);
- if( sql_result ($result, 0, 'cnt') == 1 )
- sql_query("UPDATE $table SET reyn = 0 WHERE no = '{$atc['reno']}'", $c);
- sql_free_result($result);
+ $result = sql_query("SELECT COUNT(*) FROM $table WHERE reno = '{$atc['reno']}'",$c);
+ if(sql_result($result, 0, "COUNT(*)",$c) == 1)
+ sql_query("UPDATE $table SET reyn = 0 WHERE no = '{$atc['reno']}'",$c);
+ sql_free_result($result,$c);
}
- sql_query("DELETE FROM {$table}_comm WHERE reno = '{$atc['no']}'", $c, 1);
- table_lock ($c, $table, 1);
- sql_query("DELETE FROM $table WHERE no = '{$atc['no']}'", $c);
- sql_query("UPDATE $table SET idx = idx - 1 WHERE (idx + 0) > '{$atc['idx']}'", $c);
+ sql_query("DELETE FROM {$table}_comm WHERE reno = '{$atc['no']}'",$c,true);
+ sql_query("LOCK TABLES $table WRITE",$c);
+ sql_query("DELETE FROM $table WHERE no = '{$atc['no']}'",$c);
+ sql_query("UPDATE $table SET idx = idx - 1 WHERE (idx + 0) > '{$atc['idx']}'",$c);
if(!$atc['reyn']) {
- # upload file
+ # upload file이 존재할 경우 삭제
if ($delete_filename && file_exists("$delete_filename")) {
unlink("$delete_filename");
rmdir("$delete_dir");
}
}
- # ñ ñ ( )
+ # 관련글이 있을 경우 관련글을 모두 삭제함 (관리자 모드)
if($atc['reyn'] && ($board['super'] == 1 || $board['adm'] || $admchk == 2)) {
- $result = sql_query("SELECT no,bofile,bcfile FROM $table WHERE reno = '{$atc['no']}'", $c);
- while($list = sql_fetch_array($result)) {
- table_lock ($c, $table, 0);
+ $result = sql_query("SELECT no,bofile,bcfile FROM $table WHERE reno = '{$atc['no']}'",$c);
+ while($list = sql_fetch_array($result,$c)) {
+ sql_query("UNLOCK TABLES",$c);
article_delete($table, $list['no'], $passwd);
- # upload file
+ # upload file이 존재할 경우 삭제
if ($list['bofile'] && file_exists("./data/$table/{$upload['dir']}/{$list['bcfile']}/{$list['bofile']}")) {
unlink("./data/$table/{$upload['dir']}/{$list['bcfile']}/{$list['bofile']}");
rmdir("./data/$table/{$upload['dir']}/{$list['bcfile']}");
@@ -346,14 +345,13 @@ function article_delete($table, $no, $passwd) {
}
$page = !$page ? get_current_page($table, $atc['idx']) : $page;
- table_lock ($c, $table, 0);
+ sql_query("UNLOCK TABLES",$c);
return $page;
}
- function comment_post($table,$atc) {
- global $jsboard, $board, $_, $ccompare, $compare;
- global $c, $db;
+ function comment_post(&$c,$table,$atc) {
+ global $jsboard, $board, $langs, $ccompare, $compare;
$host = get_hostname(0);
$dates = time();
@@ -363,124 +361,118 @@ function comment_post($table,$atc) {
$nameChk = array("name","text");
for($bc=0;$bc<2;$bc++) {
if(!$atc[$nameChk[$bc]] || preg_match("/^$blankChk$/i",trim($atc[$nameChk[$bc]]))) {
- $_lang['act_in'] = preg_replace("/,/i","",$_('act_in'));
- print_error($_lang['act_in'],250,150,1);
+ $langs['act_in'] = preg_replace("/제목,/i","",$langs['act_in']);
+ print_error($langs['act_in'],250,150,1);
}
}
if (!empty($compare['name']) && eregi($compare['name'],$atc['name'])) $cmp['name'] = 1;
if (!empty($ccompare['name']) && eregi($ccompare['name'],$atc['name'])) $ccmp['name'] = 1;
- # Ī üũ
+ # 관리자 사칭 체크
if((!$board['mode'] || $board['mode'] == 4) && $board['super'] != 1 && !$board['adm']) {
- # ü н
- $result = sql_query("SELECT passwd FROM userdb WHERE position = 1", $c);
- $r['su'] = sql_result($result,0,"passwd");
- sql_free_result($result);
+ # 전체 관리자 패스워드
+ $result = sql_query('SELECT passwd FROM userdb WHERE position = 1', $c);
+ $r['su'] = sql_result($result,0,'passwd',$c);
+ sql_free_result($result,$c);
if($r['su'] != crypt($atc['passwd'],$r['su'])) $notsuper = 1;
if ($cmp['name']) {
- if($notsuper) print_error($_('act_ad'),250,150,1);
+ if($notsuper) print_error($langs['act_ad'],250,150,1);
}
if($ccmp['name'] && $notsuper) {
$arrayadm = explode(";",$board['ad']);
for($k=0;$k
IE ÿ ѱ
+ # 이름, 제목의 HTML 코드 문자를 치환함
+ # ugly_han() -> IE 사용시에 한글 깨지는 것을 복원함
$atc['name'] = ugly_han(htmlspecialchars($atc['name']));
$atc['title'] = ugly_han(htmlspecialchars($atc['title']));
- # ö (ߺ ˻)
- $_limit = compatible_limit (0, 1);
- $result = sql_query("SELECT * FROM $table ORDER BY no DESC {$_limit}", $c);
- $list = sql_fetch_array($result);
- sql_free_result($result);
+ # 마지막으로 올라온 글의 정보를 가져옴 (중복 투고 검사용)
+ $result = sql_query("SELECT * FROM $table ORDER BY no DESC LIMIT 0, 1",$c);
+ $list = sql_fetch_array($result,$c);
+ sql_free_result($result,$c);
if ($list && $atc['name'] == $list['name'] &&
$atc['text'] == $list['text'] &&
@@ -558,7 +549,7 @@ function article_check($table, $atc) {
$atc['url'] == $list['url'] &&
$atc['html'] == $list['html']) {
- # , , ÷ ȭ .
+ # 수정 모드시, 수정된 사항은 없으나, 첨부파일의 변화가 있을 경우 수정 가능함.
if ($o['at'] == 'edit') {
if ($atc['fdel']) {
$chkpass = 1;
@@ -570,10 +561,10 @@ function article_check($table, $atc) {
if (!$chkpass) {
switch ($o['at']) {
case 'write':
- print_error($_('act_same'),250,150,1);
+ print_error($langs['act_same'],250,150,1);
break;
case 'edit':
- print_error($_('act_dc'),250,150,1);
+ print_error($langs['act_dc'],250,150,1);
break;
}
}
@@ -582,7 +573,7 @@ function article_check($table, $atc) {
return $atc;
}
- # Ű Լ
+ # 쿠키 설정 함수
function set_cookie($atc,$comment=0) {
global $board,$agent;
$month = 60 * 60 * 24 * $board['cookie'];
@@ -597,35 +588,38 @@ function set_cookie($atc,$comment=0) {
switch($o['at']) {
case 'write':
- $page = article_post($table, $atc);
+ $atc['text'] = $wpost;
+ $page = article_post($c, $table, $atc);
if(!$page['m_err']) Header("Location: list.php?table=$table");
else move_page("list.php?table=$table");
break;
case 'reply':
- $gopage = article_reply($table, $atc);
+ $atc['text'] = $rpost;
+ $gopage = article_reply($c, $table, $atc);
if(!$gopage['m_err']) Header("Location: list.php?table=$table&page={$gopage['no']}");
else move_page("list.php?table=$table&page={$gopage['no']}");
break;
case 'edit':
- $no = article_edit($table, $atc, $passwd);
+ $atc['text'] = $epost;
+ $no = article_edit($c, $table, $atc, $passwd);
Header("Location: read.php?table=$table&no=$no");
break;
case 'del':
- $gopage = article_delete($table, $no, $passwd, $o['am']);
+ $gopage = article_delete($c, $table, $no, $passwd);
Header("Location: list.php?table=$table&page=$gopage");
break;
case 'c_write':
- comment_post($table,$atc);
+ comment_post($c,$table,$atc);
Header("Location: read.php?table=$table&no={$atc['no']}&page=$page");
break;
case 'c_del':
- comment_del($table,$atc['no'],$atc['cid'],$lp);
+ comment_del($c,$table,$atc['no'],$atc['cid'],$lp);
Header("Location: read.php?table=$table&no={$atc['no']}&page=$page");
}
} elseif ($o['at'] == "dn") {
include "include/header.php";
- # ش meta character ϴ üũ
+ # 해당 변수에 meta character 가 존재하는지 체크
meta_char_check($dn['tb'],0,1);
meta_char_check($dn['cd']);
meta_char_check($upload['dir']);
@@ -633,7 +627,7 @@ function set_cookie($atc,$comment=0) {
$dn['path'] = "data/{$dn['tb']}/{$upload['dir']}/{$dn['cd']}/{$dn['name']}";
- if($dn['dl'] = readfile_r ($dn['path'])) {
+ if($dn['dl'] = file_operate($dn['path'],"r","Don't open {$dn['name']}")) {
if(extension_loaded('fileinfo')) {
$finfo = finfo_open(FILEINFO_MIME);
if(is_resource($finfo)) {
@@ -652,7 +646,7 @@ function set_cookie($atc,$comment=0) {
$mimes = $mimes ? $mimes : 'file/unknown';
Header('Content-Description: PHP Generated Data');
}
- Header('Content-type: '.$mimes);
+ header('Content-Type: '.$mimes);
header('Content-Length: '.filesize("{$dn['path']}"));
Header('Content-Disposition: attachment; '.$dn['encode']);
Header('Pragma: no-cache');
@@ -660,8 +654,20 @@ function set_cookie($atc,$comment=0) {
echo $dn['dl'];
}
+} elseif($o['at'] == "ma") {
+ if ( ! @file_exists("config/global.php") ) {
+ echo "\n";
+ } else { include_once "config/global.php"; }
+
+ if(preg_match("/{$rmail['chars']}/",$target)) {
+ $target = str_replace($rmail['chars'],"@",$target);
+ Header("Location: mailto:$target");
+ }
+ echo "";
+ exit;
} else {
- echo "";
+ echo "";
exit;
}
?>
diff --git a/admin/act.php b/admin/act.php
index f6ccc7d4..65b57cf6 100644
--- a/admin/act.php
+++ b/admin/act.php
@@ -1,165 +1,189 @@
A-Za-z0-9_
- if ( preg_match ('/[^a-z0-9_]/i', $new_table) )
- print_error ($_('tb_rule'), 250, 150, 1);
+else if($mode == 'db_create') {
+ # 게시판 이름 규칙 -> A-Za-z0-9_-
+ if ( preg_match ('/[^a-z0-9_-]/i', $new_table) )
+ print_error ($langs['tb_rule'], 250, 150, 1);
- # θ ̸ üũ
- table_name_check ($new_table);
+ # 새로만들 계정이름의 존재유무 체크
+ table_name_check($new_table);
- # ̸ Խ ִ Ȯ
+ # 동일한 이름의 게시판이 있는지 확인
if ( $new_table == 'userdb' || db_table_list ($c, $db['name'], '', $new_table) )
print_error ($_('a_acc'), 250, 150, 1);
- $_sql['r'] = array ('b', 'c');
- $_sql['b'] = sql_parser ($db['type'], 'board', $new_table, 1);
- $_sql['c'] = sql_parser ($db['type'], 'comment', $new_table, 1);
-
- # create table
- foreach ( $_sql['r'] as $_o ) {
- if ( is_array ($_sql[$_o]) ) {
- foreach ( $_sql[$_o] as $_s ) {
- sql_query ($_s, $c);
- }
- }
- }
-
- /*
- require_once "include/first_reg.php";
- $_dr['p'] = crypt($passwd_ext);
- $_cr['b'] = "INSERT INTO test (num, idx, date, host, name, passwd, email, url, title," .
- " text, refer, reyn, reno, rede, reto, html, comm, bofile," .
- " bcfile, bfsize)" .
- "VALUES (1, 1, '{$_dr['d']}', '127.0.0.1', '{$_dr['n']}', '{$_dr['p']}'," .
- " '{$_dr['e']}', '{$_dr['u']}', '{$_dr['s']}', '{$_dr['b']}', 0, 0," .
- " 0, 0, 0, 0, 0, '', '', '')";
-
- sql_query ($_cr['b'], $c);
- */
- sql_close ($c);
-
- # ο Խǿ ʿ Ϲ 丮
- mkdir("../data/{$new_table}",0770);
- mkdir("../data/{$new_table}/{$upload['dir']}",0770);
- chmod("../data/{$new_table}",0775);
- chmod("../data/{$new_table}/{$upload['dir']}",0775);
-
- $_co = readfile_r ("../utils/sample/data/config.php");
- $_sr = array ('/@theme@/', '/@table@/', '/@wpath@/');
- $_dr = array ($print['theme'], $new_table, $board['path']);
- $_co = preg_replace ($_sr, $_dr, $_co);
-
- writefile_r ("../data/{$new_table}/config.php", $_co);
- chmod("../data/{$new_table}/config.php",0644);
-
- copy("../utils/sample/data/html_head.php","../data/$new_table/html_head.php");
- chmod("../data/{$new_table}/html_head.php",0644);
- copy("../utils/sample/data/html_tail.php","../data/$new_table/html_tail.php");
- chmod("../data/{$new_table}/html_tail.php",0644);
- copy("../utils/sample/data/stylesheet.php","../data/$new_table/stylesheet.php");
- chmod("../data/{$new_table}/stylesheet.php",0644);
+ #include "include/first_reg.php";
+ $create_table = "CREATE TABLE $new_table (
+ no int(6) NOT NULL auto_increment,
+ num int(6) DEFAULT '0' NOT NULL,
+ idx int(6) DEFAULT '0' NOT NULL,
+ date int(11) DEFAULT '0' NOT NULL,
+ host tinytext,
+ name tinytext,
+ rname tinytext,
+ passwd varchar(56),
+ email tinytext,
+ url tinytext,
+ title tinytext,
+ text mediumtext,
+ refer int(6) DEFAULT '0' NOT NULL,
+ reyn int(1) DEFAULT '0' NOT NULL,
+ reno int(6) DEFAULT '0' NOT NULL,
+ rede int(6) DEFAULT '0' NOT NULL,
+ reto int(6) DEFAULT '0' NOT NULL,
+ html int(1) DEFAULT '1' NOT NULL,
+ comm int(6) DEFAULT '0' NOT NULL,
+ bofile varchar(100),
+ bcfile varchar(100),
+ bfsize int(4),
+ KEY no (no),
+ KEY num (num),
+ KEY idx (idx),
+ KEY reno (reno),
+ KEY date (date),
+ KEY reto (reto),
+ KEY comm (comm),
+ PRIMARY KEY (no))";
+
+ $create_comm = "CREATE TABLE {$new_table}_comm (
+ no int(6) NOT NULL auto_increment,
+ reno int(20) NOT NULL default '0',
+ rname tinytext,
+ name tinytext,
+ passwd varchar(56) default NULL,
+ text mediumtext,
+ host tinytext,
+ date int(11) NOT NULL default '0',
+ PRIMARY KEY (no),
+ KEY parent (reno))";
+
+ $passwd_ext = crypt($passwd_ext);
+
+ $insert_data = "INSERT INTO $new_table (no,num,idx,date,host,name,passwd,email,url,title,
+ text,refer,reyn,reno,rede,reto,html,comm,bofile,bcfile,bfsize)
+ VALUES ('',1,1,$date,'$host_ext','$name_ext','$passwd_ext','$email_ext',
+ '$url_ext','$subj_msg','$text_msg',0,0,0,0,0,0,0,'','','')";
+
+ sql_query($create_table, $c);
+ #$result_insert = sql_query($insert_data, $c);
+
+ sql_query($create_comm, $c);
+
+ # 새로운 게시판에 필요한 파일및 디렉토리 생성
+ mkdir("../data/$new_table",0700);
+ mkdir("../data/$new_table/{$upload['dir']}",0700);
+ chmod("../data/$new_table",0755);
+ chmod("../data/$new_table/{$upload['dir']}",0755);
+ copy("../INSTALLER/sample/data/config.php","../data/$new_table/config.php");
+ chmod("../data/$new_table/config.php",0644);
+ copy("../INSTALLER/sample/data/html_head.php","../data/$new_table/html_head.php");
+ chmod("../data/$new_table/html_head.php",0644);
+ copy("../INSTALLER/sample/data/html_tail.php","../data/$new_table/html_tail.php");
+ chmod("../data/$new_table/html_tail.php",0644);
+ copy("../INSTALLER/sample/data/stylesheet.php","../data/$new_table/stylesheet.php");
+ chmod("../data/$new_table/stylesheet.php",0644);
+
+ sql_close($c);
}
-else if( $mode == 'global_chg' ) {
- sql_close ($c);
- # quot ȯ ڸ un quot Ѵ
-
- $vars = "\n" . stripslashes ($glob['vars']) . "\n?>";
- $spam = stripslashes ($glob['spam']);
+else if($mode == "global_chg") {
+ sql_close($c);
+ # quot 변환된 문자를 un quot 한다
- writefile_r ('../config/global.php', $vars);
- writefile_r ('../config/spam_list.txt', $spam);
+ $vars = "";
+ $spam = stripslashes($glob['spam']);
- $_lang['act_complete'] = str_replace ("\n", "\\n", $_('act_complete'));
- $_lang['act_complete'] = str_replace ("'", "\'", $_lang['act_complete']);
+ file_operate("../config/global.php","w",0,$vars);
+ file_operate("../config/spam_list.txt","w",0,$spam);
- echo "\n".
"Complete this Job. Click here go to admin page! ";
exit;
@@ -168,4 +192,14 @@
Header("Location:admin.php$tslink");
+
+/*
+ * Local variables:
+ * tab-width: 2
+ * indent-tabs-mode: nil
+ * c-basic-offset: 2
+ * show-paren-mode: t
+ * End:
+ * vim: filetype=php et ts=2 sw=2
+ */
?>
diff --git a/admin/admin.php b/admin/admin.php
index 1e11316c..2e7ab02a 100644
--- a/admin/admin.php
+++ b/admin/admin.php
@@ -1,257 +1,255 @@
\n".
"Administration Center\n";
} else {
- echo "\n".
- "\n\n".
- "\n\n".
+ echo "\n".
+ "\n\n".
+ "\n\n".
"\n\n".
- "\n".
- "J \n".
- " SBoard \n".
+ "\n".
+ "J \n".
+ " SBoard \n".
" \n\n\n".
- "Administration Center \n".
+ "Administration Center \n".
" \n
\n".
" \n
\n\n";
}
-# db_name Ʒ մϴ.
-exsit_dbname_check ($db['name']);
+# db_name이 존재하지 않으면 아래를 출력합니다.
+exsit_dbname_check($db['name']);
-if( $db['name'] && ! $table ) {
- echo "\n".
- "\n";
+if($db['name'] && !$table) {
+ echo "\n".
+ "\n";
- if ( $agent['tx'] ) {
- echo '' . $_('a_t1') . " \n".
- '' . $_('a_t3') . " \n".
- '' . $_('a_t4') . " \n".
- '' . $_('a_t5') . " \n";
+ if($agent['tx']) {
+ echo "{$langs['a_t1']} \n".
+ "{$langs['a_t3']} \n".
+ "{$langs['a_t4']} \n".
+ "{$langs['a_t5']} \n";
} else {
- echo "" . $_('a_t1') . " \n".
- "" . $_('a_t2') . " \n".
- "" . $_('a_t5') . " \n".
+ echo "{$langs['a_t1']} \n".
+ "{$langs['a_t2']} \n".
+ "{$langs['a_t5']} \n".
" \n\n".
- "\n".
- "" . $_('a_t3') . " \n".
- "" . $_('a_t4') . " \n";
+ " \n".
+ "{$langs['a_t3']} \n".
+ "{$langs['a_t4']} \n";
}
echo " ";
$table_name = db_table_list ($c, $db['name'], $ts);
- $tbl_num = sizeof ($table_name);
+ $tbl_num = sizeof($table_name);
- if ( ! $start && ! $page ) { $start = 0; $page = 1; }
- else if ( $page == 1 ) $start = 0;
- else if ( $page > 1 ) $start = $page * $sadmin['pern'] - $sadmin['pern'];
+ if(!$start && !$page) { $start = 0; $page = 1; }
+ else if($page == 1) $start = 0;
+ else if($page > 1) $start = $page*$sadmin['pern']-$sadmin['pern'];
$nowpage = $page;
- $until = $start + $sadmin['pern'];
- $priv = $page - 1;
- $next = $page + 1;
+ $until = $start+$sadmin['pern'];
+ $priv = $page-1;
+ $next = $page+1;
- # ¥ data ¥ ϵ մϴ.
- $current_time = curdate ();
+ # 오늘 날짜에 대한 data 값을 구해 오늘 날짜에 등록된 값을 구합니다.
+ $current_time = mktime (0, 0, 0, date('m, d, Y'));
- # scale
- if ( $tbl_num > 1 ) {
- for ( $i=$start; $i<$until; $i++ ) {
- if ( $i < $tbl_num && $table_name[$i] != "userdb" ) {
- # jsboard ϴ Խ Ǵ
- $chk = "SELECT idx FROM {$table_name[$i]} WHERE idx = 1;";
- $chk_result = sql_query ($chk, $c, 1);
+ # scale 별로 출력
+ if($tbl_num > 0) {
+ for($i=$start; $i<$until; $i++) {
+ if($i < $tbl_num && $table_name[$i] != "userdb") {
+ # jsboard에서 사용하는 게시판인지를 판단
+ $chk = "select idx from $table_name[$i] where idx = 1;";
+ $chk_result = sql_query($chk,$c,true);
- # table ϵ check մϴ.
- $total = "SELECT COUNT(*) AS cnt FROM {$table_name[$i]}";
- $result = sql_query ($total, $c);
+ # 각 table에 등록된 글 수를 check 합니다.
+ $total = "select count(*) as cnt from $table_name[$i]";
+ $result = sql_query($total,$c,true);
- $total_count = sql_result ($result, 0, 'cnt');
+ $total_count = sql_result($result,0,'cnt',$c);
- # table ϵ ۵ մϴ.
+ # 각 table에 등록된 글들의 합을 구합니다.
if ($chk_result)
- $to = $to + $total_count;
- $total = "SELECT COUNT(*) AS cnt FROM {$table_name[$i]} WHERE date > '$current_time'";
+ $to += $total_count;
+ $total = "select count(*) as cnt from $table_name[$i] where date > '$current_time'";
- $result = sql_query ($total, $c, 1);
- $total_today = sql_result ($result, 0, 'cnt');
- $total_today = ! $total_today ? 0 : $total_today;
+ if (($result = sql_query($total,$c,true)) !== false)
+ $total_today = @sql_result($result,0,'cnt',$c);
+ $total_today = !$total_today ? 0 : $total_today;
- # ϵ ۵ մϴ.
+ # 오늘 등록된 글들의 합을 구합니다.
if ($chk_result)
$to_today = $to_today + $total_today;
- echo "\n".
- " {$table_name[$i]} \n".
- "{$total_today} \n".
- "{$total_count} \n";
-
- if ( $chk_result && $table_name[$i] != "userdb" ) {
- if ( $agent['tx'] ) {
- echo "\n".
- "" . $_('a_t7') . " \n".
- "" . $_('a_t8') . " \n".
- "" . $_('a_t17') . " \n".
- "" . $_('a_t9') . " \n".
+ echo " \n".
+ " {$table_name[$i]} \n".
+ "$total_today \n".
+ "$total_count \n";
+
+ if($chk_result && $table_name[$i] != "userdb") {
+ if($agent['tx']) {
+ echo "\n".
+ "{$langs['a_t7']} \n".
+ "{$langs['a_t8']} \n".
+ "{$langs['a_t17']} \n".
+ "{$langs['a_t9']} \n".
" \n ";
} else {
- echo " \n";
+ echo "\n";
}
} else {
- if( preg_match ('/_comm/', $table_name[$i]) ) {
- $table_explain = str_replace ('_comm', '', $table_name[$i]);
- $table_explain = "{$table_explain} Comment";
- } else
- $table_explain = 'Not JSBoard table';
-
- echo " \n";
+ if(preg_match("/_comm/",$table_name[$i])) {
+ $table_explain = preg_replace("/_comm/","",$table_name[$i]);
+ $table_explain = "$table_explain Comment";
+ } else $table_explain = "Not JSBoard table";
+
+ echo "\n";
}
}
}
} else {
- echo "\n".
- " " .
- $_('n_acc') . " \n".
+ echo " \n".
+ " {$langs['n_acc']} \n".
" ";
}
- # ü ϵ Ȯ
- for ( $t = 0; $t < $tbl_num; $t++ ) {
- # jsboard ϴ Խ Ǵ
+ # 전체 등록된 글 수를 확인
+ for($t = 0; $t < $tbl_num; $t++) {
+ # jsboard에서 사용하는 게시판인지를 판단
$chk = "select idx from $table_name[$t] where idx = 1;";
if (($chk_result = sql_query($chk,$c,true)) === false) {
if (!preg_match('/_comm/', $table_name[$t]))
continue;
}
- # table ϵ check մϴ.
- $total_t = "SELECT COUNT(*) AS cnt FROM {$table_name[$t]}";
- $result_t = sql_query ($total_t, $c);
- $total_count_t = sql_result ($result_t, 0, 'cnt');
+ # 각 table에 등록된 글 수를 check 합니다.
+ $sql = "select count(*) as cnt from $table_name[$t]";
+ $result = sql_query($sql,$c);
+ $sum = sql_result($result, 0, 'cnt',$c);
- # table ϵ ۵ մϴ.
- $to_t = $to_t + $total_count_t;
+ # 각 table에 등록된 글들의 합을 구합니다.
+ $to_t += $sum;
- $total_t = "SELECT COUNT(*) AS cnt FROM {$table_name[$t]} WHERE date > '$current_time'";
- $result_t = sql_query ($total_t, $c, 1);
- $total_today_t = sql_result ($result_t, 0, 'cnt');
+ unset ($sum);
+ $sql = "select count(*) as cnt from $table_name[$t] where date > '$current_time'";
+ if (($result = sql_query($sql,$c,true)) !== false)
+ $sum = sql_result($result, 0, 'cnt',$c);
+ $sum = isset($sum) ? $sum : 0;
- # ϵ ۵ մϴ.
- $to_today_t = $to_today_t + $total_today_t;
+ # 오늘 등록된 글들의 합을 구합니다.
+ $to_today_t += $sum;
}
-
- sql_close ($c);
-
$to = !$to ? "0" : $to;
$to_t = !$to_t ? "0" : $to_t;
$to_today = !$to_today ? "0" : $to_today;
$to_today_t = !$to_today_t ? "0" : $to_today_t;
- # ܺ DB JSBoard ڿ user
+ # 외부 DB 를 사용할 경우 JSBoard 관리자에서 user 관리를 하지 않음
$userclick = $_SESSION[$jsboard]['external'] ? "window.alert('External user table Can\'t be Use')" :
"document.location='./userlist.php?t=a'";
- echo "\n\n".
- "{$_lang['a_t41']} [ " . $_('a_t16') . " ] \n".
- "{$to_today} [{$to_today_t}] \n".
- "{$to} [{$to_t}] \n".
- "\n";
+ echo "\n \n".
+ "{$langs['a_t41']} [ {$langs['a_t16']} ] \n".
+ "$to_today [$to_today_t] \n".
+ "$to [$to_t] \n".
+ "\n";
if($agent['tx']) {
- $userclick = $_SESSION[$jsboard]['external'] ? "[ " . $_('a_t20') . " ]" : "[ " . $_('a_t20') . " ] ";
+ $userclick = $_SESSION[$jsboard]['external'] ? "[ {$langs['a_t20']} ]" : "[ {$langs['a_t20']} ] ";
echo "$userclick\n".
- "[ " . $_('a_t11') . " ] \n";
+ "[ {$langs['a_t11']} ] \n";
} else {
- echo " \n".
- " \n";
+ echo " \n".
+ " \n";
}
- echo " \n \n\n";
-
- if ( $agent['tx'] ) {
- echo "\n" .
- " \n \n\n".
+ "\n".
" \n\n".
- "\n" .
- "
\n\n";
+ "{$langs['ts']} \n" .
+ "\n" .
+ "A \n" .
+ "B \n" .
+ "C \n" .
+ "D \n" .
+ "E \n" .
+ "F \n" .
+ "G \n" .
+ "H \n" .
+ "I \n" .
+ "J \n" .
+ "K \n" .
+ "L \n" .
+ "M \n" .
+ "N \n" .
+ "O \n" .
+ "P \n" .
+ "Q \n" .
+ "R \n" .
+ "S \n" .
+ "T \n" .
+ "U \n" .
+ "V \n" .
+ "W \n" .
+ "X \n" .
+ "Y \n" .
+ "Z \n" .
+ " \n
\n\n";
}
+sql_close($c);
+
echo " ";
echo "\n \n
\n";
-
-if ( $agent['tx'] )
- echo "Powered By JSBoard Open Project \n";
+if($agent['tx']) echo "Powered By JSBoard Open Project \n";
htmltail();
+
+/*
+ * Local variables:
+ * tab-width: 2
+ * indent-tabs-mode: nil
+ * c-basic-offset: 2
+ * show-paren-mode: t
+ * End:
+ * vim: filetype=php et ts=2 sw=2
+ */
?>
diff --git a/admin/admin_info.php b/admin/admin_info.php
index 06b88600..7eaebbb8 100644
--- a/admin/admin_info.php
+++ b/admin/admin_info.php
@@ -1,58 +1,98 @@
\n".
+ "\n".
+ "\n".
-# global
-$global_con = readfile_r ($configfile);
-$global_con = preg_replace ("/<\?|\?>/i","",$global_con);
+ "Admin Center Password Change \n".
+ "\n\n".
+
+ " \n\n";
+
+ copyright($copy);
+
+ echo " \n\n \n
\n".
+ "\n";
+} elseif($mode == "global") {
+
+ $configfile = "../config/global.php";
+ $spamlistfile = "../config/spam_list.txt";
-
-
-
-
-
- htmltail (); ?>
+ # global 설정 가져오기
+ $global_con = file_operate($configfile,"r","Don't open $configfile");
+ $global_con = preg_replace("/<\?(php)?|\?>/i","",$global_con);
+
+ # spam list 가져오기
+ if(file_exists($spamlistfile)) $spamlist = file_operate($spamlistfile,"r");
+ else $spamlist = "jsboard/config 에 spam_list.txt 가 존재하지 않습니다";
+
+ $global_con = trim($global_con);
+ $spamlist = trim($spamlist);
+
+ echo " \n".
+ "\n".
+ "\n".
+ "\n\n".
+ "\n\n".
+ " \n
\n \n";
+}
+
+htmltail();
+
+/*
+ * Local variables:
+ * tab-width: 2
+ * indent-tabs-mode: nil
+ * c-basic-offset: 2
+ * show-paren-mode: t
+ * End:
+ * vim: filetype=php et ts=2 sw=2
+ */
+?>
diff --git a/admin/include/admin_head.php b/admin/include/admin_head.php
index 8710bfc5..d34ff127 100644
--- a/admin/include/admin_head.php
+++ b/admin/include/admin_head.php
@@ -1,6 +1,5 @@
alert('Don\'t exist Global configuration file')\n" .
- "history.back()<\/script>";
+# table 이름을 체크한다.
+if($path['type'] == "user_admin") table_name_check($table);
+
+if(!@file_exists("{$ipath}/config/global.php")) {
+ echo"";
die;
} else { include_once "{$ipath}/config/global.php"; }
-if ( $db['type'] == 'sqlite' ) {
- $db['server'] = '.' . $db['server'];
- if ( $path['type'] == 'user_admin' )
- $db['server'] = '../' . $db['server'];
-}
-
-require_once "{$ipath}/theme/{$print['theme']}/config.php";
-putenv ("JSLANG={$_code}");
-require_once ("{$dpath}/language/lang.php");
-require_once ("{$ipath}/database/db.php");
-require_once "$dpath/include/lib.php";
-table_name_check ($print['theme']);
-
-# session
-sessionInit($ipath . '/' . $board['sessTmp']);
-session_start ();
-if( ! session_is_registered ($jsboard) )
- session_destroy();
+$sqlfunc = extension_loaded('mysqli') ? 'sqli' : 'sql';
+include_once "{$ipath}/include/{$sqlfunc}.php";
-# table ̸ üũѴ.
-if ( $path['type'] == "user_admin" || $table )
- table_name_check ($table);
+# session을 시작
+session_start();
-if ( $path['type'] == "user_admin" && $table ) {
- if ( file_exists ("{$ipath}/data/{$table}/config.php") ) {
- require_once "{$ipath}/data/{$table}/config.php";
- require_once "{$ipath}/theme/{$print['theme']}/config.php";
- putenv ("JSLANG={$_code}");
- require_once "{$ipath}/language/{$_code}.lang";
- }
+if($path['type'] == "user_admin" && $table) {
+ if(file_exists("{$ipath}/data/{$table}/config.php"))
+ { include_once "{$ipath}/data/{$table}/config.php"; }
}
-# ܺ ȸ DB include
-if ( file_exists ("{$ipath}/config/external.php") ) {
- require_once "$ipath/config/external.php";
-}
+# 외부 회원 DB 를 사용할 경우 설정 파일 include
+if(file_exists("$ipath/config/external.php")) { include_once "{$ipath}/config/external.php"; }
-table_name_check ($print['theme']);
-require_once "{$ipath}/include/replicate.php";
-require_once "{$dpath}/include/print.php";
-require_once "$dpath/include/first_reg.php";
+# 이메일 주소 변형 체크
+$rmail['chars'] = !$rmail['chars'] ? "__at__" : $rmail['chars'];
-#
-if ( session_is_registered ($jsboard) ) {
- if( $_SESSION[$jsboard]['pos'] == 1 )
- $board['super'] = 1;
+table_name_check($print['theme']);
+include_once "{$ipath}/theme/{$print['theme']}/config.php";
+include_once "{$ipath}/include/lang.php";
+include_once "{$ipath}/include/replicate.php";
+include_once "{$dpath}/include/print.php";
- if ( strstr ($board['ad'],";") ) {
- if ( preg_match ("/{$_SESSION[$jsboard]['id']};|;{$_SESSION[$jsboard]['id']}/",$board['ad']) )
- $board['adm'] = 1;
+# 관리자 정보
+if (isset($_SESSION[$jsboard])) {
+ if($_SESSION[$jsboard]['pos'] == 1) $board['super'] = 1;
+ if(strstr($board['ad'],";")) {
+ if(preg_match("/{$_SESSION[$jsboard]['id']};|;{$_SESSION[$jsboard]['id']}/",$board['ad'])) $board['adm'] = 1;
} else {
- if ( preg_match ("/^{$_SESSION[$jsboard]['id']}$/",$board['ad']) )
- $board['adm'] = 1;
+ if(preg_match("/^{$_SESSION[$jsboard]['id']}$/",$board['ad'])) $board['adm'] = 1;
}
}
-$db = replication_mode ($db);
+$db = replication_mode($db);
+
+/*
+ * Local variables:
+ * tab-width: 2
+ * indent-tabs-mode: nil
+ * c-basic-offset: 2
+ * show-paren-mode: t
+ * End:
+ * vim: filetype=php et ts=2 sw=2
+ */
?>
diff --git a/admin/include/check.php b/admin/include/check.php
new file mode 100644
index 00000000..17f190d0
--- /dev/null
+++ b/admin/include/check.php
@@ -0,0 +1,148 @@
+\n \n" .
+ " {$langs['nodb']} \n" .
+ "
";
+ exit;
+ }
+}
+
+# 생성할 게시판 이름에 대한 존재및 적격 여부 검사 루틴
+#
+function table_name_check($table,$ck=0) {
+ global $langs;
+ $table = trim($table);
+
+ if(!$langs['n_t_n']) {
+ $langs['n_t_n'] = "Table Name Missing! You must select a table";
+ $langs['n_db'] = "Board name must start with an alphabet";
+ $langs['n_meta'] = "Can't use special characters except alphabat, numberlic, _, - charcters";
+ $langs['n_promise'] = "Cat't use table name as "as"";
+ }
+
+ if (!$ck && !$table) print_error($langs['n_t_n'],250,150,1);
+ if (!preg_match("/^[a-z]/i",$table)) print_error($langs['n_db'],250,150,1);
+ if (preg_match("/[^a-z0-9_\-]/i",$table)) print_error($langs['n_meta'],250,150,1);
+ if (preg_match("/^as$/i",$table)) print_error($langs['n_promise'],250,150,1);
+
+ if ( preg_match ('!/.+|%00!', $table) )
+ print_error ("Ugly access with table variable \"{$table}\"", 250, 150, 1);
+}
+
+function check_userlist_type($t) {
+ if(is_hangul($t)) {
+ if($t == "가") $r['like'] = "나";
+ if($t == "나") $r['like'] = "다";
+ if($t == "다") $r['like'] = "라";
+ if($t == "라") $r['like'] = "마";
+ if($t == "마") $r['like'] = "바";
+ if($t == "바") $r['like'] = "사";
+ if($t == "사") $r['like'] = "아";
+ if($t == "아") $r['like'] = "자";
+ if($t == "자") $r['like'] = "차";
+ if($t == "차") $r['like'] = "카";
+ if($t == "카") $r['like'] = "타";
+ if($t == "타") $r['like'] = "파";
+ if($t == "파") $r['like'] = "하";
+ if($t == "하") $r['like'] = chr(0xfe);
+ $r['like'] = "WHERE binary nid BETWEEN binary '$t' AND binary '{$r['like']}'";
+ } else {
+ $r['like'] = "WHERE nid LIKE '$t%'";
+ }
+ $r['links'] = "t=$t&";
+ return $r;
+}
+
+function check_admin($user) {
+ $p = opendir("./data");
+ while($i = readdir($p)) {
+ if($i != "." && $i != ".." && is_dir("./data/$i")) {
+ if ( ! file_exists(($chkfile = "./data/$i/config.php")) )
+ continue;
+ $c = fopen($chkfile,"rb");
+ $chk = fread($c,500);
+ $chk = preg_replace("/.+board\[ad\][ ]*=[ ]*\"([^\"]*)\".+/i","\\1",$chk);
+ if(trim($chk) == trim($user)) {
+ closedir($p);
+ return 1;
+ break;
+ }
+ }
+ }
+ closedir($p);
+}
+
+function check_invalid($str) {
+ $perment = " [ SECURITY WARNING!! ] - jsboard don't permit";
+ $target = array("/<(\?|%)/i","/(\?|%)>/i","/<(\/?embed[^>]*)>/i","/<(IMG[^>]*SRC=[^\.]+\.(ph|asp|htm|jsp|cgi|pl|sh)[^>]*)>/i");
+ $remove = array(""," ","$perment <\\1> ","$perment <\\1> ");
+
+ if(preg_match("/";
+}
+?>
+
-
+";
+?>
diff --git a/admin/include/html_atail.php b/admin/include/html_atail.php
index d682e486..e1de4d37 100644
--- a/admin/include/html_atail.php
+++ b/admin/include/html_atail.php
@@ -2,5 +2,5 @@
-
-