git-svn-id: http://xe-core.googlecode.com/svn/trunk@822 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-30 07:16:39 +00:00
parent 182f48d011
commit 712cb9906c
27 changed files with 110 additions and 102 deletions

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module version="0.1"> <module version="0.1">
<title xml:lang="ko">스팸필터</title> <title xml:lang="ko">스팸필터</title>
<title xml:lang="en">spam filter</title> <author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28"> <name xml:lang="ko">제로</name>
<name xml:lang="ko">제로</name> <description xml:lang="ko">제로보드 XE의 기본 스팸필터입니다.</description>
<name xml:lang="en">zero</name> </author>
<description xml:lang="ko">제로보드의 기본 스팸필터입니다.</description>
<description xml:lang="en">Default spam filter of zeroboard</description>
</author>
</module> </module>

View file

@ -2,14 +2,14 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispConfig" type="view" admin_index="true" standalone="true" /> <action name="dispSpamfilterAdminConfig" type="view" admin_index="true" standalone="true" />
<action name="dispDeniedIPList" type="view" standalone="true" /> <action name="dispSpamfilterAdminDeniedIPList" type="view" standalone="true" />
<action name="dispDeniedWordList" type="view" standalone="true" /> <action name="dispSpamfilterAdminDeniedWordList" type="view" standalone="true" />
<action name="procInsertConfig" type="controller" standalone="true" /> <action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" />
<action name="procInsertDeniedIP" type="controller" standalone="true" /> <action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" />
<action name="procDeleteDeniedIP" type="controller" standalone="true" /> <action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" />
<action name="procInsertDeniedWord" type="controller" standalone="true" /> <action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" />
<action name="procDeleteDeniedWord" type="controller" standalone="true" /> <action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" />
</actions> </actions>
</module> </module>

View file

@ -1,8 +1,8 @@
<query id="deleteDeniedIP" action="delete"> <query id="deleteDeniedIP" action="delete">
<tables> <tables>
<table name="spamfilter_denied_ip" /> <table name="spamfilter_denied_ip" />
</tables> </tables>
<conditions> <conditions>
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" /> <condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,8 +1,8 @@
<query id="deleteDeniedWord" action="delete"> <query id="deleteDeniedWord" action="delete">
<tables> <tables>
<table name="spamfilter_denied_word" /> <table name="spamfilter_denied_word" />
</tables> </tables>
<conditions> <conditions>
<condition operation="equal" column="word" var="word" filter="number" notnull="notnull" /> <condition operation="equal" column="word" var="word" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getDeniedIPList" action="select"> <query id="getDeniedIPList" action="select">
<tables> <tables>
<table name="spamfilter_denied_ip" /> <table name="spamfilter_denied_ip" />
</tables> </tables>
<columns> <columns>
<column name="*" /> <column name="*" />
</columns> </columns>
<navigation> <navigation>
<index var="sort_index" order="desc" /> <index var="sort_index" order="desc" />
</navigation> </navigation>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getDeniedWordList" action="select"> <query id="getDeniedWordList" action="select">
<tables> <tables>
<table name="spamfilter_denied_word" /> <table name="spamfilter_denied_word" />
</tables> </tables>
<columns> <columns>
<column name="*" /> <column name="*" />
</columns> </columns>
<navigation> <navigation>
<index var="sort_index" order="desc" /> <index var="sort_index" order="desc" />
</navigation> </navigation>
</query> </query>

View file

@ -1,12 +1,12 @@
<query id="getLogCount" action="select"> <query id="getLogCount" action="select">
<tables> <tables>
<table name="spamfilter_log" /> <table name="spamfilter_log" />
</tables> </tables>
<columns> <columns>
<column name="count(*)" alias="count" /> <column name="count(*)" alias="count" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" /> <condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
<condition operation="more" column="regdate" var="regdate" notnull="notnull" pipe="and" /> <condition operation="more" column="regdate" var="regdate" notnull="notnull" pipe="and" />
</conditions> </conditions>
</query> </query>

View file

@ -1,9 +1,9 @@
<query id="insertDeniedIP" action="insert"> <query id="insertDeniedIP" action="insert">
<tables> <tables>
<table name="spamfilter_denied_ip" /> <table name="spamfilter_denied_ip" />
</tables> </tables>
<columns> <columns>
<column name="ipaddress" var="ipaddress" notnull="notnull" /> <column name="ipaddress" var="ipaddress" notnull="notnull" />
<column name="regdate" var="regdate" default="curdate()" /> <column name="regdate" var="regdate" default="curdate()" />
</columns> </columns>
</query> </query>

View file

@ -1,9 +1,9 @@
<query id="insertDeniedIP" action="insert"> <query id="insertDeniedIP" action="insert">
<tables> <tables>
<table name="spamfilter_denied_word" /> <table name="spamfilter_denied_word" />
</tables> </tables>
<columns> <columns>
<column name="word" var="word" notnull="notnull" /> <column name="word" var="word" notnull="notnull" />
<column name="regdate" var="regdate" default="curdate()" /> <column name="regdate" var="regdate" default="curdate()" />
</columns> </columns>
</query> </query>

View file

@ -1,10 +1,10 @@
<query id="insertLog" action="insert"> <query id="insertLog" action="insert">
<tables> <tables>
<table name="spamfilter_log" /> <table name="spamfilter_log" />
</tables> </tables>
<columns> <columns>
<column name="spamfilter_log_srl" default="sequence()" /> <column name="spamfilter_log_srl" default="sequence()"/>
<column name="ipaddress" default="ipaddress()" /> <column name="ipaddress" default="ipaddress()" />
<column name="regdate" var="regdate" default="curdate()" /> <column name="regdate" var="regdate" default="curdate()" />
</columns> </columns>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="isDeniedIP" action="select"> <query id="isDeniedIP" action="select">
<tables> <tables>
<table name="spamfilter_denied_ip" /> <table name="spamfilter_denied_ip" />
</tables> </tables>
<columns> <columns>
<column name="count(*)" alias="count" /> <column name="count(*)" alias="count" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" /> <condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,4 +1,4 @@
<table name="spamfilter_denied_ip"> <table name="spamfilter_denied_ip">
<column name="ipaddress" type="varchar" size="250" notnull="notnull" primary_key="primary_key" /> <column name="ipaddress" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="regdate" type="date" index="idx_regdate" /> <column name="regdate" type="date" index="idx_regdate" />
</table> </table>

View file

@ -1,4 +1,4 @@
<table name="spamfilter_denied_word"> <table name="spamfilter_denied_word">
<column name="word" type="varchar" size="250" notnull="notnull" primary_key="primary_key" /> <column name="word" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="regdate" type="date" index="idx_regdate" /> <column name="regdate" type="date" index="idx_regdate" />
</table> </table>

View file

@ -1,5 +1,5 @@
<table name="spamfilter_log"> <table name="spamfilter_log">
<column name="spamfilter_log_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" /> <column name="spamfilter_log_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="ipaddress" type="varchar" size="250" notnull="notnull" index="idx_ipaddress" /> <column name="ipaddress" type="varchar" size="250" notnull="notnull" index="idx_ipaddress" />
<column name="regdate" type="date" index="idx_regdate" /> <column name="regdate" type="date" index="idx_regdate" />
</table> </table>

View file

@ -11,6 +11,17 @@
* @brief 설치시 추가 작업이 필요할시 구현 * @brief 설치시 추가 작업이 필요할시 구현
**/ **/
function moduleInstall() { function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionFoward('spamfilter', 'view', 'dispSpamfilterAdminConfig');
$oModuleController->insertActionFoward('spamfilter', 'view', 'dispSpamfilterAdminDeniedIPList');
$oModuleController->insertActionFoward('spamfilter', 'view', 'dispSpamfilterAdminDeniedWordList');
$oModuleController->insertActionFoward('spamfilter', 'controller', 'procSpamfilterAdminInsertConfig');
$oModuleController->insertActionFoward('spamfilter', 'controller', 'procSpamfilterAdminInsertDeniedIP');
$oModuleController->insertActionFoward('spamfilter', 'controller', 'procSpamfilterAdminDeleteDeniedIP');
$oModuleController->insertActionFoward('spamfilter', 'controller', 'procSpamfilterAdminInsertDeniedWord');
$oModuleController->insertActionFoward('spamfilter', 'controller', 'procSpamfilterAdminDeleteDeniedWord');
return new Object(); return new Object();
} }

View file

@ -16,7 +16,7 @@
/** /**
* @brief 스팸필터 설정 * @brief 스팸필터 설정
**/ **/
function procInsertConfig() { function procSpamfilterAdminInsertConfig() {
// 기본 정보를 받음 // 기본 정보를 받음
$args = Context::gets('interval','limit_count','check_trackback'); $args = Context::gets('interval','limit_count','check_trackback');
if($args->check_trackback!='Y') $args->check_trackback = 'N'; if($args->check_trackback!='Y') $args->check_trackback = 'N';
@ -30,7 +30,7 @@
/** /**
* @brief 금지 IP등록 * @brief 금지 IP등록
**/ **/
function procInsertDeniedIP() { function procSpamfilterAdminInsertDeniedIP() {
$ipaddress = Context::get('ipaddress'); $ipaddress = Context::get('ipaddress');
return $this->insertIP($ipaddress); return $this->insertIP($ipaddress);
} }
@ -39,14 +39,14 @@
* @brief 금지 IP삭제 * @brief 금지 IP삭제
**/ **/
function procDeleteDeniedIP() { function procDeleteDeniedIP() {
$ipaddress = Context::get('ipaddress'); $ipaddresSpamfilterAdmins = Context::get('ipaddress');
return $this->deleteIP($ipaddress); return $this->deleteIP($ipaddress);
} }
/** /**
* @brief 금지 Word등록 * @brief 금지 Word등록
**/ **/
function procInsertDeniedWord() { function procSpamfilterAdminInsertDeniedWord() {
$word = Context::get('word'); $word = Context::get('word');
return $this->insertWord($word); return $this->insertWord($word);
} }
@ -54,7 +54,7 @@
/** /**
* @brief 금지 Word삭제 * @brief 금지 Word삭제
**/ **/
function procDeleteDeniedWord() { function procSpamfilterAdminDeleteDeniedWord() {
$word = Context::get('word'); $word = Context::get('word');
return $this->deleteWord($word); return $this->deleteWord($word);
} }

View file

@ -18,7 +18,7 @@
/** /**
* @brief 스팸필터의 설정 화면 * @brief 스팸필터의 설정 화면
**/ **/
function dispConfig() { function dispSpamfilterAdminConfig() {
// 설정 정보를 받아옴 (module model 객체를 이용) // 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('spamfilter'); $config = $oModuleModel->getModuleConfig('spamfilter');
@ -31,7 +31,7 @@
/** /**
* @brief 금지 목록 출력 * @brief 금지 목록 출력
**/ **/
function dispDeniedIPList() { function dispSpamfilterAdminDeniedIPList() {
// 등록된 금지 IP 목록을 가져옴 // 등록된 금지 IP 목록을 가져옴
$oSpamFilterModel = &getModel('spamfilter'); $oSpamFilterModel = &getModel('spamfilter');
$ip_list = $oSpamFilterModel->getDeniedIPList(); $ip_list = $oSpamFilterModel->getDeniedIPList();
@ -45,7 +45,7 @@
/** /**
* @brief 금지 목록 출력 * @brief 금지 목록 출력
**/ **/
function dispDeniedWordList() { function dispSpamfilterAdminDeniedWordList() {
// 등록된 금지 Word 목록을 가져옴 // 등록된 금지 Word 목록을 가져옴
$oSpamFilterModel = &getModel('spamfilter'); $oSpamFilterModel = &getModel('spamfilter');
$word_list = $oSpamFilterModel->getDeniedWordList(); $word_list = $oSpamFilterModel->getDeniedWordList();