Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DNP action, for one-click bans

  • Loading branch information...
commit 7b59be6fa0b96803c3bcb7d7294cfab4a77d3c75 1 parent d8a31ce
Shish shish authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 contrib/image_hash_ban/main.php
11 contrib/image_hash_ban/main.php
View
@@ -57,7 +57,16 @@ public function onPageRequest(PageRequestEvent $event) {
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']));
Please sign in to comment.
Something went wrong with that request. Please try again.