diff --git a/contrib/admin/main.php b/contrib/admin/main.php index ab902603..f70e77bf 100644 --- a/contrib/admin/main.php +++ b/contrib/admin/main.php @@ -43,7 +43,7 @@ class AdminPage extends Extension { global $page, $user; if($event->page_matches("admin")) { - if(!$user->is_admin()) { + if(!$user->can("manage_admintools")) { $this->theme->display_permission_denied(); } else { @@ -76,7 +76,7 @@ class AdminPage extends Extension { public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("manage_admintools")) { $event->add_link("Board Admin", make_link("admin")); } } @@ -90,7 +90,7 @@ class AdminPage extends Extension { public function onPostListBuilding(PostListBuildingEvent $event) { global $user; - if($user->is_admin() && !empty($event->search_terms)) { + if($user->can("manage_admintools") && !empty($event->search_terms)) { $this->theme->display_dbq(implode(" ", $event->search_terms)); } } diff --git a/contrib/image_hash_ban/main.php b/contrib/image_hash_ban/main.php index f68c7205..cf20fb37 100644 --- a/contrib/image_hash_ban/main.php +++ b/contrib/image_hash_ban/main.php @@ -56,7 +56,7 @@ class ImageBan extends Extension { global $config, $database, $page, $user; if($event->page_matches("image_hash_ban")) { - if($user->is_admin()) { + if($user->can("ban_image")) { if($event->get_arg(0) == "dnp") { $image = Image::by_id(int_escape($event->get_arg(1))); if($image) { @@ -105,7 +105,7 @@ class ImageBan extends Extension { public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("ban_image")) { $event->add_link("Image Bans", make_link("image_hash_ban/list/1")); } } @@ -120,7 +120,7 @@ class ImageBan extends Extension { public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("ban_image")) { $event->add_part($this->theme->get_buttons_html($event->image)); } } diff --git a/contrib/ipban/main.php b/contrib/ipban/main.php index 4dd485ed..4e50c3de 100644 --- a/contrib/ipban/main.php +++ b/contrib/ipban/main.php @@ -80,7 +80,7 @@ class IPBan extends Extension { public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("ban_ip")) { $event->add_link("IP Bans", make_link("ip_ban/list")); } } diff --git a/contrib/log_db/main.php b/contrib/log_db/main.php index 8399720a..39a58f36 100644 --- a/contrib/log_db/main.php +++ b/contrib/log_db/main.php @@ -44,7 +44,7 @@ class LogDatabase extends Extension { public function onPageRequest(PageRequestEvent $event) { global $database, $user; if($event->page_matches("log/view")) { - if($user->is_admin()) { + if($user->can("view_eventlog")) { $wheres = array(); $args = array(); $page_num = int_escape($event->get_arg(0)); @@ -111,7 +111,7 @@ class LogDatabase extends Extension { public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("view_eventlog")) { $event->add_link("Event Log", make_link("log/view")); } } diff --git a/core/userclass.class.php b/core/userclass.class.php index 5dcf1dd6..e6b219f4 100644 --- a/core/userclass.class.php +++ b/core/userclass.class.php @@ -65,6 +65,10 @@ new UserClass("base", null, array( "edit_image_lock" => False, "delete_image" => False, + "ban_image" => False, + + "view_eventlog" => False, + "create_image_report" => False, "view_image_report" => False, # deal with reported images @@ -73,6 +77,8 @@ new UserClass("base", null, array( "manage_blocks" => False, + "manage_admintools" => False, + "protected" => False, # only admins can modify protected users (stops a moderator changing an admin's password) )); @@ -100,6 +106,7 @@ new UserClass("admin", "base", array( "delete_user" => True, "create_image" => True, "delete_image" => True, + "ban_image" => True, "create_comment" => True, "delete_comment" => True, "replace_image" => True, @@ -113,7 +120,9 @@ new UserClass("admin", "base", array( "view_image_report" => True, "edit_wiki_page" => True, "delete_wiki_page" => True, + "view_eventlog" => True, "manage_blocks" => True, + "manage_admintools" => True, "protected" => True, ));