/
EditBlackList.Admin.class.php
79 lines (65 loc) · 1.97 KB
/
EditBlackList.Admin.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* File: EditBlackList.Admin.class.php
* This is the Edit Personal Blacklist Module for the Geeklog Spam-X plugin
* Copyright (C) 2004-2017 by the following authors:
* Author Tom Willett tomw AT pigstye DOT net
* Dirk Haun dirk AT haun-online DOT de
* Licensed under GNU General Public License
*
* @package Spam-X
* @subpackage Modules
*/
if (stripos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) {
die('This file can not be used on its own!');
}
// Include Abstract Base Class
require_once $_CONF['path'] . 'plugins/spamx/BaseAdmin.class.php';
/**
* Personal Black List Editor
*
* @package Spam-X
*/
class EditBlackList extends BaseAdmin
{
public function __construct()
{
global $LANG_SX00;
$this->moduleName = 'Personal';
$this->command = 'EditBlackList';
$this->titleText = $LANG_SX00['pblack'];
$this->linkText = $LANG_SX00['edit_personal_blacklist'];
}
/**
* Return HTML widget
*
* @return string
*/
public function display()
{
global $_CONF, $_TABLES, $LANG_SX00;
$action = $this->getAction();
$entry = $this->getEntry();
if (!empty($action) && SEC_checkToken()) {
switch ($action) {
case 'delete':
$this->deleteEntry($entry);
break;
case $LANG_SX00['addentry']:
$this->addEntry($entry, true);
break;
case $LANG_SX00['addcen']:
foreach ($_CONF['censorlist'] as $entry) {
$this->addEntry($entry, true);
}
break;
case 'mass_delete':
if (isset($_POST['delitem'])) {
$this->deleteSelectedEntries(Geeklog\Input::post('delitem'));
}
break;
}
}
return $this->getWidget();
}
}