1: <?php
2:
3:
4: define('PROTECTOR_HTTPBL_KEY', '............');
5:
6: 7: 8:
9: class Protector_postcommon_post_deny_by_httpbl extends ProtectorFilterAbstract
10: {
11: 12: 13:
14: public function execute()
15: {
16:
17: $rbls = array(
18: 'http:BL' => PROTECTOR_HTTPBL_KEY . '.%s.dnsbl.httpbl.org');
19:
20: global $xoopsUser;
21:
22: $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR'])));
23:
24:
25:
26: foreach ($rbls as $rbl_name => $rbl_fmt) {
27: $host = sprintf($rbl_fmt, $rev_ip);
28: if (gethostbyname($host) != $host) {
29: $this->protector->message .= "DENY by $rbl_name\n";
30: $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
31: $this->protector->output_log('RBL SPAM', $uid, false, 128);
32: die(_MD_PROTECTOR_DENYBYRBL);
33: }
34: }
35:
36: return true;
37: }
38: }
39: