-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbannedemails.php
29 lines (27 loc) · 1.14 KB
/
bannedemails.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
<?php
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
checkPrivilegePanel();
$action = isset($_POST['action']) ? htmlspecialchars($_POST['action']) : (isset($_GET['action']) ? htmlspecialchars($_GET['action']) : 'showlist');
if ($action == 'showlist') {
stdhead (VERSION." - Show List");
print("<table border=1 cellspacing=0 cellpadding=5 width=737>\n");
$sql = sql_query("SELECT value FROM bannedemails");
$list = _mysql_fetch_array($sql);
?>
<form method="post" action="bannedemails.php">
<input type="hidden" name="action" value="savelist">
<tr><td>Enter a list of banned email addresses (separated by spaces):<br />To ban a specific address enter "[email protected]", to ban an entire domain enter "@domain.com"</td>
<td><textarea name="value" rows="5" cols="40"><?php echo $list['value']?></textarea>
<input type="submit" value="save"></form></td>
</tr></table>
<?php
stdfoot () ;
}elseif ($action == 'savelist') {
stdhead (VERSION." - Save List");
$value = trim ( htmlspecialchars ( $_POST['value'] ) ) ;
sql_query("UPDATE bannedemails SET value = ".sqlesc($value)) or sqlerr(__FILE__, __LINE__);
Print ("Saved.");
stdfoot () ;
}