Firefox PHP

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/05/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/17/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/05/2006 Read message
Quick Authentication
May 30, 2005 05:55PM
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)

Brian - Cowboy Ninja Coder - Personal Blog - Twitter



Edited 10 time(s). Last edit at 10/16/2007 04:07PM by brianlmoon.
Attachments:
open | download - quick_auth.php (1.2 KB)
open | download - quick_auth-5.2.php (2.1 KB)
Re: Quick Authentication
June 02, 2005 08:41PM
what would be an example of a general use for someth like this? perhaps integration with some other web app?
231
Re: Quick Authentication
June 02, 2005 09:59PM
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 ;)
Re: Quick Authentication
July 17, 2005 02:16AM
Hello Brianlmoon,

Can you explain how to run this option ?

We have to install mods and on each page we should make an include(?) ?

Thank you for your answer.
Re: Quick Authentication
August 16, 2005 06:27PM
This is a new version that fixes an issue with users with a space in their user name.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter



Edited 1 time(s). Last edit at 08/17/2005 08:05PM by brianlmoon.
Re: Quick Authentication
August 16, 2005 11:31PM

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
Re: Quick Authentication
August 17, 2005 12:54AM
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
Attachments:
open | download - quick_auth.php (1.4 KB)
Re: Quick Authentication
August 17, 2005 05:26PM
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
Re: Quick Authentication
August 17, 2005 08:06PM
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
Re: Quick Authentication
September 09, 2005 06:42PM
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
Sorry, only registered users may post in this forum.

Click here to login