1: | <?php
|
2: |
|
3: | |
4: | |
5: |
|
6: | class Protector_postcommon_post_deny_by_rbl extends ProtectorFilterAbstract
|
7: | {
|
8: | |
9: | |
10: |
|
11: | public function execute()
|
12: | {
|
13: |
|
14: | $rbls = array(
|
15: | 'sbl-xbl.spamhaus.org',
|
16: |
|
17: |
|
18: |
|
19: |
|
20: |
|
21: |
|
22: |
|
23: | );
|
24: |
|
25: | global $xoopsUser;
|
26: |
|
27: |
|
28: | $rev_ip = '';
|
29: |
|
30: | if (isset($_SERVER['REMOTE_ADDR'])) {
|
31: | $rev_ip = implode('.', array_reverse(explode('.', $_SERVER['REMOTE_ADDR'])));
|
32: | }
|
33: |
|
34: | foreach ($rbls as $rbl) {
|
35: | $host = $rev_ip . '.' . $rbl;
|
36: | if (gethostbyname($host) != $host) {
|
37: | $this->protector->message .= "DENY by $rbl\n";
|
38: | $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
|
39: | $this->protector->output_log('RBL SPAM', $uid, false, 128);
|
40: | die(_MD_PROTECTOR_DENYBYRBL);
|
41: | }
|
42: | }
|
43: |
|
44: | return true;
|
45: | }
|
46: | }
|
47: | |