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
Need ability to approve new user
#11
You're missing some ().

Note that there are two functions available to do this. If you only want to check for one particular permission level, you can do

Code:
if(checkMenu(3,$user->data()->id){

or if you want to do multiple permission levels, you can do
Code:
if(hasPerm([2,3,4], $user->data()->id)){

of course you can always do the opposite logic
Code:
if(!hasPerm...

Finally, just so you know, you always have access to your user table with $user->data() so you can echo out the user's first name by doing
Code:
echo $user->data()->fname;

The
Code:
fname
is the column name you want to echo in the users table.

Welcome to UserSpice. I'm Dan, by the way. I use the Dan account when I'm on my phone (it has less permissions) and this one on my real pc.
  Reply
#12
Great - thanks

Eventually got it working - you had missed of a closing bracket which threw me for a bit, but now it's working

Here's the line I used

<pre>
Code:
if(!checkMenu(3,$user->data()->id)){
</pre>


Thanks everyone for your help.
What a refreshing change from stackoverflow!
  Reply
#13
Oops! Sorry about that. Yeah. I've been thrashed on there and the arduino forums a lot. I've found google groups a little more accommodating when I'm asking something completely random. Reddit can be good too.

We just ban people who have bad attitudes around here, but I can only think of 2 of those.
  Reply
#14
@joelmalach your comment has been closed as it wasnt formatted properly lol
  Reply
#15
It's also off-topic.

Because everything is off topic over there.
  Reply
#16
Duplicate...everything is always a duplicate! And if it's not it's too "situtational" or whatever word they use...you had enough time to write your reply and mark my question whatever, you could have answered it already!!! lol
  Reply
#17
Absolutely. I think it's a power trip for them.

It's like, "I know the answer but I'm not telling you because you haven't formatted the question exactly the way I want you to".

It's laughable now, but when you're stuck with a problem, it's so frustrating.
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)