From edc9c7ae4072cef0a44a52a8c7bf1e8b7773372c 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 b973eb32..1b462ff4 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']));