From 11340ca6dabbed75f13fe31fd364773e15b28ebf Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 25 Aug 2012 20:28:34 +0100 Subject: [PATCH] regen thumbs permission hack --- ext/regen_thumb/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/regen_thumb/main.php b/ext/regen_thumb/main.php index 713f6cd5..b417e539 100644 --- a/ext/regen_thumb/main.php +++ b/ext/regen_thumb/main.php @@ -17,7 +17,7 @@ class RegenThumb extends Extension { public function onPageRequest(PageRequestEvent $event) { global $config, $database, $page, $user; - if($event->page_matches("regen_thumb") && $user->is_admin() && isset($_POST['image_id'])) { + if($event->page_matches("regen_thumb") && $user->can("delete_image") && isset($_POST['image_id'])) { $image = Image::by_id(int_escape($_POST['image_id'])); send_event(new ThumbnailGenerationEvent($image->hash, $image->ext, true)); $this->theme->display_results($page, $image); @@ -26,7 +26,7 @@ class RegenThumb extends Extension { public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("delete_image")) { $event->add_part($this->theme->get_buttons_html($event->image->id)); } }