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
Modifying Logged In Users
#1
Hey,

Although this doesn't happen all the time, there are instances I create test or dev users, and remove them, and then I get these errors in my past 24 hour users:
"Notice: Undefined offset: 0 in /home/aircentralized/public_html/boss/users/classes/DB.php on line 155

Notice: Trying to get property of non-object in /home/aircentralized/public_html/boss/users/helpers/helpers.php on line 67"

How can I replicate this? Can we modify the function that if no user_id exists we just put a value?

Thank you!
  Reply
#2
How are you deleting these users?
  Reply
#3
admin_users.php
  Reply
#4
Well, two things.

1. That's coming from the name_from_id function. I need to figure out where that's being called.

2. I haven't looked at the top of that file since I did it a year ago. I forgot a lot of those great functions are in there. I need to go back through and use/document some of those cool functions.
  Reply
#5
Haha well as long as we get it figured out eventually. It's not the end of the world because its only on the dashboard, and I don't delete users all the time. It just so happened I had deleted one at the time right after it was logged in Sad

Thanks!
  Reply
#6
See if this works better for login.php

http://pastebin.com/tqGSfqnj
  Reply
#7
This resolves my logged in users visiting the login page error, but it doesn't fix my offset error for deleted users.
  Reply
#8
Yeah. I'm on vacation...I didn't even try to fix that one.

I need to update the last 24 thing with the echoUser function because it's smart enough to put a "-" if the user's id isn't found.
  Reply
#9
You can try going into admin.php and changing line 395 from

Code:
$username=name_from_id($v1->user_id);

to

Code:
$username = echouser($v1->user_id);

and see if that fixes it.

A better fix might be

Code:
$username = echouser($v1->user_id);
Code:
if($username == '-'){
Code:
$user_id = 0;
Code:
}
  Reply
#10
Both of those resolve the errors, but then allow no usernames to be present. Sad

Enjoy your vacation, work on this when you get back Smile
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)