Cheetah
antispam.php
Go to the documentation of this file.
1 <?php
2 
8 require_once( '../inc/header.inc.php' );
9 require_once( CH_DIRECTORY_PATH_INC . 'design.inc.php' );
10 require_once( CH_DIRECTORY_PATH_INC . 'admin_design.inc.php' );
11 require_once( CH_DIRECTORY_PATH_INC . 'admin.inc.php' );
12 
13 ch_import('ChTemplSearchResult');
14 $oChWsbDNSBlacklists = ch_instance('ChWsbDNSBlacklists');
15 
17 {
18  function __construct ($aChains, $sDefaultMode)
19  {
20  $aCustomForm = array(
21 
22  'form_attrs' => array(
23  'id' => 'sys-adm-dnsbl-add',
24  'name' => 'sys-adm-dnsbl-add',
25  'action' => CH_WSB_URL_ADMIN . 'antispam.php?action=dnsbl_add&mode='.$sDefaultMode,
26  'method' => 'post',
27  ),
28 
29  'params' => array (
30  'db' => array(
31  'table' => 'sys_dnsbl_rules',
32  'key' => 'id',
33  'submit_name' => 'dnsbl_add',
34  ),
35  ),
36 
37  'inputs' => array(
38 
39  'chain' => array(
40  'type' => 'select',
41  'name' => 'chain',
42  'caption' => _t('_sys_adm_fld_dnsbl_chain'),
43  'values' => $aChains,
44  'value' => '',
45  'required' => true,
46  'checker' => array (
47  'func' => 'avail',
48  'error' => _t ('_sys_adm_form_err_required_field'),
49  ),
50  'db' => array (
51  'pass' => 'Xss',
52  ),
53  ),
54 
55  'zonedomain' => array(
56  'type' => 'text',
57  'name' => 'zonedomain',
58  'caption' => _t('_sys_adm_fld_dnsbl_zonedomain'),
59  'required' => true,
60  'checker' => array (
61  'func' => 'avail',
62  'error' => _t ('_sys_adm_form_err_required_field'),
63  ),
64  'db' => array (
65  'pass' => 'Xss',
66  ),
67  ),
68 
69  'postvresp' => array(
70  'type' => 'text',
71  'name' => 'postvresp',
72  'caption' => _t('_sys_adm_fld_dnsbl_postvresp'),
73  'required' => true,
74  'checker' => array (
75  'func' => 'avail',
76  'error' => _t ('_sys_adm_form_err_required_field'),
77  ),
78  'db' => array (
79  'pass' => 'Xss',
80  ),
81  ),
82 
83  'url' => array(
84  'type' => 'text',
85  'name' => 'url',
86  'caption' => _t('_sys_adm_fld_dnsbl_url'),
87  'db' => array (
88  'pass' => 'Xss',
89  ),
90  ),
91 
92  'recheck' => array(
93  'type' => 'text',
94  'name' => 'recheck',
95  'caption' => _t('_sys_adm_fld_dnsbl_recheck_url'),
96  'db' => array (
97  'pass' => 'Xss',
98  ),
99  ),
100 
101  'comment' => array(
102  'type' => 'text',
103  'name' => 'comment',
104  'caption' => _t('_sys_adm_fld_dnsbl_comment'),
105  'db' => array (
106  'pass' => 'Xss',
107  ),
108  ),
109 
110  'active' => array(
111  'type' => 'select',
112  'name' => 'active',
113  'caption' => _t('_sys_adm_fld_dnsbl_active'),
114  'values' => array (1 => _t('_Yes'), 0 => _t('_No')),
115  'value' => '1',
116  'db' => array (
117  'pass' => 'Int',
118  ),
119  ),
120 
121  'Submit' => array (
122  'type' => 'submit',
123  'name' => 'dnsbl_add',
124  'value' => _t('_Submit'),
125  'colspan' => true,
126  ),
127  ),
128  );
129 
130  parent::__construct ($aCustomForm);
131  }
132 }
133 
135 {
137  {
138  $aCustomForm = array(
139 
140  'form_attrs' => array(
141  'id' => 'sys-adm-dnsbl-recheck',
142  'name' => 'sys-adm-dnsbl-recheck',
143  'onsubmit' => "return bs_sys_adm_dbsbl_recheck($('#$sId').val());",
144  'method' => 'post',
145  ),
146 
147  'inputs' => array(
148 
149  'test' => array(
150  'type' => 'text',
151  'attrs' => array('id' => $sId),
152  'name' => $sId,
153  'caption' => $sTitle,
154  'required' => true,
155  ),
156 
157  'Submit' => array (
158  'type' => 'submit',
159  'name' => 'dnsbl_recheck',
160  'value' => _t('_Submit'),
161  'colspan' => true,
162  ),
163  ),
164  );
165 
166  parent::__construct ($aCustomForm);
167  }
168 }
169 
170 $logged['admin'] = member_auth( 1, true, true );
171 
172 $sGlMsg = '';
173 
174 // Process popups
175 if (isset($_GET['popup'])) {
176 
177  switch ($_GET['popup']) {
178 
179  case 'dnsbl_log':
180  $sPopupTitle = _t('_sys_adm_title_dnsbl_log');
181  $sPopupContent = PageCodeLog ('dnsbl');
182  break;
183 
184  case 'dnsbluri_log':
185  $sPopupTitle = _t('_sys_adm_title_dnsbluri_log');
186  $sPopupContent = PageCodeLog ('dnsbluri');
187  break;
188 
189  case 'akismet_log':
190  $sPopupTitle = _t('_sys_adm_title_akismet_log');
191  $sPopupContent = PageCodeLog ('akismet');
192  break;
193 
194  case 'stopforumspam_log':
195  $sPopupTitle = _t('_sys_adm_title_stopforumspam_log');
196  $sPopupContent = PageCodeLog ('stopforumspam');
197  break;
198 
199  case 'botdetection_log':
200  $sPopupTitle = _t('_sys_adm_title_botdetection_log');
201  $sPopupContent = PageCodeLog ('botdetection');
202  break;
203 
204  case 'dnsbl_recheck':
205  $sPopupTitle = _t('_sys_adm_title_dnsbl_recheck');
207  $sPopupContent = PageCodeRecheckPopup ($aChains, _t('_sys_adm_fld_dnsbl_recheck'), 'sys-adm-dnsbl-test', 'dnsbl-recheck-ip');
208  break;
209 
210  case 'dnsbluri_recheck':
211  $sPopupTitle = _t('_sys_adm_title_dnsbluri_recheck');
212  $aChains = array(CH_WSB_DNSBL_CHAIN_URIDNS);
213  $sPopupContent = PageCodeRecheckPopup ($aChains, _t('_sys_adm_fld_dnsbluri_recheck'), 'sys-adm-dnsbl-test', 'dnsbl-recheck-uri');
214  break;
215 
216  case 'dnsbl_help':
217  $sPopupTitle = _t('_sys_adm_btn_dnsbl_help');
218  $sPopupContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_dnsbl_help.html', array('text' => _t('_sys_adm_btn_dnsbl_help_text')));
219  break;
220  case 'dnsbluri_help':
221  $sPopupTitle = _t('_sys_adm_btn_dnsbl_help');
222  $sPopupContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_dnsbl_help.html', array('text' => _t('_sys_adm_btn_dnsbluri_help_text')));
223  break;
224  case 'dnsbl_add':
225  $sPopupTitle = _t('_sys_adm_btn_dnsbl_add');
226  $oForm = new ChWsbAdmFormDnsblAdd(array ('spammers' => 'spammers', 'whitelist' => 'whitelist'), 'dnsbl');
227  $sPopupContent = $oForm->getCode();
228  break;
229  case 'dnsbluri_add':
230  $sPopupTitle = _t('_sys_adm_btn_dnsbl_add');
231  $oForm = new ChWsbAdmFormDnsblAdd(array ('uridns' => 'uridns'), 'dnsbluri');
232  $sPopupContent = $oForm->getCode();
233  break;
234  }
235 
236  $sPopupContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array(
237  'content' => $sPopupContent
238  ));
239 
240  header("Content-type: text/html; charset=utf-8");
241  echo $GLOBALS['oFunctions']->popupBox('adm_antispam_popup', $sPopupTitle, $sPopupContent);
242  exit;
243 }
244 
245 // Process actions
246 switch (true) {
247 
248  case (isset($_GET['action']) && $_GET['action'] == 'log' && isset($_GET['type'])):
249  header("Content-type: text/html; charset=utf-8");
250  echo PageCodeLog ($_GET['type']);
251  exit;
252 
253  case (isset($_POST['action']) && isset($_POST['id']) && isset($_POST['test'])):
254 
255  $o = ch_instance('ChWsbDNSBlacklists');
256  $aChain = $GLOBALS['MySQL']->getAll("SELECT `zonedomain`, `postvresp` FROM `sys_dnsbl_rules` WHERE `id` = ? AND `active` = 1", [$_POST['id']]);
257 
258  $iRet = CH_WSB_DNSBL_FAILURE;
259  if ($aChain) {
260  if ($_POST['action'] == 'dnsbl-recheck-ip') {
261  $iRet = $o->dnsbl_lookup_ip($aChain, $_POST['test']);
262  } elseif ($_POST['action'] == 'dnsbl-recheck-uri') {
263  $sUrl = preg_replace('/^\w+:\/\//', '', $_POST['test']);
264  $sUrl = preg_replace('/^www\./', '', $sUrl);
265  $oChWsbDNSURIBlacklists = ch_instance('ChWsbDNSURIBlacklists');
266  $aUrls = $oChWsbDNSURIBlacklists->validateUrls(array($sUrl));
267  if ($aUrls)
268  $iRet = $o->dnsbl_lookup_uri($aUrls[0], $aChain);
269  }
270  }
271 
272  switch ($iRet) {
274  echo 'LISTED';
275  exit;
277  echo 'NOT LISTED';
278  exit;
279  default:
281  echo 'FAIL';
282  exit;
283  }
284 
285  case (isset($_POST['adm-dnsbl-activate'])):
286  foreach($_POST['rules'] as $iRuleId)
287  db_res("UPDATE `sys_dnsbl_rules` SET `active` = 1 WHERE `id` = " . (int)$iRuleId);
288  $oChWsbDNSBlacklists->clearCache();
289  break;
290 
291  case (isset($_POST['adm-dnsbl-deactivate'])):
292  foreach($_POST['rules'] as $iRuleId)
293  db_res("UPDATE `sys_dnsbl_rules` SET `active` = 0 WHERE `id` = " . (int)$iRuleId);
294  $oChWsbDNSBlacklists->clearCache();
295  break;
296 
297  case (isset($_POST['adm-dnsbl-delete'])):
298  foreach($_POST['rules'] as $iRuleId)
299  db_res("DELETE FROM `sys_dnsbl_rules` WHERE `id` = " . (int)$iRuleId);
300  $oChWsbDNSBlacklists->clearCache();
301  break;
302 
303  case (isset($_GET['action']) && 'dnsbl_add' == $_GET['action'] && $_POST['dnsbl_add']):
304  $oForm = new ChWsbAdmFormDnsblAdd (array(), ch_get('mode'));
305  $oForm->initChecker();
306  if ($oForm->isSubmittedAndValid () && $oForm->insert (array('added' => time())))
307  $sGlMsg = MsgBox(_t('_sys_sucess_result'));
308  else
309  $sGlMsg = MsgBox(_t('_Error Occured'));
310  $oChWsbDNSBlacklists->clearCache();
311  break;
312 }
313 
314 $aPages = array (
315  'dnsbl' => array (
316  'option' => 'sys_dnsbl_enable',
317  'title' => _t('_sys_adm_page_cpt_dnsbl'),
318  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=dnsbl',
319  'func' => 'PageCodeDNSBL',
320  'func_params' => array(array(CH_WSB_DNSBL_CHAIN_SPAMMERS, CH_WSB_DNSBL_CHAIN_WHITELIST), 'dnsbl'),
321  ),
322  'dnsbluri' => array (
323  'option' => 'sys_uridnsbl_enable',
324  'title' => _t('_sys_adm_page_cpt_uridnsbl'),
325  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=dnsbluri',
326  'func' => 'PageCodeDNSBL',
327  'func_params' => array(array(CH_WSB_DNSBL_CHAIN_URIDNS), 'dnsbluri'),
328  ),
329  'akismet' => array (
330  'option' => 'sys_akismet_enable',
331  'title' => _t('_sys_adm_page_cpt_akismet'),
332  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=akismet',
333  'func' => 'PageCodeAkismet',
334  'func_params' => array('akismet'),
335  ),
336  'stopforumspam' => array (
337  'option' => 'sys_stopforumspam_enable',
338  'title' => _t('_sys_adm_page_cpt_stopforumspam'),
339  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=stopforumspam',
340  'func' => 'PageCodeStopForumSpam',
341  'func_params' => array('stopforumspam'),
342  ),
343  'botdetection' => array (
344  'option' => 'sys_antispam_bot_check',
345  'title' => _t('_sys_adm_page_cpt_botdetection'),
346  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=botdetection',
347  'func' => 'PageCodeBotDetection',
348  'func_params' => array('botdetection'),
349  ),
350  'settings' => array (
351  'option' => '',
352  'title' => _t('_Settings'),
353  'url' => CH_WSB_URL_ADMIN . 'antispam.php?mode=settings',
354  'func' => 'PageCodeSettings',
355  'func_params' => array(),
356  ),
357 );
358 
359 if (!isset($_GET['mode']) || !isset($aPages[$_GET['mode']]))
360  $sMode = 'dnsbl';
361 else
362  $sMode = $_GET['mode'];
363 
365 
366 $aTopItems = array();
367 foreach ($aPages as $k => $r)
368  $aTopItems['dbmenu_' . $k] = array(
369  'href' => $r['url'],
370  'title' => $r['title'],
371  'active' => $k == $sMode ? 1 : 0
372  );
373 
375 $_page_cont[$iNameIndex]['page_main_code'] = call_user_func($aPages[$sMode]['func'], $aPages[$sMode]['func_params'][0], $aPages[$sMode]['func_params'][1]);
376 
377 $_page = array(
378  'name_index' => $iNameIndex,
379  'header' => $sPageTitle,
380  'header_text' => $sPageTitle,
381  'css_name' => array('forms_adv.css', 'antispam.css'),
382 );
383 
384 PageCodeAdmin();
385 
386 function PageCodeDNSBL($aChains, $sMode)
387 {
388  global $aPages;
389 
390  $sControls = ChTemplSearchResult::showAdminActionsPanel('adm-dnsbl-form', array(
391  'adm-dnsbl-delete' => _t('_sys_adm_btn_dnsbl_delete'),
392  'adm-dnsbl-activate' => _t('_sys_adm_btn_dnsbl_activate'),
393  'adm-dnsbl-deactivate' => _t('_sys_adm_btn_dnsbl_deactivate'),
394  ), 'rules');
395 
396  $sPlaceholders = implode(',', array_fill(0, count($aChains), '?'));
397  $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN($sPlaceholders) ORDER BY `chain`, `added` ", $aChains);
398  foreach ($aRules as $k => $r) {
399  $aRules[$k]['comment'] = ch_html_attribute ($r['comment']);
400  }
401 
402  $bMode = getParam($aPages[$sMode]['option']) == 'on';
403  $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl_top_controls.html', array(
404  'status' => $bMode ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'),
405  'status_class' => 'sys-adm-' . ($bMode ? 'enabled' : 'disabled'),
406  'mode' => $sMode,
407  ));
408 
409  if (is_array($aRules) && !empty($aRules)) {
410  $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl.html', array(
411  'top_controls' => $sTopControls,
412  'ch_repeat:items' => $aRules,
413  'controls' => $sControls,
414  'global_message' => $GLOBALS['sGlMsg'],
415  'mode' => $sMode
416  ));
417  } else {
418  $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl.html', array(
419  'top_controls' => $sTopControls,
420  'ch_repeat:items' => array(),
421  'controls' => '',
422  'global_message' => MsgBox(_t('_Empty')),
423  'mode' => $sMode
424  ));
425  }
426 
427  return DesignBoxAdmin ($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems']);
428 }
429 
431 {
432  global $aPages;
433 
434  $sKeyStatusClass = '';
435  $sKeyStatus = _t('_sys_adm_akismet_key_empty');
436  if (getParam('sys_akismet_api_key')) {
437 
438  $oChWsbAkismet = ch_instance('ChWsbAkismet');
439  if ($oChWsbAkismet->oAkismet->isKeyValid()) {
440  $sKeyStatusClass = 'sys-adm-enabled';
441  $sKeyStatus = _t('_sys_adm_akismet_key_valid');
442  } else {
443  $sKeyStatusClass = 'sys-adm-disabled';
444  $sKeyStatus = _t('_sys_adm_akismet_key_invalid');
445  }
446  }
447 
448  $bMode = getParam($aPages[$sMode]['option']) == 'on';
449  $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_akismet_top_controls.html', array(
450  'status' => $bMode ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'),
451  'status_class' => 'sys-adm-' . ($bMode ? 'enabled' : 'disabled')
452  ));
453 
454  $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_akismet.html', array(
455  'top_controls' => $sTopControls,
456  'key_status' => $sKeyStatus,
457  'key_status_class' => $sKeyStatusClass,
458  ));
459 
460  return DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems']);
461 }
462 
464 {
465  global $aPages;
466 
467  $sKeyStatusClass = '';
468  $sKeyStatus = _t('_sys_adm_stopforumspam_key_empty');
469  if (getParam('sys_stopforumspam_api_key')) {
470  $sKeyStatusClass = 'sys-adm-enabled';
471  $sKeyStatus = _t('_sys_adm_stopforumspam_key_specified');
472  }
473 
474  $bMode = getParam($aPages[$sMode]['option']) == 'on';
475  $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_stopforumspam_top_controls.html', array(
476  'status' => $bMode ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'),
477  'status_class' => 'sys-adm-' . ($bMode ? 'enabled' : 'disabled')
478  ));
479 
480  $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_akismet.html', array(
481  'top_controls' => $sTopControls,
482  'key_status' => $sKeyStatus,
483  'key_status_class' => $sKeyStatusClass,
484  ));
485 
486  return DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems']);
487 }
488 
490 {
491  global $aPages;
492 
493  $bMode = getParam($aPages[$sMode]['option']) == 'on';
494  $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_botdetection_top_controls.html', array(
495  'status' => $bMode ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'),
496  'status_class' => 'sys-adm-' . ($bMode ? 'enabled' : 'disabled')
497  ));
498 
499  if($bMode) {
500  $iY = (int)date('Y'); // Year
501  $iM = (int)date('m'); // Month
502  $iD = (int)date('d'); // Day
503  $iN = (int)date('N'); // Day of week.
504  if($iN == 7) $iN = 0; // 7 is sunday. Change 7 to 0 so week starts on sunday instead of monday.
505  $sT = date('Y-m-d'); // Todays full date.
506  $iTimeD = strtotime($sT . 'midnight'); // Time at midnight today.
507  $iTimeW = strtotime($sT . '- ' . $iN . ' day midnight'); // Time at midnight on sunday of this week.
508  $iTimeM = strtotime($iY . '-' . $iM . '-1 midnight'); // Time at midnight on first day of this month.
509 
510  $iToday = $GLOBALS['MySQL']->getOne("SELECT COUNT(`ip`) FROM `sys_antispam_block_log` WHERE `type` = 'botdetection' AND `added` > '$iTimeD'");
511  $iWeek = $GLOBALS['MySQL']->getOne("SELECT COUNT(`ip`) FROM `sys_antispam_block_log` WHERE `type` = 'botdetection' AND `added` > '$iTimeW'");
512  $iMonth = $GLOBALS['MySQL']->getOne("SELECT COUNT(`ip`) FROM `sys_antispam_block_log` WHERE `type` = 'botdetection' AND `added` > '$iTimeM'");
513  }
514 
515  $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_botdetection.html', array(
516  'top_controls' => $sTopControls,
517  'key_status' => $sKeyStatus,
518  'key_status_class' => $sKeyStatusClass,
519  'ch_if:botdetection' => array(
520  'condition' => $bMode,
521  'content' => array (
522  'blocked_today' => $iToday,
523  'blocked_week' => $iWeek,
524  'blocked_month' => $iMonth,
525  ),
526  ),
527  ));
528 
529  return DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems']);
530 }
531 
532 function PageCodeRecheckPopup ($aChains, $sFieldTitle, $sId, $sAction)
533 {
534  $sPlaceholders = implode(',', array_fill(0, count($aChains), '?'));
535  $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN($sPlaceholders) AND `active` = 1 ORDER BY `chain`, `added` ", $aChains);
536  $oForm = new ChWsbAdmFormDnsblRecheck($sFieldTitle, $sId);
537  return $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_dnsbl_recheck.html', array(
538  'txt_listed' => ch_js_string(_t('_sys_adm_dnsbl_listed')),
539  'txt_not_listed' => ch_js_string(_t('_sys_adm_dnsbl_not_listed')),
540  'txt_failed' => ch_js_string(_t('_sys_adm_dnsbl_failed')),
541  'form' => $oForm->getCode(),
542  'action' => $sAction,
543  'admin_url' => CH_WSB_URL_ADMIN,
544  'ch_repeat:items' => $aRules,
545  ));
546 }
547 
548 function PageCodeLog ($sMode)
549 {
550  switch ($sMode) {
551  case 'dnsbl':
552  case 'dnsbluri':
553  case 'akismet':
554  case 'stopforumspam':
555  case 'botdetection':
556  break;
557  default:
558  $sMode = 'dnsbl';
559  }
560 
561  $iPage = isset($_GET['page']) && (int)$_GET['page'] > 0 ? (int)$_GET['page'] : 1;
562  $iPerPage = 12;
563  $iStart = ($iPage-1) * $iPerPage;
564 
565  $aLog = $GLOBALS['MySQL']->getAll("SELECT SQL_CALC_FOUND_ROWS * FROM `sys_antispam_block_log` WHERE `type` = ? ORDER BY `added` DESC LIMIT $iStart, $iPerPage", [$sMode]);
566  $iCount = $GLOBALS['MySQL']->getOne("SELECT FOUND_ROWS()");
567  foreach ($aLog as $k => $r) {
568  $aLog[$k]['ip'] = long2ip ($r['ip']);
569  $aLog[$k]['member_url'] = $r['member_id'] ? getProfileLink($r['member_id']) : 'javascript:void(0);';
570  $aLog[$k]['member_nickname'] = $r['member_id'] ? getNickName($r['member_id']) : _t('_Guest');
571  $aLog[$k]['extra'] = ch_html_attribute ($r['extra']);
572  $aLog[$k]['ago'] = defineTimeInterval ($r['added']);
573  }
574 
575  $sPaginate = '';
576  if ($iCount > $iPerPage) {
577  $sUrlStart = CH_WSB_URL_ADMIN . 'antispam.php?action=log&type='.$sMode;
578  $oPaginate = new ChWsbPaginate(array(
579  'page_url' => 'javascript:void(0);',
580  'count' => $iCount,
581  'per_page' => $iPerPage,
582  'page' => $iPage,
583  'on_change_page' => "getHtmlData('sys-adm-antispam-log', '{$sUrlStart}&page={page}');",
584  ));
585 
586  $sPaginate = $oPaginate->getSimplePaginate(false, -1, -1, false);
587  }
588 
589  if (is_array($aLog) && !empty($aLog)) {
590  return $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_log.html', array(
591  'ch_repeat:items' => $aLog,
592  'paginate' => $sPaginate,
593  ));
594  } else {
595  return MsgBox(_t('_Empty'));
596  }
597 }
598 
600 {
601  global $aPages;
602 
603  ch_import('ChWsbAdminSettings');
604  $oSettings = new ChWsbAdminSettings(23);
605 
606  $sResults = false;
607  if (isset($_POST['save']) && isset($_POST['cat']))
608  $sResult = $oSettings->saveChanges($_POST);
609 
610  $s = $oSettings->getForm();
611  if ($sResult)
612  $s = $sResult . $s;
613 
614  return DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems'], '', 11);
615 }
CH_WSB_DNSBL_CHAIN_WHITELIST
const CH_WSB_DNSBL_CHAIN_WHITELIST
Definition: ChWsbDNSBlacklists.php:20
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
$oSettings
$oSettings
Definition: advanced_settings.php:20
CH_WSB_DNSBL_POSITIVE
const CH_WSB_DNSBL_POSITIVE
Definition: ChWsbDNSBlacklists.php:9
ChTemplFormView
Definition: ChTemplFormView.php:11
$oChWsbDNSBlacklists
$oChWsbDNSBlacklists
Definition: antispam.php:14
$sMode
else $sMode
Definition: antispam.php:362
$sPageTitle
$sPageTitle
Definition: antispam.php:374
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
ChWsbAdmFormDnsblAdd\__construct
__construct($aChains, $sDefaultMode)
Definition: antispam.php:18
$sGlMsg
$sGlMsg
Definition: antispam.php:172
ch_js_string
ch_js_string($mixedInput, $iQuoteType=CH_ESCAPE_STR_AUTO)
Definition: utils.inc.php:1294
defineTimeInterval
defineTimeInterval($iTime, $bAutoDateConvert=true, $bShort=false)
Definition: utils.inc.php:831
$sResult
$sResult
Definition: advanced_settings.php:26
PageCodeSettings
PageCodeSettings()
Definition: antispam.php:599
PageCodeBotDetection
PageCodeBotDetection($sMode)
Definition: antispam.php:489
$_page_cont
$_page_cont[$iNameIndex]['page_main_code']
Definition: antispam.php:375
$iNameIndex
$iNameIndex
Definition: antispam.php:364
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ch_get
ch_get($sName)
Definition: utils.inc.php:1664
$sUrl
$sUrl
Definition: cart.php:15
php
ChWsbAdmFormDnsblRecheck
Definition: antispam.php:135
ChWsbAdmFormDnsblAdd
Definition: antispam.php:17
$aPages
if(isset($_GET['popup'])) switch(true) $aPages
Definition: antispam.php:314
$iPerPage
else $iPerPage
Definition: browse.php:61
ch_html_attribute
ch_html_attribute($mixedInput)
Definition: utils.inc.php:1324
$oForm
$oForm
Definition: host_tools.php:42
DesignBoxAdmin
DesignBoxAdmin($sTitle, $sContent, $mixedTopItems='', $sBottomItems='', $iIndex=1)
Definition: admin_design.inc.php:50
exit
exit
Definition: cart.php:21
$aTopItems
$aTopItems
Definition: antispam.php:366
$_GET
$_GET['debug']
Definition: index.php:67
PageCodeLog
PageCodeLog($sMode)
Definition: antispam.php:548
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
CH_WSB_DNSBL_CHAIN_SPAMMERS
const CH_WSB_DNSBL_CHAIN_SPAMMERS
Definition: ChWsbDNSBlacklists.php:19
$sTitle
$sTitle
Definition: actions.inc.php:13
getNickName
getNickName( $ID='')
Definition: profiles.inc.php:461
CH_WSB_DNSBL_NEGATIVE
const CH_WSB_DNSBL_NEGATIVE
Definition: ChWsbDNSBlacklists.php:8
ch_instance
ch_instance($sClassName, $aParams=array(), $aModule=array())
Definition: utils.inc.php:1264
ChWsbPaginate
Definition: ChWsbPaginate.php:69
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
PageCodeAdmin
PageCodeAdmin($oTemplate=null)
Definition: admin_design.inc.php:45
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
member_auth
member_auth($member=0, $error_handle=true, $bAjx=false)
Definition: admin.inc.php:262
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
PageCodeRecheckPopup
PageCodeRecheckPopup($aChains, $sFieldTitle, $sId, $sAction)
Definition: antispam.php:532
$_page
$_page
Definition: antispam.php:377
ChWsbAdminSettings
Definition: ChWsbAdminSettings.php:35
PageCodeAkismet
PageCodeAkismet($sMode)
Definition: antispam.php:430
CH_WSB_DNSBL_CHAIN_URIDNS
const CH_WSB_DNSBL_CHAIN_URIDNS
Definition: ChWsbDNSBlacklists.php:21
$s
$s
Definition: embed.php:13
$iPage
$iPage
Definition: browse.php:50
db_res
db_res($query, $bindings=[])
Definition: db.inc.php:39
PageCodeStopForumSpam
PageCodeStopForumSpam($sMode)
Definition: antispam.php:463
$sId
$sId
Definition: actions.inc.php:8
ChBaseSearchResult\showAdminActionsPanel
static showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName='entry', $bSelectAll=true, $bSelectAllChecked=false, $sCustomHtml='')
Definition: ChBaseSearchResult.php:81
CH_WSB_DNSBL_FAILURE
const CH_WSB_DNSBL_FAILURE
Definition: ChWsbDNSBlacklists.php:10
$sAction
$sAction
Definition: categories.php:274
$logged
$logged['admin']
Definition: antispam.php:170
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChWsbAdmFormDnsblRecheck\__construct
__construct($sTitle, $sId)
Definition: antispam.php:136
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
PageCodeDNSBL
PageCodeDNSBL($aChains, $sMode)
Definition: antispam.php:386