| 83 | | $ui= new FormUI(strtolower(get_class($this))); |
| 84 | | $ui->append('submit', 'save', _t( 'Save' )); |
| 85 | | $ui->out(); |
| | 85 | $form = new FormUI(strtolower(get_class($this))); |
| | 86 | $form->append('textarea', 'ipbl', 'dnsbl__ipbl', _t('IP Blacklists: ', 'dnsbl')); |
| | 87 | $form->append('submit', 'save', _t('Save')); |
| | 88 | $form->out(); |
| | 117 | $ipaddrs = explode('.', $comment->ip, 4); |
| | 118 | $reverse_ipaddr = join('.', array_reverse($ipaddrs)); |
| | 119 | |
| | 120 | $ipbls = Options::get('dnsbl__ipbl'); |
| | 121 | $ipbls = str_replace("\r", '', $ipbls); |
| | 122 | $ipbls = explode("\n", trim($ipbls)); |
| | 123 | |
| | 124 | $checks = array(); |
| | 125 | @reset($ipbls); |
| | 126 | while (list(, $ipbl) = @each($ipbls)) { |
| | 127 | $addr = gethostbyname($reverse_ipaddr . '.' . $ipbl); |
| | 128 | if ($addr == '127.0.0.2') { |
| | 129 | $checks[] = sprintf(_t('Flagged by DNSBL (%s)', 'dnsbl'), $ipbl); |
| | 130 | } |
| | 131 | } |
| | 132 | |
| | 133 | if (count($checks) > 0) { |
| | 134 | $comment->status = 'spam'; |
| | 135 | if (isset($comment->info->spamcheck)) { |
| | 136 | $comment->info->spamcheck = array_unique(array_merge($comment->info->spamcheck, $checks)); |
| | 137 | } else { |
| | 138 | $comment->info->spamcheck = $checks; |
| | 139 | } |
| | 140 | } |