2 require_once("blacklist_lib.php");
5 // Nucleus Admin section;
9 include($strRel . 'config.php');
11 include($DIR_LIBS . 'PLUGINADMIN.php');
13 if ($blogid) {$isblogadmin = $member->isBlogAdmin($blogid);}
14 else $isblogadmin = 0;
16 if (!($member->isAdmin() || $isblogadmin)) {
17 $oPluginAdmin = new PluginAdmin('Blacklist');
18 $pbl_config = array();
19 $oPluginAdmin->start();
20 echo "<p>"._ERROR_DISALLOWED."</p>";
25 $action = requestVar('action');
26 $aActionsNotToCheck = array(
29 if (!in_array($action, $aActionsNotToCheck)) {
30 if (!$manager->checkTicket()) doError(_ERROR_BADTICKET);
33 // Okay; we are allowed. let's go
34 // create the admin area page
35 $oPluginAdmin = new PluginAdmin('Blacklist');
36 $oPluginAdmin->start();
37 // get the plugin options; stored in the DB
38 $pbl_config['enabled'] = $oPluginAdmin->plugin->getOption('enabled');
39 $pbl_config['redirect'] = $oPluginAdmin->plugin->getOption('redirect');
40 //$pbl_config['update'] = $oPluginAdmin->plugin->getOption('update');
41 $pbl_config['referrerblock'] = $oPluginAdmin->plugin->getOption('referrerblock');
42 $pbl_config['ipblock'] = $oPluginAdmin->plugin->getOption('ipblock');
43 $pbl_config['ipthreshold'] = $oPluginAdmin->plugin->getOption('ipthreshold');
44 $pbl_config['BulkfeedsKey'] = $oPluginAdmin->plugin->getOption('BulkfeedsKey');
45 $pbl_config['SkipNameResolve'] = $oPluginAdmin->plugin->getOption('SkipNameResolve');
47 function getPluginOption($name) {
49 return $pbl_config[$name];
51 function getPlugid() {
53 return $oPluginAdmin->plugin->plugid;
57 if ($action == 'blacklist') {
58 pbl_blacklisteditor();
60 // } elseif ($action == 'getblacklist') {
61 // if (pbl_updateblacklist($pbl_config['update'],true)) {
62 // $pblmessage = "Blacklist succesfully updated!";
63 // pbl_blacklisteditor();
66 } elseif ($action == 'addpersonal') {
68 pbl_blacklisteditor();
70 } elseif ($action == 'deleteexpression') {
71 pbl_deleteexpression();
72 echo "<div class=\"pblmessage\">Expression deleted from personal blacklist.</div>\n";
73 pbl_blacklisteditor();
74 } elseif ($action == 'log') {
75 echo "<h2 style=\"text-align:left\"><span style=\"margin-left:10px;\">Blacklist: Blacklist Log</span></h2>";
76 echo "<div class=\"pbldescription\">This is your Blacklist logviewer. Each blocked spam attempt will end up in this overview.If you wish you can reset the log below.</div>\n";
78 } elseif ($action == 'resetlog') {
80 echo "<h2> logfile has been reset</h2>";
81 echo "<h2 style=\"text-align:left\"><span style=\"margin-left:10px;\">Blacklist: Blacklist Log</span></h2>";
82 echo "<div class=\"pbldescription\">This is your Blacklist logviewer. Each blocked spam attempt will end up in this overview.If you wish you can reset the log below.</div>\n";
84 } elseif ($action == 'testpage') {
85 echo "<h2>Test if an expression is considered spam</h2>";
87 } elseif ($action == 'test') {
88 echo "<h2>Test if an expression is considered spam</h2>";
91 } elseif ($action == 'showipblock') {
92 echo "<h2>These ip-addresses are blocked</h2>";
94 } elseif ($action == 'addip') {
96 echo "<h2>These ip-addresses are blocked</h2>";
98 } elseif ($action == 'deleteipblock') {
100 echo "<div class=\"pblmessage\">Block deleted</div>\n";
101 echo "<h2>These ip-addresses are blocked</h2>";
103 } elseif ($action == 'htaccess') {
104 echo "<h2>Here you can generate .htaccess snippets</h2>";
106 } elseif ($action == 'spamsubmission') {
107 $url = requestVar('url');
108 if( requestVar('type') == 'send' && ! empty($url) ){
109 $result = $oPluginAdmin->plugin->submitSpamToBulkfeeds( $url );
111 echo "<h2>Spam submission</h2>";
112 echo "<h3>result</h3>";
113 echo "<pre>" . htmlspecialchars($result, ENT_QUOTES) . "</pre>";
115 echo "<h2>Spam submission</h2>";
116 pbl_spamsubmission_form();
120 echo "Based on pivot blacklist: <a style=\"border:0px; padding:0px; margin:10px;\" href=\"http://www.i-marco.nl/pivot-blacklist/\"><img style=\"border:0px\" src=\"".dirname($_SERVER['PHP_SELF'])."/pblbutton.png\" alt=\"Pivot Blacklist\"/></a><br/>";
122 $oPluginAdmin->end();