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 UserSpice permissions in my own code
#6
Oh dear! Spoke too soon. If I now use this function (hasPerm) to validate if an unauthorised user role has access, I get a fatal PHP error within users/us_helpers.php. This seems to relate to a variable around line 788 which references an undefined variable "$master_account".

The original code was
Code:
if (in_array($user->data()->id, $master_account)){

Two issues - neither $user nor $master_account appear to be defined within the function's scope. I fixed the $user variable by using the $id parameter passed into the function.

I'm not sure how to define $master_account though. It should be an array, but I wasn't sure whether it should be populated by the earlier foreach loop? Or maybe just the array passed into the function?
  Reply


Messages In This Thread
Using UserSpice permissions in my own code - by grumpy-gnome - 05-11-2017, 04:59 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)