The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I broke my pages
#1
Hi, 4.3.26 on Ubuntu/Apache2

Just wanted to check something (I'm spinning up another instance to test further while I type):

I attempted to run a test system and live system off the same db - it seemed to work OK while I worked on it.
The latest feature initially required an AJAX GET (just to bring in a list of comments). Whilst working on the subsequent AJAX POST, I noticed that the files called by AJAX were not being added to the pages table. Moreover, there were many entries in pages_permissions for pages that did not exist.

The pages called by AJAX have a successful call to init and a call to a DB instance, and return data correctly.
If I access these pages directly in my browser, I am prompted to secure them - but the pages table is not updated.


Is this a result of the live/test 'stunt' or is it anything to do with calling by AJAX?

cheers
  Reply
#2
There are 2 things you can do with ajax parser files. I tend not to like to clog up my pages table with parser files, so I tend to not use the securePage function and instead do something like...

require_once("../../users/init.php"); /obviously with your own path
$db = DB::getInstance();
if(!hasPerm([2,3],$user->data()->id)){
die("Not logged in");
}

If you really want the parsers files to use securePage, then you have to add the folder that they're stored in to the z_us_root file.
  Reply
#3
perfect, thankyou Mudmin. I should have figured out that old school method myself Wink

I'll be asking about Validation next, once I've built this new server...

thanks again,
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)