mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 07:12:15 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
17
modules/spamfilter/conf/info.xml
Normal file
17
modules/spamfilter/conf/info.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module version="0.1">
|
||||
<title xml:lang="ko">스팸필터</title>
|
||||
<title xml:lang="zh-CN">垃圾过滤</title>
|
||||
<title xml:lang="en">Spam Filter</title>
|
||||
<title xml:lang="jp">スパムフィルター</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<name xml:lang="jp">Zero</name>
|
||||
<description xml:lang="ko">제로보드 XE의 기본 스팸필터입니다.</description>
|
||||
<description xml:lang="zh-CN">Zeroboard XE的基本垃圾过滤模块。</description>
|
||||
<description xml:lang="en">A default spam filter of Zeroboard XE.</description>
|
||||
<description xml:lang="jp">ゼロボードXEのスパムフィルターです。</description>
|
||||
</author>
|
||||
</module>
|
||||
15
modules/spamfilter/conf/module.xml
Normal file
15
modules/spamfilter/conf/module.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<actions>
|
||||
<action name="dispSpamfilterAdminConfig" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispSpamfilterAdminDeniedIPList" type="view" standalone="true" />
|
||||
<action name="dispSpamfilterAdminDeniedWordList" type="view" standalone="true" />
|
||||
|
||||
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" />
|
||||
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" />
|
||||
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" />
|
||||
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" />
|
||||
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
32
modules/spamfilter/lang/en.lang.php
Normal file
32
modules/spamfilter/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/spamfilter/lang/en.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief English Language Pack (basic)
|
||||
**/
|
||||
|
||||
// action related
|
||||
$lang->cmd_denied_ip = "Black listed IPs";
|
||||
$lang->cmd_denied_word = "Black listed words";
|
||||
|
||||
// general word
|
||||
$lang->spamfilter = "Spam filter";
|
||||
$lang->denied_ip = "IP blacklist";
|
||||
$lang->interval = "Interval for spam process";
|
||||
$lang->limit_count = "No. of limit";
|
||||
$lang->check_trackback = "Check trackback";
|
||||
$lang->word = "word";
|
||||
|
||||
// for description word
|
||||
$lang->about_interval = "It is a time setting to block posting an article within the time.";
|
||||
$lang->about_limit_count = "If you try to post an article more times over the limit within the setted time,\n it will be recognized as a spam, and your IP will be blocked.";
|
||||
$lang->about_denied_ip = "Using *, You can block all IP addresses of 127.0.0.* patterned address.";
|
||||
$lang->about_denied_word = "When you add a word to Black Listed Words,\n you can block an article contained the word not to be posted.";
|
||||
$lang->about_check_trackback = "Only the trackback by one IP per an article could be allowed.";
|
||||
|
||||
// to post a message
|
||||
$lang->msg_alert_limited_by_config = 'Posting an article within %s second is not allowed.\n If you try it again and again, your IP may be listed as a IP blacklist.';
|
||||
$lang->msg_alert_denied_word = 'The word "%s" is not allowed to be used.';
|
||||
$lang->msg_alert_registered_denied_ip = 'Your IP was listed as a IP blacklist,\n so you may have limitations on normal use of this site.\n If you have any questions on that matter, please contact to the site administrator.';
|
||||
$lang->msg_alert_trackback_denied = 'Only one trackback per an article is allowed.';
|
||||
?>
|
||||
32
modules/spamfilter/lang/jp.lang.php
Normal file
32
modules/spamfilter/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/spamfilter/lang/jp.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻訳:RisaPapa
|
||||
* @brief 日本語言語パッケージ(基本的な内容のみ)
|
||||
**/
|
||||
|
||||
// action関連
|
||||
$lang->cmd_denied_ip = "禁止IPリスト";
|
||||
$lang->cmd_denied_word = "禁止ワードリスト";
|
||||
|
||||
// 一般用語
|
||||
$lang->spamfilter = "スパムフィルター";
|
||||
$lang->denied_ip = "禁止IP";
|
||||
$lang->interval = "スパム処理間隔";
|
||||
$lang->limit_count = "制限数";
|
||||
$lang->check_trackback = "トラックバック検査";
|
||||
$lang->word = "ワード";
|
||||
|
||||
// 説明文
|
||||
$lang->about_interval = "指定された時間内の書き込みが行えないようにします。";
|
||||
$lang->about_limit_count = "指定された時間内に制限数を超える書き込みが行われるとスパムとして認識し、該当するIPを禁止します。";
|
||||
$lang->about_denied_ip = "「127.0.0.* 」のように「*」で、「127.0.0」以下ののIP帯域をすべて禁止することができます。";
|
||||
$lang->about_denied_word = "禁止ワードとして登録されると該当するワードが存在する書き込みを禁することができます。";
|
||||
$lang->about_check_trackback = "一つのIPからのみトラックバックを受信するようにします。";
|
||||
|
||||
// メッセージ出力用
|
||||
$lang->msg_alert_limited_by_config = '%s秒以内の書き込みは禁止されます。続けて行うとスパムとして認識され、禁止IPに登録されます。';
|
||||
$lang->msg_alert_denied_word = '"%s"は使用が禁止されたワードです。';
|
||||
$lang->msg_alert_registered_denied_ip = '禁止IPに登録され、サイト内で正常な活動が制限されています。管理者にお問い合わせください。';
|
||||
$lang->msg_alert_trackback_denied = '一つの書き込みには、1つのトラックバックしか受け取れません。';
|
||||
?>
|
||||
32
modules/spamfilter/lang/ko.lang.php
Normal file
32
modules/spamfilter/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/spamfilter/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 한국어 언어팩 (기본적인 내용만 수록)
|
||||
**/
|
||||
|
||||
// action 관련
|
||||
$lang->cmd_denied_ip = "금지IP 목록";
|
||||
$lang->cmd_denied_word = "금지단어 목록";
|
||||
|
||||
// 일반 단어
|
||||
$lang->spamfilter = "스팸필터";
|
||||
$lang->denied_ip = "금지 IP";
|
||||
$lang->interval = "스팸 처리 간격";
|
||||
$lang->limit_count = "제한수";
|
||||
$lang->check_trackback = "트랙백 검사";
|
||||
$lang->word = "단어";
|
||||
|
||||
// 설명문
|
||||
$lang->about_interval = "지정된 시간내에 글을 등록하지 못하게 합니다";
|
||||
$lang->about_limit_count = "지정된 시간내에 제한수를 넘겨서 글 작성을 시도하면 스팸으로 인식, IP를 금지 시킵니다";
|
||||
$lang->about_denied_ip = "127.0.0.* 와 같이 * 로 정해진 패턴의 IP 대역을 모두 금지 시킬 수 있습니다";
|
||||
$lang->about_denied_word = "금지 단어로 등록되면 해당 단어가 있는 글은 등록을 금지 시킬 수 있습니다";
|
||||
$lang->about_check_trackback = "한 글에 한 IP에만 트랙백을 허용할 수 있습니다";
|
||||
|
||||
// 메세지 출력용
|
||||
$lang->msg_alert_limited_by_config = '%s 초 이내에 글 작성은 금지 됩니다. 계속 시도하시면 금지 IP에 등록되실 수 있습니다';
|
||||
$lang->msg_alert_denied_word = '"%s"는 사용 금지된 단어입니다';
|
||||
$lang->msg_alert_registered_denied_ip = '금지 IP에 등록되셔서 정상적인 활동에 제한을 받게 되셨습니다. 문의는 사이트 관리자에게 해주시기 바랍니다';
|
||||
$lang->msg_alert_trackback_denied = '한 글에는 하나의 트랙백만 허용이 됩니다';
|
||||
?>
|
||||
32
modules/spamfilter/lang/zh-CN.lang.php
Normal file
32
modules/spamfilter/lang/zh-CN.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/spamfilter/lang/zh-CN.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 简体中文语言包(只收录基本内容)
|
||||
**/
|
||||
|
||||
// action 相关
|
||||
$lang->cmd_denied_ip = "禁止IP 目录";
|
||||
$lang->cmd_denied_word = "敏感词语目录";
|
||||
|
||||
// 一般用语
|
||||
$lang->spamfilter = "垃圾过滤";
|
||||
$lang->denied_ip = "禁止 IP";
|
||||
$lang->interval = "处理垃圾间隔";
|
||||
$lang->limit_count = "限制数";
|
||||
$lang->check_trackback = "引用检查";
|
||||
$lang->word = "词语";
|
||||
|
||||
// 说明文
|
||||
$lang->about_interval = "指定的时间内禁止发表新主题。";
|
||||
$lang->about_limit_count = "在指定的时间内发表的新主题超过限制数时,系统默认为是垃圾主题,将自动禁止对方的IP。";
|
||||
$lang->about_denied_ip = "禁止 IP可以使用通配符。(如:如 \"127.0.*.*\")";
|
||||
$lang->about_denied_word = "登录为敏感词,可以对要发表的主题进行检测并禁止让包含敏感词的主题发表。";
|
||||
$lang->about_check_trackback = "在一个主题中只对一个IP允许引用。";
|
||||
|
||||
// 提示信息
|
||||
$lang->msg_alert_limited_by_config = '%s秒之内不能连续发表新主题。如您继续再试系统会自动禁止您的IP。';
|
||||
$lang->msg_alert_denied_word = '"%s"是敏感语!';
|
||||
$lang->msg_alert_registered_denied_ip = '您的IP已被禁止,详情请联系网站管理员。';
|
||||
$lang->msg_alert_trackback_denied = '一个主题只允许一个引用。';
|
||||
?>
|
||||
8
modules/spamfilter/queries/deleteDeniedIP.xml
Normal file
8
modules/spamfilter/queries/deleteDeniedIP.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteDeniedIP" action="delete">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_ip" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
8
modules/spamfilter/queries/deleteDeniedWord.xml
Normal file
8
modules/spamfilter/queries/deleteDeniedWord.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteDeniedWord" action="delete">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_word" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="word" var="word" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/spamfilter/queries/getDeniedIPList.xml
Normal file
11
modules/spamfilter/queries/getDeniedIPList.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getDeniedIPList" action="select">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_ip" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<navigation>
|
||||
<index var="sort_index" default="regdate" order="desc" />
|
||||
</navigation>
|
||||
</query>
|
||||
11
modules/spamfilter/queries/getDeniedWordList.xml
Normal file
11
modules/spamfilter/queries/getDeniedWordList.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getDeniedWordList" action="select">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_word" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<navigation>
|
||||
<index var="sort_index" default="regdate" order="desc" />
|
||||
</navigation>
|
||||
</query>
|
||||
12
modules/spamfilter/queries/getLogCount.xml
Normal file
12
modules/spamfilter/queries/getLogCount.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getLogCount" action="select">
|
||||
<tables>
|
||||
<table name="spamfilter_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
|
||||
<condition operation="more" column="regdate" var="regdate" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/spamfilter/queries/insertDeniedIP.xml
Normal file
9
modules/spamfilter/queries/insertDeniedIP.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="insertDeniedIP" action="insert">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_ip" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="ipaddress" var="ipaddress" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
9
modules/spamfilter/queries/insertDeniedWord.xml
Normal file
9
modules/spamfilter/queries/insertDeniedWord.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="insertDeniedIP" action="insert">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_word" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="word" var="word" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
10
modules/spamfilter/queries/insertLog.xml
Normal file
10
modules/spamfilter/queries/insertLog.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<query id="insertLog" action="insert">
|
||||
<tables>
|
||||
<table name="spamfilter_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="spamfilter_log_srl" default="sequence()"/>
|
||||
<column name="ipaddress" default="ipaddress()" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
11
modules/spamfilter/queries/isDeniedIP.xml
Normal file
11
modules/spamfilter/queries/isDeniedIP.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="isDeniedIP" action="select">
|
||||
<tables>
|
||||
<table name="spamfilter_denied_ip" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
4
modules/spamfilter/schemas/spamfilter_denied_ip.xml
Normal file
4
modules/spamfilter/schemas/spamfilter_denied_ip.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<table name="spamfilter_denied_ip">
|
||||
<column name="ipaddress" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
4
modules/spamfilter/schemas/spamfilter_denied_word.xml
Normal file
4
modules/spamfilter/schemas/spamfilter_denied_word.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<table name="spamfilter_denied_word">
|
||||
<column name="word" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
5
modules/spamfilter/schemas/spamfilter_log.xml
Normal file
5
modules/spamfilter/schemas/spamfilter_log.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<table name="spamfilter_log">
|
||||
<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="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
98
modules/spamfilter/spamfilter.admin.controller.php
Normal file
98
modules/spamfilter/spamfilter.admin.controller.php
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class spamfilterAdminController extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸필터 설정
|
||||
**/
|
||||
function procSpamfilterAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('interval','limit_count','check_trackback');
|
||||
if($args->check_trackback!='Y') $args->check_trackback = 'N';
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('spamfilter',$args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 IP등록
|
||||
**/
|
||||
function procSpamfilterAdminInsertDeniedIP() {
|
||||
$ipaddress = Context::get('ipaddress');
|
||||
|
||||
$oSpamfilterController = &getController('spamfilter');
|
||||
return $oSpamfilterController->insertIP($ipaddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 IP삭제
|
||||
**/
|
||||
function procSpamfilterAdminDeleteDeniedIP() {
|
||||
$ipaddress = Context::get('ipaddress');
|
||||
return $this->deleteIP($ipaddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 Word등록
|
||||
**/
|
||||
function procSpamfilterAdminInsertDeniedWord() {
|
||||
$word = Context::get('word');
|
||||
return $this->insertWord($word);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 Word삭제
|
||||
**/
|
||||
function procSpamfilterAdminDeleteDeniedWord() {
|
||||
$word = Context::get('word');
|
||||
return $this->deleteWord($word);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief IP 제거
|
||||
* 스패머로 등록된 IP를 제거
|
||||
**/
|
||||
function deleteIP($ipaddress) {
|
||||
if(!$ipaddress) return;
|
||||
|
||||
$args->ipaddress = $ipaddress;
|
||||
return executeQuery('spamfilter.deleteDeniedIP', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸단어 등록
|
||||
* 등록된 단어가 포함된 글은 스팸글로 간주
|
||||
**/
|
||||
function insertWord($word) {
|
||||
if(!$word) return;
|
||||
|
||||
$args->word = $word;
|
||||
return executeQuery('spamfilter.insertDeniedWord', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸단어 제거
|
||||
* 스팸 단어로 등록된 단어 제거
|
||||
**/
|
||||
function deleteWord($word) {
|
||||
if(!$word) return;
|
||||
|
||||
$args->word = $word;
|
||||
return executeQuery('spamfilter.deleteDeniedWord', $args);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
59
modules/spamfilter/spamfilter.admin.view.php
Normal file
59
modules/spamfilter/spamfilter.admin.view.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class spamfilterAdminView extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// 템플릿 경로 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸필터의 설정 화면
|
||||
**/
|
||||
function dispSpamfilterAdminConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('spamfilter');
|
||||
Context::set('config',$config);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 목록 출력
|
||||
**/
|
||||
function dispSpamfilterAdminDeniedIPList() {
|
||||
// 등록된 금지 IP 목록을 가져옴
|
||||
$oSpamFilterModel = &getModel('spamfilter');
|
||||
$ip_list = $oSpamFilterModel->getDeniedIPList();
|
||||
|
||||
Context::set('ip_list', $ip_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('denied_ip_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 목록 출력
|
||||
**/
|
||||
function dispSpamfilterAdminDeniedWordList() {
|
||||
// 등록된 금지 Word 목록을 가져옴
|
||||
$oSpamFilterModel = &getModel('spamfilter');
|
||||
$word_list = $oSpamFilterModel->getDeniedWordList();
|
||||
|
||||
Context::set('word_list', $word_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('denied_word_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
38
modules/spamfilter/spamfilter.class.php
Normal file
38
modules/spamfilter/spamfilter.class.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilter
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 high class
|
||||
**/
|
||||
|
||||
class spamfilter extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('spamfilter', 'view', 'dispSpamfilterAdminConfig');
|
||||
$oModuleController->insertActionForward('spamfilter', 'view', 'dispSpamfilterAdminDeniedIPList');
|
||||
$oModuleController->insertActionForward('spamfilter', 'view', 'dispSpamfilterAdminDeniedWordList');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
35
modules/spamfilter/spamfilter.controller.php
Normal file
35
modules/spamfilter/spamfilter.controller.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 controller class
|
||||
**/
|
||||
|
||||
class spamfilterController extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief IP 등록
|
||||
* 등록된 IP는 스패머로 간주
|
||||
**/
|
||||
function insertIP($ipaddress) {
|
||||
$args->ipaddress = $ipaddress;
|
||||
return executeQuery('spamfilter.insertDeniedIP', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그 등록
|
||||
* 현 접속 IP를 로그에 등록, 로그의 간격이 특정 시간 이내일 경우 도배로 간주하여
|
||||
* 스패머로 등록할 수 있음
|
||||
**/
|
||||
function insertLog() {
|
||||
$output = executeQuery('spamfilter.insertLog');
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
73
modules/spamfilter/spamfilter.model.php
Normal file
73
modules/spamfilter/spamfilter.model.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 Model class
|
||||
**/
|
||||
|
||||
class spamfilterModel extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸필터 모듈의 사용자 설정 값 return
|
||||
**/
|
||||
function getConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
return $oModuleModel->getModuleConfig('spamfilter');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 등록된 금지 IP의 목록을 return
|
||||
**/
|
||||
function getDeniedIPList() {
|
||||
$args->sort_index = "regdate";
|
||||
$args->page = Context::get('page')?Context::get('page'):1;
|
||||
$output = executeQuery('spamfilter.getDeniedIPList', $args);
|
||||
if(!$output->data) return;
|
||||
if(!is_array($output->data)) return array($output->data);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 인자로 넘겨진 ipaddress가 금지 ip인지 체크하여 return
|
||||
**/
|
||||
function isDeniedIP($ipaddress) {
|
||||
$args->ipaddress = $ipaddress;
|
||||
$output = executeQuery('spamfilter.isDeniedIP', $args);
|
||||
if($output->data->count>0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 등록된 금지 Word 의 목록을 return
|
||||
**/
|
||||
function getDeniedWordList() {
|
||||
$args->sort_index = "regdate";
|
||||
$output = executeQuery('spamfilter.getDeniedWordList', $args);
|
||||
if(!$output->data) return;
|
||||
if(!is_array($output->data)) return array($output->data);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 지정된 IPaddress의 특정 시간대 내의 로그 수를 return
|
||||
**/
|
||||
function getLogCount($time = 60, $ipaddress='') {
|
||||
if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
$args->ipaddress = $ipaddress;
|
||||
$args->regdate = date("YmdHis", time()-$time);
|
||||
$output = executeQuery('spamfilter.getLogCount', $args);
|
||||
$count = $output->data->count;
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
55
modules/spamfilter/tpl/denied_ip_list.html
Normal file
55
modules/spamfilter/tpl/denied_ip_list.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<!--%import("filter/insert_denied_ip.xml")-->
|
||||
<!--%import("filter/delete_denied_ip.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<!-- 스패머 정보 -->
|
||||
<div class="tableSummaryType1">
|
||||
Total <strong>{number_format($ip_list)}</strong>
|
||||
</div>
|
||||
|
||||
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
||||
<form id="fo_denied_ip" action="./" method="get">
|
||||
<input type="hidden" name="ipaddress" value="" />
|
||||
</form>
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="tableType1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->regdate}</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($ip_list as $no => $val)-->
|
||||
<tr>
|
||||
<td class="tahoma">{count($ip_list)-$no}</td>
|
||||
<td class="tahoma">{$val->ipaddress}</td>
|
||||
<td class="tahoma">{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td class="red"><a href="#" onclick="doDeleteDeniedIP('{$val->ipaddress}');return false;">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 수동 추가 -->
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_denied_ip)">
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->denied_ip}</th>
|
||||
<td class="left">
|
||||
<input type="text" name="ipaddress" value="" class="inputTypeText" />
|
||||
<p>{$lang->about_denied_ip}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
</form>
|
||||
55
modules/spamfilter/tpl/denied_word_list.html
Normal file
55
modules/spamfilter/tpl/denied_word_list.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<!--%import("filter/insert_denied_word.xml")-->
|
||||
<!--%import("filter/delete_denied_word.xml")-->
|
||||
|
||||
<!-- 스패머 정보 -->
|
||||
<div class="tableSummaryType1">
|
||||
Total <strong>{number_format($word_list)}</strong>
|
||||
</div>
|
||||
|
||||
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
||||
<form id="fo_denied_word" action="./" method="get">
|
||||
<input type="hidden" name="word" value="" />
|
||||
</form>
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="tableType1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">{$lang->word}</th>
|
||||
<th scope="col">{$lang->regdate}</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($word_list as $no => $val)-->
|
||||
<tr>
|
||||
<td class="tahoma">{count($word_list)-$no}</td>
|
||||
<td>{$val->word}</td>
|
||||
<td class="tahoma">{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td class="red"><a href="#" onclick="doDeleteDeniedWord('{$val->word}');return false;">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 수동 추가 -->
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_denied_word)">
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->word}</th>
|
||||
<td class="left">
|
||||
<input type="text" name="word" value="" class="inputTypeText" />
|
||||
<p>{$lang->about_denied_word}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
</form>
|
||||
7
modules/spamfilter/tpl/filter/delete_denied_ip.xml
Normal file
7
modules/spamfilter/tpl/filter/delete_denied_ip.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<filter name="delete_denied_ip" module="spamfilter" act="procSpamfilterAdminDeleteDeniedIP" confirm_msg_code="confirm_delete">
|
||||
<form />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
7
modules/spamfilter/tpl/filter/delete_denied_word.xml
Normal file
7
modules/spamfilter/tpl/filter/delete_denied_word.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<filter name="delete_denied_word" module="spamfilter" act="procSpamfilterAdminDeleteDeniedWord" confirm_msg_code="confirm_delete">
|
||||
<form />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
7
modules/spamfilter/tpl/filter/insert_config.xml
Normal file
7
modules/spamfilter/tpl/filter/insert_config.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<filter name="insert_config" module="spamfilter" act="procSpamfilterAdminInsertConfig" confirm_msg_code="confirm_submit">
|
||||
<form />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
12
modules/spamfilter/tpl/filter/insert_denied_ip.xml
Normal file
12
modules/spamfilter/tpl/filter/insert_denied_ip.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<filter name="insert_denied_ip" module="spamfilter" act="procSpamfilterAdminInsertDeniedIP" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="ipaddress" required="true" minlength="4" maxlength="250" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param param="ipaddress" target="ipaddress" />
|
||||
</parameter>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
12
modules/spamfilter/tpl/filter/insert_denied_word.xml
Normal file
12
modules/spamfilter/tpl/filter/insert_denied_word.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<filter name="insert_denied_word" module="spamfilter" act="procSpamfilterAdminInsertDeniedWord" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="word" required="true" minlength="1" maxlength="250" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param param="word" target="word" />
|
||||
</parameter>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
11
modules/spamfilter/tpl/header.html
Normal file
11
modules/spamfilter/tpl/header.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!--%import("js/spamfilter_admin.js")-->
|
||||
|
||||
<h3>{$lang->spamfilter} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<div class="header4">
|
||||
<ul class="localNavigation">
|
||||
<li <!--@if($act=='dispSpamfilterAdminConfig')-->class="on"<!--@end-->><a href="{getUrl('act','dispSpamfilterAdminConfig','module_srl','')}">{$lang->cmd_module_config}</a></li>
|
||||
<li <!--@if($act=='dispSpamfilterAdminDeniedIPList')-->class="on"<!--@end-->><a href="{getUrl('act','dispSpamfilterAdminDeniedIPList')}">{$lang->cmd_denied_ip}</a></li>
|
||||
<li <!--@if($act=='dispSpamfilterAdminDeniedWordList')-->class="on"<!--@end-->><a href="{getUrl('act','dispSpamfilterAdminDeniedWordList')}">{$lang->cmd_denied_word}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
36
modules/spamfilter/tpl/index.html
Normal file
36
modules/spamfilter/tpl/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<tr>
|
||||
<th scope="col">{$lang->interval}</th>
|
||||
<td class="left">
|
||||
<input type="text" name="interval" value="{$config->interval?$config->interval:60}" class="inputTypeText" /> {$lang->unit_sec}
|
||||
<p>{$lang->about_interval}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col">{$lang->limit_count}</th>
|
||||
<td class="left">
|
||||
<input type="text" name="limit_count" value="{$config->limit_count?$config->limit_count:5}" class="inputTypeText" />
|
||||
<p>{$lang->about_limit_count}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col">{$lang->check_trackback}</th>
|
||||
<td class="left">
|
||||
<input type="checkbox" name="check_trackback" value="Y" <!--@if($config->check_trackback=='Y')-->checked="checked"<!--@end--> />
|
||||
{$lang->about_check_trackback}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
17
modules/spamfilter/tpl/js/spamfilter_admin.js
Normal file
17
modules/spamfilter/tpl/js/spamfilter_admin.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* @brief 금지 IP 삭제
|
||||
**/
|
||||
function doDeleteDeniedIP(ipaddress) {
|
||||
var fo_obj = xGetElementById('fo_denied_ip');
|
||||
fo_obj.ipaddress.value = ipaddress;
|
||||
procFilter(fo_obj, delete_denied_ip);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 단어 삭제
|
||||
**/
|
||||
function doDeleteDeniedWord(word) {
|
||||
var fo_obj = xGetElementById('fo_denied_word');
|
||||
fo_obj.word.value = word;
|
||||
procFilter(fo_obj, delete_denied_word);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue