diff --git a/contrib/downtime/main.php b/contrib/downtime/main.php index 462e530f..63421db8 100644 --- a/contrib/downtime/main.php +++ b/contrib/downtime/main.php @@ -26,7 +26,7 @@ class Downtime extends Extension { global $config, $page, $user; if($config->get_bool("downtime")) { - if(!$user->is_admin() && !$this->is_safe_page($event)) { + if(!$user->can("ignore_downtime") && !$this->is_safe_page($event)) { $msg = $config->get_string("downtime_message"); $this->theme->display_message($msg); exit; diff --git a/contrib/featured/main.php b/contrib/featured/main.php index 5dbc41dd..dda66100 100644 --- a/contrib/featured/main.php +++ b/contrib/featured/main.php @@ -29,7 +29,7 @@ class Featured extends Extension { global $config, $page, $user; if($event->page_matches("featured_image")) { if($event->get_arg(0) == "set" && $user->check_auth_token()) { - if($user->is_admin() && isset($_POST['image_id'])) { + if($user->can("edit_feature") && isset($_POST['image_id'])) { $id = int_escape($_POST['image_id']); if($id > 0) { $config->set_int("featured_id", $id); @@ -77,7 +77,7 @@ class Featured extends Extension { public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { global $user; - if($user->is_admin()) { + if($user->can("edit_feature")) { $event->add_part($this->theme->get_buttons_html($event->image->id)); } } diff --git a/contrib/ipban/main.php b/contrib/ipban/main.php index 4e50c3de..f3346a6c 100644 --- a/contrib/ipban/main.php +++ b/contrib/ipban/main.php @@ -49,7 +49,7 @@ class IPBan extends Extension { public function onPageRequest(PageRequestEvent $event) { if($event->page_matches("ip_ban")) { global $config, $database, $page, $user; - if($user->is_admin()) { + if($user->can("ban_ip")) { if($event->get_arg(0) == "add" && $user->check_auth_token()) { if(isset($_POST['ip']) && isset($_POST['reason']) && isset($_POST['end'])) { if(empty($_POST['end'])) $end = null; diff --git a/contrib/numeric_score/main.php b/contrib/numeric_score/main.php index 70ac2379..98aaf45d 100644 --- a/contrib/numeric_score/main.php +++ b/contrib/numeric_score/main.php @@ -38,7 +38,7 @@ class NumericScore extends Extension { public function onUserPageBuilding(UserPageBuildingEvent $event) { global $page, $user; - if($user->is_admin()) { + if($user->can("edit_other_votes")) { $html = $this->theme->get_nuller_html($event->display_user); $page->add_block(new Block("Votes", $html, "main", 60)); } @@ -79,7 +79,7 @@ class NumericScore extends Extension { } } if($event->page_matches("numeric_score/remove_votes_on") && $user->check_auth_token()) { - if($user->is_admin()) { + if($user->can("edit_other_vote")) { $image_id = int_escape($_POST['image_id']); $database->execute( "DELETE FROM numeric_score_votes WHERE image_id=?", @@ -92,7 +92,7 @@ class NumericScore extends Extension { } } if($event->page_matches("numeric_score/remove_votes_by") && $user->check_auth_token()) { - if($user->is_admin()) { + if($user->can("edit_other_vote")) { $this->delete_votes_by(int_escape($_POST['user_id'])); $page->set_mode("redirect"); $page->set_redirect(make_link()); diff --git a/contrib/numeric_score/theme.php b/contrib/numeric_score/theme.php index b33043e0..fdd2fa90 100644 --- a/contrib/numeric_score/theme.php +++ b/contrib/numeric_score/theme.php @@ -30,7 +30,7 @@ class NumericScoreTheme extends Themelet { "; - if($user->is_admin()) { + if($user->can("edit_other_vote")) { $html .= "