less passing of $page

This commit is contained in:
Shish 2012-02-15 08:59:24 +00:00
parent c70d81c97d
commit c2bf42ef5a
15 changed files with 33 additions and 17 deletions

View file

@ -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));

View file

@ -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!"); }

View file

@ -73,7 +73,7 @@ class IPBan extends Extension {
}
}
else {
$this->theme->display_permission_denied($page);
$this->theme->display_permission_denied();
}
}
}

View file

@ -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") {

View file

@ -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")) {

View file

@ -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") {

View file

@ -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()) {

View file

@ -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 */

View file

@ -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");
}

View file

@ -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");
}

View file

@ -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");
}

View file

@ -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...

View file

@ -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");
}

View file

@ -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");
}

View file

@ -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");
}