From 7b59be6fa0b96803c3bcb7d7294cfab4a77d3c75 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 23 Mar 2011 11:17:19 +0000 Subject: [PATCH] DNP action, for one-click bans --- contrib/image_hash_ban/main.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/image_hash_ban/main.php b/contrib/image_hash_ban/main.php index 354cd4dc..1c36fd9c 100644 --- a/contrib/image_hash_ban/main.php +++ b/contrib/image_hash_ban/main.php @@ -57,7 +57,16 @@ class ImageBan extends SimpleExtension { if($event->page_matches("image_hash_ban")) { if($user->is_admin()) { - if($event->get_arg(0) == "add") { + if($event->get_arg(0) == "dnp") { + $image = Image::by_id(int_escape($event->get_arg(1))); + if($image) { + send_event(new AddImageHashBanEvent($image->hash, "DNP")); + send_event(new ImageDeletionEvent($image)); + } + $page->set_mode("redirect"); + $page->set_redirect($_SERVER["HTTP_REFERER"]); + } + else if($event->get_arg(0) == "add") { if(isset($_POST['hash']) && isset($_POST['reason'])) { send_event(new AddImageHashBanEvent($_POST['hash'], $_POST['reason']));