diff --git a/contrib/admin/main.php b/contrib/admin/main.php index 881aa2e3..f4a78545 100644 --- a/contrib/admin/main.php +++ b/contrib/admin/main.php @@ -41,7 +41,7 @@ class AdminPage extends Extension { if($event->page_matches("admin")) { if(!$user->is_admin()) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { send_event(new AdminBuildingEvent($page)); diff --git a/contrib/blotter/main.php b/contrib/blotter/main.php index 23dc5fe8..21c87d8c 100644 --- a/contrib/blotter/main.php +++ b/contrib/blotter/main.php @@ -66,7 +66,7 @@ class Blotter extends Extension { * Displays the blotter editor. */ if(!$user->is_admin()) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { $entries = $database->get_all("SELECT * FROM blotter ORDER BY id DESC"); $this->theme->display_editor($entries); @@ -77,7 +77,7 @@ class Blotter extends Extension { * Adds an entry */ if(!$user->is_admin() || !$user->check_auth_token()) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { $entry_text = $_POST['entry_text']; if($entry_text == "") { die("No entry message!"); } @@ -95,7 +95,7 @@ class Blotter extends Extension { * Removes an entry */ if(!$user->is_admin() || !$user->check_auth_token()) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { $id = int_escape($_POST['id']); if(!isset($id)) { die("No ID!"); } diff --git a/contrib/ipban/main.php b/contrib/ipban/main.php index 415e7d1b..d0329034 100644 --- a/contrib/ipban/main.php +++ b/contrib/ipban/main.php @@ -73,7 +73,7 @@ class IPBan extends Extension { } } else { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } } } diff --git a/contrib/oekaki/main.php b/contrib/oekaki/main.php index 16e5748e..25b1605e 100644 --- a/contrib/oekaki/main.php +++ b/contrib/oekaki/main.php @@ -11,7 +11,7 @@ class Oekaki extends Extension { if($event->page_matches("oekaki")) { if(!$this->can_upload($user)) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } if($event->get_arg(0) == "create") { diff --git a/contrib/wiki/main.php b/contrib/wiki/main.php index ff7da165..920588b9 100644 --- a/contrib/wiki/main.php +++ b/contrib/wiki/main.php @@ -126,7 +126,7 @@ class Wiki extends Extension { } } else { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } } else if($event->page_matches("wiki_admin/delete_revision")) { diff --git a/ext/comment/main.php b/ext/comment/main.php index d1b121b8..dac233fa 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -142,7 +142,7 @@ class CommentList extends Extension { } } else { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } } else if($event->get_arg(0) === "list") { diff --git a/ext/setup/main.php b/ext/setup/main.php index 5ec75c12..3bf636c8 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -188,7 +188,7 @@ class Setup extends Extension { if($event->page_matches("setup")) { if(!$user->can("change_setting")) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { if($event->get_arg(0) == "save" && $user->check_auth_token()) { diff --git a/ext/upload/main.php b/ext/upload/main.php index d1ac6d10..6bd6f7f9 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -124,7 +124,7 @@ class Upload extends Extension { // check if the user is an administrator and can upload files. if(!$user->can("replace_image")) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { if($this->is_full) { @@ -182,7 +182,7 @@ class Upload extends Extension { } else if($event->page_matches("upload")) { if(!$this->can_upload($user)) { - $this->theme->display_permission_denied($page); + $this->theme->display_permission_denied(); } else { /* Regular Upload Image */ diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index ed738f7e..e3277c3b 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -9,7 +9,8 @@ class Themelet { } - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); } diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php index 27a6a280..785eaa1d 100644 --- a/themes/default/themelet.class.php +++ b/themes/default/themelet.class.php @@ -17,7 +17,8 @@ class Themelet { /** * A specific, common error message */ - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); } diff --git a/themes/flat/themelet.class.php b/themes/flat/themelet.class.php index 0aaa32b0..4b564971 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -17,7 +17,8 @@ class Themelet { /** * A specific, common error message */ - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); } diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 20e7e2fb..75ca217a 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -12,6 +12,16 @@ class Themelet { } + /** + * A specific, common error message + */ + public function display_permission_denied() { + global $page; + $page->add_http_header("HTTP/1.0 403 Permission Denied"); + $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); + } + + /** * Generic thumbnail code; returns HTML rather than adding * a block since thumbs tend to go inside blocks... diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index a9a21f8b..85a915ba 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -17,7 +17,8 @@ class Themelet { /** * A specific, common error message */ - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); } diff --git a/themes/old_default/themelet.class.php b/themes/old_default/themelet.class.php index ff48817b..8767f6a3 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -15,7 +15,8 @@ class Themelet { /** * A specific, common error message */ - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); } diff --git a/themes/warm/themelet.class.php b/themes/warm/themelet.class.php index 38170d2e..0df5758f 100644 --- a/themes/warm/themelet.class.php +++ b/themes/warm/themelet.class.php @@ -17,7 +17,8 @@ class Themelet { /** * A specific, common error message */ - public function display_permission_denied(Page $page) { + public function display_permission_denied() { + global $page; $page->add_http_header("HTTP/1.0 403 Permission Denied"); $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); }