Manually checking logged-in status

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
teee
Registered User
Posts: 1
Joined: Sun Sep 27, 2015 8:01 pm

Manually checking logged-in status

Post by teee » Thu Sep 05, 2019 7:25 am

Hi -

I'm running an older version of phpBB (3.1) and will upgrade when I have time. In the meantime, I'm trying to check if someone's logged in, but I'm unable to include common.php and all the usual session startup code, because the variables conflict with some third-party software I'm using and cause total madness.

What I'd like to know is if anyone's come up with a way to do a

Code: Select all

if($user->data['is_registered'])
equivalent without pulling in the entire phpBB back end. For instance, this MySQL query seems to give me essentially the minutes that a user's been logged in:

Code: Select all

SELECT (UNIX_TIMESTAMP() - session_time) / 60 FROM `phpbb_sessions` where session_user_id = ?
which is great, but I want to keep things synced and copacetic with phpBB. In other words, while I could check if the user's been logged in for x minutes and log them out if it's over a threshold, I'd rather defer to whatever phpBB is doing. For example, what if the user clears their cookies just after logging in? Thanks for any thoughts :)
Last edited by JimA on Thu Sep 05, 2019 1:37 pm, edited 1 time in total.
Reason: Moved from phpBB Discussion to Custom Coding

Post Reply

Return to “phpBB Custom Coding”