The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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
Using US classes in AJAX call
#4
That AJAX parser file is sort of like writing a function in php. It doesn't have access to the DB unless you exclusively grant it. That's where the db instantiation comes in.

It's also a good idea if you do some other checks in that parser file before updating the database. I usually do something like

Code:
if(hasPerm([2,3,4],$user->data()->id){
//the user has a permission level of 2, 3, or 4
Code:
//your code
Code:
}else{
Code:
die("You should not be here");
Code:
}
  Reply


Messages In This Thread
Using US classes in AJAX call - by mckennahampton - 09-26-2017, 09:05 PM
Using US classes in AJAX call - by mudmin - 09-26-2017, 09:30 PM
Using US classes in AJAX call - by mckennahampton - 09-26-2017, 09:56 PM
Using US classes in AJAX call - by mudmin - 09-27-2017, 11:51 AM
Using US classes in AJAX call - by mckennahampton - 10-01-2017, 02:52 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)