From 4856af9c490cdd1cd5eb79f2052d164a6af70b1d Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 31 Mar 2012 12:33:55 +0100 Subject: [PATCH] more perms --- contrib/tag_history/main.php | 4 ++-- core/userclass.class.php | 2 ++ themes/danbooru/user.theme.php | 42 ---------------------------------- themes/lite/user.theme.php | 42 ---------------------------------- 4 files changed, 4 insertions(+), 86 deletions(-) diff --git a/contrib/tag_history/main.php b/contrib/tag_history/main.php index 7bcddbd3..b6fe5cea 100644 --- a/contrib/tag_history/main.php +++ b/contrib/tag_history/main.php @@ -35,7 +35,7 @@ class Tag_History extends Extension { } } else if($event->page_matches("tag_history/bulk_revert")) { - if($user->is_admin() && $user->check_auth_token()) { + if($user->can("bulk_edit_image_tag") && $user->check_auth_token()) { $this->process_bulk_revert_request(); } } @@ -78,7 +78,7 @@ class Tag_History extends Extension { public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("bulk_edit_image_tag")) { $event->add_link("Tag Changes", make_link("tag_history/all/1")); } } diff --git a/core/userclass.class.php b/core/userclass.class.php index be8acb16..8b12d9af 100644 --- a/core/userclass.class.php +++ b/core/userclass.class.php @@ -63,6 +63,7 @@ new UserClass("base", null, array( "edit_image_source" => False, "edit_image_owner" => False, "edit_image_lock" => False, + "bulk_edit_image_tag" => False, "delete_image" => False, "ban_image" => False, @@ -121,6 +122,7 @@ new UserClass("admin", "base", array( "edit_image_tag" => True, "edit_image_source" => True, "edit_image_owner" => True, + "bulk_edit_image_tag" => True, "mass_tag_edit" => True, "create_image_report" => True, "view_image_report" => True, diff --git a/themes/danbooru/user.theme.php b/themes/danbooru/user.theme.php index a3329c80..51e3b32b 100644 --- a/themes/danbooru/user.theme.php +++ b/themes/danbooru/user.theme.php @@ -98,47 +98,5 @@ class CustomUserPageTheme extends UserPageTheme { $page->disable_left(); parent::display_user_page($duser, $stats); } - - protected function build_options($duser) { - global $database; - global $config; - global $user; - - $html = ""; - $html .= " -
- - - - - - - -
Change Password
Password
Repeat Password
-
-

- - - - - -
Change Email
Address
-

- "; - - if($user->is_admin()) { - $i_user_id = int_escape($duser->id); - $h_is_admin = $duser->is_admin() ? " checked" : ""; - $html .= " -

".make_form(make_link("user_admin/set_more"))." - - Admin: - - - "; - } - - return $html; - } } ?> diff --git a/themes/lite/user.theme.php b/themes/lite/user.theme.php index 7f6d6440..9aa476ab 100644 --- a/themes/lite/user.theme.php +++ b/themes/lite/user.theme.php @@ -95,47 +95,5 @@ class CustomUserPageTheme extends UserPageTheme { $page->disable_left(); parent::display_user_page($duser, $stats); } - - protected function build_options($duser) { - global $database; - global $config; - global $user; - - $html = ""; - $html .= " -

- - - - - - - -
Change Password
Password
Repeat Password
-
-

- - - - - -
Change Email
Address
-

- "; - - if($user->is_admin()) { - $i_user_id = int_escape($duser->id); - $h_is_admin = $duser->is_admin() ? " checked" : ""; - $html .= " -

".make_form(make_link("user_admin/set_more"))." - - Admin: - - - "; - } - - return $html; - } } ?>