Quick Authentication
Posted by Brian Moon
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
quick_auth.php | 1.2 KB | open | download | Brian Moon | 12/04/2006 | Read message |
quick_auth-5.2.php | 2.1 KB | open | download | Brian Moon | 10/16/2007 | Read message |
quick_auth.php | 1.4 KB | open | download | Ryan | 08/16/2005 | Read message |
quick_auth-5.1.php | 1.8 KB | open | download | Thomas Seifert | 01/15/2006 | Read message |
new_quick_auth.php | 5.4 KB | open | download | TheKorn | 04/11/2006 | Read message |
quick_auth-5.1.php | 2.1 KB | open | download | Brian Moon | 12/04/2006 | Read message |
May 30, 2005 11:55AM |
Admin Registered: 24 years ago Posts: 4,495 |
I had a need to check if someone was logged in via Phorum without all the heavy loading of all the Phorum code. This would be used to load the user's info on every page of a web site for example. There is no interface here to update the user info or anything. Just a script to check their cookie and load the user info in $USER. You will need your cookie's path set to / for this work across your site.
quick_auth.php (5.0)
quick_auth.php (5.1)
quick_auth.php (5.2)
Edited 10 time(s). Last edit at 10/16/2007 10:07AM by brianlmoon.
quick_auth.php (5.0)
quick_auth.php (5.1)
quick_auth.php (5.2)
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 10 time(s). Last edit at 10/16/2007 10:07AM by brianlmoon.
Re: Quick Authentication June 02, 2005 02:41PM |
Registered: 20 years ago Posts: 121 |
Re: Quick Authentication June 02, 2005 03:59PM |
Registered: 20 years ago Posts: 139 |
sazaraki Wrote:
-------------------------------------------------------
> what would be an example of a general use for
> someth like this? perhaps integration with some
> other web app?
I have a big use of it. In fact, on my website, there is a challenge where users have to login on the forum to be able to try it out. For the moment, I simply use a little script that checks the cookie: it is VERY vulnerable! So this script is simply EXELLANT!
Thanks a lot brianlmoon ;)
-------------------------------------------------------
> what would be an example of a general use for
> someth like this? perhaps integration with some
> other web app?
I have a big use of it. In fact, on my website, there is a challenge where users have to login on the forum to be able to try it out. For the moment, I simply use a little script that checks the cookie: it is VERY vulnerable! So this script is simply EXELLANT!
Thanks a lot brianlmoon ;)
Re: Quick Authentication July 16, 2005 08:16PM |
Registered: 20 years ago Posts: 117 |
August 16, 2005 12:27PM |
Admin Registered: 24 years ago Posts: 4,495 |
This is a new version that fixes an issue with users with a space in their user name.
Edited 1 time(s). Last edit at 08/17/2005 02:05PM by brianlmoon.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 1 time(s). Last edit at 08/17/2005 02:05PM by brianlmoon.
August 16, 2005 05:31PM |
Registered: 21 years ago Posts: 666 |
Warning: Invalid argument supplied for foreach() in /home/lyruneda/public_html/test.php on line 19
Line 19:
foreach($USER["user_data"] as $key=>$data){
All I did was change mention of phorum in the board url path to the directory I named my phorum, but was I supposed to change anything else?
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
August 16, 2005 06:54PM |
Registered: 21 years ago Posts: 666 |
Asked Brian and he updated the script with a line that had been missing in the previous attachments. So to save him time of having to repost it, here it is.
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
August 17, 2005 11:26AM |
Registered: 21 years ago Posts: 666 |
Does anybody know how to alter this script into having an 'if logged in, echo username', 'if not logged in, echo 'not logged in''? Or would this be the wrong script to alter for that?
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
August 17, 2005 02:06PM |
Admin Registered: 24 years ago Posts: 4,495 |
Well, once this script is in place, you will have a $USER variable that you can use anywhere you want.
if($USER["user_id"]){ echo "logged in"; } else { echo "logged out"; }
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
September 09, 2005 12:42PM |
Registered: 22 years ago Posts: 687 |
Thank you for posting this Brian, it was just what I needed.
Custom user profile fields are also included in $USER in case anyone was wondering.
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Custom user profile fields are also included in $USER in case anyone was wondering.
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Sorry, only registered users may post in this forum.