git-svn-id: file:///home/shish/svn/shimmie2/trunk@1097 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-10-18 10:49:16 +00:00
parent 98f6800f9d
commit 721c720f19
9 changed files with 23 additions and 11 deletions

View file

@ -56,7 +56,7 @@ class EventLog implements Extension {
$this->theme->display_page($event->page, $events);
}
else {
$this->theme->display_error($event->page, "Denied", "Only admins can see the event log");
$this->theme->display_permission_denied($event->page);
}
}
if($event instanceof UserBlockBuildingEvent) {

View file

@ -70,8 +70,7 @@ class IPBan implements Extension {
}
}
else {
header("HTTP/1.0 403 Access Denied");
$this->theme->display_error($event->page, "Permission Denied", "This page is for admins only");
$this->theme->display_permission_denied($event->page);
}
}

View file

@ -93,7 +93,7 @@ class Wiki implements Extension {
$event->page->set_redirect(make_link("wiki/$u_title"));
}
else {
$this->theme->display_error($event->page, "Denied", "You do not have permission to edit this page");
$this->theme->display_permission_denied($event->page);
}
}
else if(is_null($content)) {

View file

@ -19,9 +19,7 @@ class AdminPage implements Extension {
if(($event instanceof PageRequestEvent) && $event->page_matches("admin")) {
if(!$event->user->is_admin()) {
//$event->page->add_header("HTTP/1.0 403 Access Denied");
header("HTTP/1.0 403 Access Denied");
$this->theme->display_error($event->page, "Permission Denied", "This page is for admins only");
$this->theme->display_permission_denied($event->page);
}
else {
if($event->get_arg(0) == "delete_image") {

View file

@ -93,7 +93,7 @@ class CommentList implements Extension {
}
}
else {
$this->theme->display_error($event->page, "Denied", "Only admins can delete comments");
$this->theme->display_permission_denied($event->page);
}
}
else if($event->get_arg(0) == "list") {

View file

@ -140,7 +140,7 @@ class Setup implements Extension {
if(($event instanceof PageRequestEvent) && $event->page_matches("setup")) {
global $user;
if(!$user->is_admin()) {
$this->theme->display_error($event->page, "Permission Denied", "This page is for admins only");
$this->theme->display_permission_denied($event->page);
}
else {
if($event->get_arg(0) == "save") {

View file

@ -46,7 +46,7 @@ class Upload implements Extension {
$this->theme->display_upload_status($event->page, $ok);
}
else {
$this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
$this->theme->display_permission_denied($event->page);
}
}
else if(!empty($_GET['url'])) {
@ -61,7 +61,7 @@ class Upload implements Extension {
$this->theme->display_upload_status($event->page, $ok);
}
else {
$this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
$this->theme->display_permission_denied($event->page);
}
}
else {

View file

@ -9,6 +9,12 @@ class Themelet {
}
public function display_permission_denied($page) {
header("HTTP/1.0 403 Permission Denied");
$this->display_error($page, "Permission Denied", "You do not have permission to access this page");
}
public function build_thumb_html($image, $query=null) {
global $config;
$h_view_link = make_link("post/view/{$image->id}", $query);

View file

@ -12,6 +12,15 @@ class Themelet {
}
/**
* A specific, common error message
*/
public function display_permission_denied($page) {
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...