summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2024-06-04 12:59:44 -0400
committerspiderr <spiderr@bitweaver.org>2024-06-04 12:59:44 -0400
commit1c589faa806b6321e16d823a8e1ef2b604f98221 (patch)
treee0b20cffe24c4dfe32a17bb9df98d9107180fae9
parent2106c97fd830116deda68a7d30f113d78f49569f (diff)
downloadkernel-1c589faa806b6321e16d823a8e1ef2b604f98221.tar.gz
kernel-1c589faa806b6321e16d823a8e1ef2b604f98221.tar.bz2
kernel-1c589faa806b6321e16d823a8e1ef2b604f98221.zip
fix fatalPermission for AJAX / api calls
-rw-r--r--includes/classes/BitSystem.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/classes/BitSystem.php b/includes/classes/BitSystem.php
index 787d8d5..cd40bb9 100644
--- a/includes/classes/BitSystem.php
+++ b/includes/classes/BitSystem.php
@@ -773,7 +773,12 @@ class BitSystem extends BitSingleton {
// bit_error_log( "PERMISSION DENIED: $pPermission $pMsg" );
$gBitSmarty->assign( 'msg', tra( $pMsg ) );
$this->setHttpStatus( HttpStatusCodes::HTTP_NOT_FOUND );
- $this->display( "error.tpl" );
+ if( $gBitThemes->isAjaxRequest() ) {
+ print json_encode( array( 'error' => $pMsg ) );
+ } else {
+ $gBitSmarty->assign( 'metaNoIndex', 1 );
+ $this->display( "error.tpl" );
+ }
die;
}