function options_anti_spam_html($additional_msg) { global $pixelpost_db_prefix, $admin_lang_spam_ban, $admin_lang_spam_content; global $admin_lang_spam_modlist, $admin_lang_spam_blacklist, $admin_lang_spam_reflist; global $admin_lang_spam_blacklist_text, $admin_lang_spam_htaccess_text, $admin_lang_spam_check_comm; global $admin_lang_spam_del_bad_comm, $admin_lang_spam_del_bad_ref, $admin_lang_spam_updateblacklist; $mod_list = get_moderation_banlist(); $black_list = get_blacklist(); $ref_list = get_ref_ban_list(); $query = "SELECT `acceptable_num_links` FROM `{$pixelpost_db_prefix}banlist` LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); if ($row = mysql_fetch_row($result)) { $acceptable_num_links = $row[0]; } // htaccess stuff $htaccess = create_htaccess_banlist(); $html = <<<EOE \t<div class="jcaption">{$admin_lang_spam_ban}</div> \t \t<div class="content"> \t\t{$admin_lang_spam_content} \t\t<br /><br /> \t\t \t\t<!-- <form method="post" action="{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}#banlist"> --> \t\t \t\t\t<table id="banlist" name="banlist" summary="Banlists"> \t\t\t\t<tr > \t\t\t\t\t<td style="padding-right:5px;"> \t\t\t\t\t\t<strong>{$admin_lang_spam_modlist}</strong> \t\t\t\t\t\t<br /> \t\t\t\t\t\t \t\t\t\t\t\t<textarea name="moderation_list" class="banlists" style="width:200px;height:100px;" rows="" cols="">{$mod_list}</textarea> \t\t\t\t\t\t<br /> \t\t\t\t\t \t\t\t\t\t\t<a href="index.php?view=options&advancedview=antispam&antispamaction=moderation">{$admin_lang_spam_check_comm}</a> \t\t\t\t\t</td> \t\t\t\t\t<td style="padding-right:5px;"> \t\t\t\t\t\t<strong>{$admin_lang_spam_blacklist}</strong> \t\t\t\t\t\t<br /> \t\t\t\t\t\t \t\t\t\t\t\t<textarea name="blacklist" class="banlists" style="width:200px;height:100px;" rows="" cols="">{$black_list}</textarea> \t\t\t\t\t\t<br /> \t\t\t\t\t\t \t\t\t\t\t\t<a href="index.php?view=options&advancedview=antispam&antispamaction=deletecmnt">{$admin_lang_spam_del_bad_comm}</a> \t\t\t\t\t</td> \t\t\t\t\t<td style="padding-right:5px;"> \t\t\t\t\t\t<strong>{$admin_lang_spam_reflist} </strong> \t\t\t\t\t\t<br /> \t\t\t\t\t\t \t\t\t\t\t\t<textarea name="ref_ban_list" class="banlists" style="width:200px;height:100px;" rows="" cols="">{$ref_list}</textarea> \t\t\t\t\t\t<br /> \t\t\t\t\t\t \t\t\t\t\t\t<a href="index.php?view=options&advancedview=antispam&antispamaction=deleterefs" >{$admin_lang_spam_del_bad_ref}</a> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t</table > \t\t\t \t\t\t<input type="hidden" name="banlistupdate" value="1" /> \t\t\t<!-- \t\t\t<input type="submit" value="{$admin_lang_spam_updateblacklist}" /> \t\t\t \t\t</form> \t\t--> \t\t \t\t{$additional_msg} EOE; if (isset($_POST['banlistupdate'])) { $html .= <<<EOE \t\t\t<div id="htaccess-deny" > \t\t\t\t{$admin_lang_spam_blacklist_text} \t\t\t\t<textarea name="htaccess-deny-list" style="width:600px;height:200px;" >{$htaccess}</textarea> \t\t\t</div> EOE; } else { $html .= <<<EOE \t\t\t<br /><br /> \t\t\t \t\t\t<a href="#" onclick="flip('htaccess-deny'); return false;"><i>{$admin_lang_spam_htaccess_text}</i></a> \t\t\t<br /><br /> \t\t\t \t\t\t<div id="htaccess-deny" > \t\t\t\t<script type="text/javascript">flip('htaccess-deny');</script> \t\t\t\t{$admin_lang_spam_blacklist_text} \t\t\t\t<textarea name="htaccess-deny-list" style="width:600px;height:200px;" rows="" cols="">{$htaccess}</textarea> \t\t\t</div> EOE; } $html .= ' </div> <!-- end of content-->'; return $html; }
$c = count($idz); echo "<div class='jcaption confirm'>{$admin_lang_cmnt_delete1} {$c} {$admin_lang_cmnt_delete2}</div>"; } // Mass SPAM-delete comments if (isset($_GET['action']) and $_GET['action'] == "spamdelete" && isset($_POST['moderate_commnts_boxes'])) { $idz = $_POST['moderate_commnts_boxes']; foreach ($idz as $id) { $where[] = "id='" . (int) $id . "'"; } $where = implode(" OR ", $where); $query = "SELECT DISTINCT ip FROM " . $pixelpost_db_prefix . "comments WHERE {$where}"; // echo $query; $query = mysql_query($query); $row = mysql_fetch_row($query); // update the blaklist ips $blacklist = get_blacklist(); if (count($blacklist) > 2 && $blacklist[count($blacklist) - 1] != "n" && $blacklist[count($blacklist) - 2] != "\\") { } $blacklist .= "\n"; foreach ($row as $bad_ip) { $blacklist .= "{$bad_ip}\n"; } $banlist = str_replace("\r\n", "\n", $blacklist); $banlist = str_replace("\r", "\n", $banlist); $banlist = str_replace("\n\n", "\n", $banlist); if (version_compare(phpversion(), "4.3.0") == "-1") { $banlist = mysql_escape_string($banlist); } else { $banlist = mysql_real_escape_string($banlist); } // end if
/** * Renvoie la blacklist index� de 0 � X * Uniquement pour l'affichage */ function get_nonIndexBlackList() { $arrB = get_blacklist(); sort($arrB); return $arrB; }
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* $Id$ */ require "modules/proxy/includes/proxy.inc.php"; require "modules/proxy/includes/config.inc.php"; require "localSidebar.php"; require "graph/navbar.inc.php"; if (isset($_POST["bcreate"])) { $blacklistName = $_POST["blacklistName"]; $blacklistDesc = $_POST["blacklistDesc"]; $blacklistGroup = $_POST["group"]; $permAll = $_POST["permAll"]; if (!preg_match("/^(([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\$/", $blacklistName)) { $error = _T("Invalid domain name"); } else { $arrB = get_blacklist(); addElementInBlackList($blacklistName, $arrB); save_blacklist($arrB); if (!isXMLRPCError()) { $n = new NotifyWidget(); $n->add(sprintf(_T("Domain %s successfully added"), $blacklistName)); header("Location: " . urlStrRedirect("proxy/blacklist/index")); exit; } } } $p = new PageGenerator(); $p->setSideMenu($sidemenu); $p->displaySideMenu(); ?>
/** * Delete comments which contains words from the blacklist * */ function delete_past_with_list() { global $pixelpost_db_prefix, $admin_lang_spam_com_del, $admin_lang_spam_err_7; $additional_msg = ''; $where = ''; if (isset($_GET['antispamaction']) and $_GET['antispamaction'] == 'deletecmnt') { $banlist = get_blacklist(); $banlist = str_replace("\r\n", "\n", $banlist); $banlist = str_replace("\r", "\n", $banlist); $banlist = explode("\n", $banlist); if (is_array($banlist)) { foreach ($banlist as $entry) { if ($entry == '') { continue; } $entry = trim($entry); $where .= " `message` LIKE '%{$entry}%' OR `name` LIKE '%{$entry}%' OR `ip` LIKE '%{$entry}%' OR "; } } else { $entry = trim($ref_banlist); $where .= " `message` LIKE '%{$entry}%' OR `name` LIKE '%{$entry}%' OR `ip` LIKE '%{$entry}%' OR "; } $where .= ' 0 '; $query = "DELETE FROM `{$pixelpost_db_prefix}comments` WHERE {$where} "; mysql_query($query); if (mysql_error()) { $additional_msg = $admin_lang_spam_err_7 . ' ' . mysql_error() . '<br />'; } else { $additional_msg = $admin_lang_spam_com_del . '<br />'; } } $additional_msg = $additional_msg; return $additional_msg; }