mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 04:39:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1208 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
43f5fe2356
commit
2be28490ce
12 changed files with 87 additions and 208 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterModel
|
||||
* @class counterModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 Model class
|
||||
* @brief counter 모듈의 Model class
|
||||
**/
|
||||
|
||||
class spamfilterModel extends spamfilter {
|
||||
class counterModel extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -14,60 +14,21 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸필터 모듈의 사용자 설정 값 return
|
||||
* @brief 로그 검사
|
||||
**/
|
||||
function getConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
return $oModuleModel->getModuleConfig('spamfilter');
|
||||
function isLogged() {
|
||||
$output = executeQuery('counter.getCounterLog');
|
||||
return $output->data->count?true:false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 등록된 금지 IP의 목록을 return
|
||||
* @brief 특정 일의 접속 통계를 가져옴
|
||||
**/
|
||||
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);
|
||||
function getStatus($regdate) {
|
||||
$args->regdate = $regdate;
|
||||
$output = executeQuery('counter.getCounterStatus', $args);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue