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