denied.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1097 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
98f6800f9d
commit
721c720f19
9 changed files with 23 additions and 11 deletions
|
@ -56,7 +56,7 @@ class EventLog implements Extension {
|
||||||
$this->theme->display_page($event->page, $events);
|
$this->theme->display_page($event->page, $events);
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
if($event instanceof UserBlockBuildingEvent) {
|
||||||
|
|
|
@ -70,8 +70,7 @@ class IPBan implements Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header("HTTP/1.0 403 Access Denied");
|
$this->theme->display_permission_denied($event->page);
|
||||||
$this->theme->display_error($event->page, "Permission Denied", "This page is for admins only");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Wiki implements Extension {
|
||||||
$event->page->set_redirect(make_link("wiki/$u_title"));
|
$event->page->set_redirect(make_link("wiki/$u_title"));
|
||||||
}
|
}
|
||||||
else {
|
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)) {
|
else if(is_null($content)) {
|
||||||
|
|
|
@ -19,9 +19,7 @@ class AdminPage implements Extension {
|
||||||
|
|
||||||
if(($event instanceof PageRequestEvent) && $event->page_matches("admin")) {
|
if(($event instanceof PageRequestEvent) && $event->page_matches("admin")) {
|
||||||
if(!$event->user->is_admin()) {
|
if(!$event->user->is_admin()) {
|
||||||
//$event->page->add_header("HTTP/1.0 403 Access Denied");
|
$this->theme->display_permission_denied($event->page);
|
||||||
header("HTTP/1.0 403 Access Denied");
|
|
||||||
$this->theme->display_error($event->page, "Permission Denied", "This page is for admins only");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($event->get_arg(0) == "delete_image") {
|
if($event->get_arg(0) == "delete_image") {
|
||||||
|
|
|
@ -93,7 +93,7 @@ class CommentList implements Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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") {
|
else if($event->get_arg(0) == "list") {
|
||||||
|
|
|
@ -140,7 +140,7 @@ class Setup implements Extension {
|
||||||
if(($event instanceof PageRequestEvent) && $event->page_matches("setup")) {
|
if(($event instanceof PageRequestEvent) && $event->page_matches("setup")) {
|
||||||
global $user;
|
global $user;
|
||||||
if(!$user->is_admin()) {
|
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 {
|
else {
|
||||||
if($event->get_arg(0) == "save") {
|
if($event->get_arg(0) == "save") {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Upload implements Extension {
|
||||||
$this->theme->display_upload_status($event->page, $ok);
|
$this->theme->display_upload_status($event->page, $ok);
|
||||||
}
|
}
|
||||||
else {
|
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'])) {
|
else if(!empty($_GET['url'])) {
|
||||||
|
@ -61,7 +61,7 @@ class Upload implements Extension {
|
||||||
$this->theme->display_upload_status($event->page, $ok);
|
$this->theme->display_upload_status($event->page, $ok);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
|
$this->theme->display_permission_denied($event->page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -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) {
|
public function build_thumb_html($image, $query=null) {
|
||||||
global $config;
|
global $config;
|
||||||
$h_view_link = make_link("post/view/{$image->id}", $query);
|
$h_view_link = make_link("post/view/{$image->id}", $query);
|
||||||
|
|
|
@ -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
|
* Generic thumbnail code; returns HTML rather than adding
|
||||||
* a block since thumbs tend to go inside blocks...
|
* a block since thumbs tend to go inside blocks...
|
||||||
|
|
Reference in a new issue