22 $_SESSION[
'avoid_log'] =
true;
30 if($_SESSION[
'avoid_log'])
return new BaseObject();
42 $oFilterModel =
getModel(
'spamfilter');
44 $output = $oFilterModel->isDeniedIP();
50 $text =
$obj->title .
' ' .
$obj->content .
' ' .
$obj->tags;
54 $text =
$obj->title .
' ' .
$obj->content .
' ' .
$obj->nick_name .
' ' .
$obj->homepage .
' ' .
$obj->tags;
56 $output = $oFilterModel->isDeniedWord($text);
59 if(
$obj->document_srl == 0)
61 $output = $oFilterModel->checkLimited();
75 if($_SESSION[
'avoid_log'])
return new BaseObject();
87 $oFilterModel =
getModel(
'spamfilter');
89 $output = $oFilterModel->isDeniedIP();
95 $text =
$obj->content;
99 $text =
$obj->content .
' ' .
$obj->nick_name .
' ' .
$obj->homepage;
101 $output = $oFilterModel->isDeniedWord($text);
104 if(!
$obj->__isupdate)
106 $output = $oFilterModel->checkLimited();
109 unset(
$obj->__isupdate);
121 if($_SESSION[
'avoid_log'])
return new BaseObject();
123 $oFilterModel =
getModel(
'spamfilter');
125 $output = $oFilterModel->isInsertedTrackback(
$obj->document_srl);
129 $output = $oFilterModel->isDeniedIP();
132 $text =
$obj->blog_name .
' ' .
$obj->title .
' ' .
$obj->excerpt .
' ' .
$obj->url;
133 $output = $oFilterModel->isDeniedWord($text);
136 $oTrackbackModel =
getModel(
'trackback');
139 list($ipA,$ipB,$ipC,$ipD) = explode(
'.',$_SERVER[
'REMOTE_ADDR']);
140 $ipaddress = $ipA.
'.'.$ipB.
'.'.$ipC;
144 $oTrackbackController->deleteTrackbackSender(60*60*6, $ipaddress,
$obj->url,
$obj->blog_name,
$obj->title,
$obj->excerpt);
145 $this->
insertIP($ipaddress.
'.*',
'AUTO-DENIED : trackback.insertTrackback');
146 return new BaseObject(-1,
'msg_alert_trackback_denied');
165 function insertIP($ipaddress_list, $description = null)
167 $regExr =
"/^((\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?)*\s*$/";
168 if(!preg_match($regExr,$ipaddress_list))
return new BaseObject(-1,
'msg_invalid');
169 $ipaddress_list = str_replace(
"\r",
"",$ipaddress_list);
170 $ipaddress_list = explode(
"\n",$ipaddress_list);
171 foreach($ipaddress_list as $ipaddressValue)
173 $args =
new stdClass();
174 preg_match(
"/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?/",$ipaddressValue,$matches);
175 if($ipaddress=trim($matches[1]))
177 $args->ipaddress = $ipaddress;
178 if(!$description && $matches[4])
$args->description = $matches[4];
179 else $args->description = $description;
182 if(!
$output->toBool()) $fail_list .= $ipaddress.
'<br/>';
185 $output->add(
'fail_list',$fail_list);
194 if($_SESSION[
'avoid_log'])
return new BaseObject();
199 $oFilterModel =
getModel(
'spamfilter');
201 $output = $oFilterModel->isDeniedIP();
204 $text =
$obj->title .
' ' .
$obj->content;
205 $output = $oFilterModel->isDeniedWord($text);
208 $output = $oFilterModel->checkLimited(TRUE);
getController($module_name)
insertLog()
Log registration Register the newly accessed IP address in the log. In case the log interval is withi...
The parent class of the spamfilter module.
insertIP($ipaddress_list, $description=null)
IP registration The registered IP address is considered as a spammer.
triggerSendMessage(&$obj)
The routine process to check the time it takes to store a message, when writing it, and to ban IP/word.
triggerInsertTrackback(&$obj)
Inspect the trackback creation time and IP.
setAvoidLog()
Call this function in case you need to stop the spam filter's usage during the batch work...
The controller class for the spamfilter module.
triggerInsertDocument(&$obj)
The routine process to check the time it takes to store a document, when writing it, and to ban IP/word.
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
triggerInsertComment(&$obj)
The routine process to check the time it takes to store a comment, and to ban IP/word.