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: |
|
23: | $rev_ip = '';
|
24: |
|
25: |
|
26: | if (isset($_SERVER['REMOTE_ADDR'])) {
|
27: | $rev_ip = implode('.', array_reverse(explode('.', $_SERVER['REMOTE_ADDR'])));
|
28: | }
|
29: |
|
30: |
|
31: |
|
32: | foreach ($rbls as $rbl_name => $rbl_fmt) {
|
33: | $host = sprintf($rbl_fmt, $rev_ip);
|
34: | if (gethostbyname($host) != $host) {
|
35: | $this->protector->message .= "DENY by $rbl_name\n";
|
36: | $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
|
37: | $this->protector->output_log('RBL SPAM', $uid, false, 128);
|
38: | die(_MD_PROTECTOR_DENYBYRBL);
|
39: | }
|
40: | }
|
41: |
|
42: | return true;
|
43: | }
|
44: | }
|
45: | |