public static function onActionLegacy($core, dcCommentsActionsPage $as, $Comment) { $core->callBehavior('adminCommentsActions', $core, $as->getRS(), $as->getAction(), $as->getRedirection()); $as->beginPage('', dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . dcPage::jsMetaEditor() . $core->callBehavior('adminCommentsActionsHeaders'), ''); ob_start(); $core->callBehavior('adminCommentsActionsContent', $core, $as->getAction(), $as->getHiddenFields(true)); $res = ob_get_contents(); ob_end_clean(); $res = str_replace("comments_actions.php", $as->getURI(), $res); echo $res; $as->endPage(); }
public static function doBlacklistIP($core, dcCommentsActionsPage $ap, $post) { $action = $ap->getAction(); $co_ids = $ap->getIDs(); if (empty($co_ids)) { throw new Exception(__('No comment selected')); } $global = !empty($action) && $action == 'blacklist_global' && $core->auth->isSuperAdmin(); $ip_filter = new dcFilterIP($core); $rs = $ap->getRS(); while ($rs->fetch()) { $ip_filter->addIP('black', $rs->comment_ip, $global); } dcPage::addSuccessNotice(__('IP addresses for selected comments have been blacklisted.')); $ap->redirect(true); }