Gazelle/sections/tools/managers/eb.php

78 lines
2.2 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
2013-01-09 08:00:34 +00:00
define('EMAILS_PER_PAGE', 25);
if (!check_perms('users_view_email')) {
error(403);
2012-08-12 08:00:16 +00:00
}
2013-01-21 08:00:33 +00:00
list ($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
2011-03-28 14:21:28 +00:00
2012-10-11 08:00:15 +00:00
View::show_header('Manage email blacklist');
2013-01-09 08:00:34 +00:00
$DB->query("SELECT
SQL_CALC_FOUND_ROWS
2011-03-28 14:21:28 +00:00
eb.ID,
eb.UserID,
eb.Time,
eb.Email,
2012-04-23 08:00:43 +00:00
eb.Comment
2013-02-22 08:00:24 +00:00
FROM email_blacklist AS eb
2013-01-09 08:00:34 +00:00
ORDER BY eb.Time DESC LIMIT $Limit");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query("SELECT FOUND_ROWS()");
2013-01-21 08:00:33 +00:00
list ($NumResults) = $DB->next_record();
2011-03-28 14:21:28 +00:00
?>
2012-08-19 08:00:19 +00:00
<div class="header">
2013-01-21 08:00:33 +00:00
<h2>Email Blacklist</h2>
2013-01-09 08:00:34 +00:00
</div>
<div class="linkbox pager">
2013-01-21 08:00:33 +00:00
<br />
2013-01-09 08:00:34 +00:00
<?
$Pages = Format::get_pages($Page, $NumResults, TOPICS_PER_PAGE, 9);
echo $Pages;
?>
2012-08-19 08:00:19 +00:00
</div>
2011-03-28 14:21:28 +00:00
<table>
2013-01-21 08:00:33 +00:00
<tr class="colhead">
<td>Email</td>
<td>Comment</td>
<td>Added</td>
<td>Submit</td>
</tr>
<tr class="colhead">
<td colspan="4">Add Email or Domain to Blacklist</td>
</tr>
<tr class="rowa">
2013-02-06 08:00:17 +00:00
<form class="add_form" name="email_blacklist" action="tools.php" method="post">
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
2013-01-21 08:00:33 +00:00
<td><input type="text" name="email" size="30" /></td>
<td colspan="2"><input type="text" name="comment" size="60" /></td>
<td><input type="submit" value="Create" /></td>
</form>
</tr>
<?
2013-02-22 08:00:24 +00:00
2013-01-21 08:00:33 +00:00
foreach ($Results as $Result) {
?>
2013-02-06 08:00:17 +00:00
<tr>
<form class="manage_form" name="email_blacklist" action="tools.php" method="post">
<td>
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="id" value="<?=$Result['ID']?>" />
<input type="text" name="email" value="<?=display_str($Result['Email'])?>" size="30" />
</td>
<td><input type="text" name="comment" value="<?=display_str($Result['Comment'])?>" size="60" /></td>
2013-01-21 08:00:33 +00:00
<td><?=Users::format_username($Result ['UserID'], false, false, false)?><br /><?=time_diff($Result ['Time'], 1)?></td>
2013-02-06 08:00:17 +00:00
<td>
<input type="submit" name="submit" value="Edit" />
<input type="submit" name="submit" value="Delete" />
</td>
2013-01-21 08:00:33 +00:00
</form>
</tr>
2013-01-09 08:00:34 +00:00
<? }?>
2011-03-28 14:21:28 +00:00
</table>
2013-01-11 08:00:38 +00:00
<div class="linkbox pager">
2013-01-21 08:00:33 +00:00
<br />
2013-01-11 08:00:38 +00:00
<?=$Pages?>
</div>
2013-01-09 08:00:34 +00:00
<? View::show_footer(); ?>