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

This commit is contained in:
zero 2007-03-05 10:05:53 +00:00
parent d0aeb583ec
commit eaadbea932
10 changed files with 134 additions and 14 deletions

View file

@ -37,7 +37,7 @@
$addon = trim($addon_list[$i]);
if(!$addon) continue;
$buff .= sprintf(' include("./files/addons/%s/%s.addon.php"); ', $addon, $addon);
$buff .= sprintf(' include("./addons/%s/%s.addon.php"); ', $addon, $addon);
}
$buff = sprintf('<?if(!__ZB5__)exit(); %s ?>', $buff);

View file

@ -44,10 +44,10 @@
</tr>
<tr>
<td colspan="2">
{$lang->document_url} : {getUrl()}?document_srl={$document->document_srl}
{$lang->document_url} : {getUrl()}{$document->document_srl}
<!--@if($document->allow_trackback=='Y')-->
<br />
{$lang->trackback_url} : {getUrl()}trackback.php?document_srl={$document->document_srl}
{$lang->trackback_url} : {getUrl()}trackback/{$document->document_srl}
<!--@end-->
</td>
</tr>

View file

@ -12,13 +12,17 @@
// 일반 단어
$lang->denied_ip = "금지 IP";
$lang->interval = "스팸 처리 간격";
$lang->limit_count = "제한수";
$lang->word = "단어";
// 설명문
$lang->about_interval = "지정된 시간내에 다시 글이 등록이 되면 스팸으로 간주가 됩니다";
$lang->about_limit_count = "지정된 시간내에 제한수를 넘겨서 글 작성을 시도하면 스팸으로 인식, IP를 금지 시킵니다";
$lang->about_denied_ip = "127.0.0.* 와 같이 * 로 정해진 패턴의 IP 대역을 모두 금지 시킬 수 있습니다";
$lang->about_denied_word = "금지 단어로 등록되면 해당 단어가 있는 글은 등록을 금지 시킬 수 있습니다";
// 메세지 출력용
$lang->msg_alert_registered_spamer = '스패머로 등록되셨습니다';
$lang->msg_alert_limited_by_config = '%s 초 이내에 글 작성은 금지 됩니다. 계속 시도하시면 금지 IP에 등록되실 수 있습니다';
$lang->msg_alert_denied_word = '"%s"는 사용 금지된 단어입니다';
$lang->msg_alert_registered_denied_ip = '금지 IP에 등록되셔서 정상적인 활동에 제한을 받게 되셨습니다. 문의는 사이트 관리자에게 해주시기 바랍니다';
?>

View 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>

View file

@ -1,5 +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="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>

View file

@ -18,7 +18,7 @@
**/
function procInsertConfig() {
// 기본 정보를 받음
$args = Context::gets('interval');
$args = Context::gets('interval','limit_count');
// module Controller 객체 생성하여 입력
$oModuleController = &getController('module');
@ -110,11 +110,9 @@
* 스패머로 등록할 있음
**/
function insertLog() {
$ipaddress = $_SERVER['REMOTE_ADDR'];
$oDB = &DB::getInstance();
$args->word = $word;
return $oDB->executeQuery('spamfilter.insertLog', $args);
$output = $oDB->executeQuery('spamfilter.insertLog');
return $output;
}
}

View file

@ -13,6 +13,15 @@
function init() {
}
/**
* @brief 스팸필터 모듈의 사용자 설정 return
**/
function getConfig() {
// 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel = &getModel('module');
return $oModuleModel->getModuleConfig('spamfilter');
}
/**
* @brief 등록된 금지 IP의 목록을 return
**/
@ -26,13 +35,23 @@
return $output->data;
}
/**
* @brief 인자로 넘겨진 ipaddress가 금지 ip인지 체크하여 return
**/
function isDeniedIP($ipaddress) {
$oDB = &DB::getInstance();
$args->ipaddress = $ipaddress;
$output = $oDB->executeQuery('spamfilter.isDeniedIP', $args);
if($output->data->count>0) return true;
return false;
}
/**
* @brief 등록된 금지 Word 목록을 return
**/
function getDeniedWordList() {
$oDB = &DB::getInstance();
$args->sort_index = "regdate";
$args->page = Context::get('page')?Context::get('page'):1;
$output = $oDB->executeQuery('spamfilter.getDeniedWordList', $args);
if(!$output->data) return;
if(!is_array($output->data)) return array($output->data);
@ -42,13 +61,13 @@
/**
* @brief 지정된 IPaddress의 특정 시간대 내의 로그 수를 return
**/
function getLogCount($time = 3600, $ipaddress='') {
function getLogCount($time = 60, $ipaddress='') {
if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR'];
$oDB = &DB::getInstance();
$args->ipaddress = $ipaddress;
$args->regdate = date("YmdHis", time()-$time);
$output = $oDB->executeQuery('spamfilter.getLogCount');
$output = $oDB->executeQuery('spamfilter.getLogCount', $args);
$count = $output->data->count;
return $count;
}

View file

@ -10,6 +10,13 @@
<tr>
<td>{$lang->about_interval}</td>
</tr>
<tr>
<th rowspan="2">{$lang->limit_count}</th>
<td><input type="text" name="limit_count" value="{$config->limit_count?$config->limit_count:5}" /></td>
</tr>
<tr>
<td>{$lang->about_limit_count}</td>
</tr>
<tr>
<td colspan="2">
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{@getUrl('act','')}'" />