<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Quick Authentication</title>
        <description>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&#039;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&#039;s path set to / for this work across your site.

[url=http://www.phorum.org/phorum5/file.php?28,file=1366]quick_auth.php (5.0)[/url]
[url=http://www.phorum.org/phorum5/file.php?28,file=1365]quick_auth.php (5.1)[/url]
[url=http://www.phorum.org/phorum5/file.php?28,file=1876,filename=quick_auth-5.2.php]quick_auth.php (5.2)[/url]</description>
        <link>https://www.phorum.org/support/read.php?28,17178,17178#msg-17178</link>
        <lastBuildDate>Mon, 12 Oct 2026 14:28:40 -0500</lastBuildDate>
        <generator>Phorum 6.0.4</generator>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,142579#msg-142579</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,142579#msg-142579</link>
            <description><![CDATA[ Do you think I&#039;d use the phorum&#039;s usernames for my wordpress commenting template with this?<br />
<br />
Fex If logged in (to phorum) they&#039;d see the wordpress commenting template and it would fetch their phorum name automatically? <br />
<br />
Thanks for the info?]]></description>
            <dc:creator>niksos</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 05 Jan 2010 07:21:12 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,142550#msg-142550</guid>
            <title>Re: Quick Authentication + Avatar + Permissions</title>
            <link>https://www.phorum.org/support/read.php?28,17178,142550#msg-142550</link>
            <description><![CDATA[ Quick authentication is quick authentication. It checks whether the user is logged into Phorum or not. For the rest, there is no code. There&#039;s no magic cool way to have all of Phorum&#039;s goodies outside of the Phorum code. It can probably be done, but to me it seems like turning the world up-side-down. When you need all that Phorum stuff, then it&#039;s probably easier to create your pages through some module or by including much more of the Phorum core than the stripped down quick authentication alone.<br />
<br />
But either way: not an easy job. You need to be a programmer to implement the functionality that you request for there.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Mon, 04 Jan 2010 13:55:57 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,142548#msg-142548</guid>
            <title>Quick Authentication + Avatar + Permissions</title>
            <link>https://www.phorum.org/support/read.php?28,17178,142548#msg-142548</link>
            <description><![CDATA[ Hi, I&#039;m trying to integrate Phorum with my website using Quick Authentication, but I need to show the user&#039;s avatar on certain parts of the site, also I need to verify if the user has the permissions to see the page...<br />
<br />
Can Quick Authentication help me to do that or do I need another module? What can I do? Any ideas?]]></description>
            <dc:creator>maguu</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Mon, 04 Jan 2010 11:52:15 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141581#msg-141581</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141581#msg-141581</link>
            <description><![CDATA[ It looks a bit like the $USER environment variable (that is set to &quot;root&quot; when the webserver is started) is loaded into the $USER global variable.<br />
<br />
This indicates that your provider has the option &quot;register_globals&quot; enabled on the PHP configuration. You might want to inform them about this and request to disable that option. It&#039;s one of those ancient PHP quirks that the PHP people want to get rid of a.s.a.p. themselves, because it can cause security issues in code (not Phorum&#039;s code BTW, we are aware of this and do our utter best to prent security issues on any configuration).]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 10:01:47 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141579#msg-141579</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141579#msg-141579</link>
            <description><![CDATA[ My provider said, that this is probably a behaviour of the recently installed php5 version]]></description>
            <dc:creator>nds</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 09:27:22 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141577#msg-141577</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141577#msg-141577</link>
            <description><![CDATA[ I don&#039;t know if you should be worried. Some code on your website is setting $USER to value &quot;root&quot;. I have no insight whatsoever in what code would be doing that. I can therefore not tell you whether you should be worried or not.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 07:50:21 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141576#msg-141576</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141576#msg-141576</link>
            <description><![CDATA[ Hm, very curious. I could swear to high heaven, that I changed nothing, what could cause this. Should I be worried about it?<br />
<br />
Btw: Thank you for your fast support, the problem is solved by changing the name of the variable.]]></description>
            <dc:creator>nds</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 07:39:33 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141569#msg-141569</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141569#msg-141569</link>
            <description><![CDATA[ Heh, &quot;root&quot; was the example that I first had in mind, but I decided to go for &quot;richard&quot; to make it less geeky ;-)<br />
<br />
Whatever the case is here, it is not the Phorum code that is messing up the $USER variable. There&#039;s some other code on your system that is doing this. Most probably some new code that was added recently, if this behavior started only recently.<br />
<br />
One thing that you can do, is change the quick authentication script by substituting all USER occurrences with PHORUMUSER or so. After doing that, you can use $GLOBALS[&#039;PHORUMUSER&#039;] in your scripts instead of $GLOBALS[&#039;USER&#039;].]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 07:04:01 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141568#msg-141568</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141568#msg-141568</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>Maurice Makaay</strong><br />
I doubt that this is the provider&#039;s doing.<br />
Please check what the output of this is:</div></blockquote>
<br />
root]]></description>
            <dc:creator>nds</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 06:20:16 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141566#msg-141566</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141566#msg-141566</link>
            <description><![CDATA[ I doubt that this is the provider&#039;s doing.<br />
Please check what the output of this is:<br />
<br />
[code=&quot;php&quot;]<br />
&lt;?php<br />
print &quot;&lt;xmp&gt;&quot;;<br />
print_r($GLOBALS[&#039;USER&#039;]);<br />
print &quot;&lt;/xmp&gt;&quot;;<br />
?&gt;<br />
[/code]<br />
<br />
My guess is that some code sets $USER to a string (like &quot;richard&quot;) and that $GLOBALS[&#039;USER&#039;][&#039;user_id&#039;] therefore translates to the first character in that string<br />
<br />
(Since $USER is not an array but a string in this case, the &#039;user_id&#039; will translate to an integer 0 (zero), which points at the first character in the string)]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 05:52:37 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,141565#msg-141565</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,141565#msg-141565</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>Maurice Makaay</strong><br />
That is a lot less that what you stated above. If it&#039;s only the hello part that you need, then after including the quick authentication code you can use something like this (untested code):<br />
<pre class="bbcode">
&lt;?php
if ( isset($GLOBALS[&#039;USER&#039;]) &amp;&amp; !empty($GLOBALS[&#039;USER&#039;][&#039;user_id&#039;]) ) {
    $display_name = htmlspecialchars($GLOBALS[&#039;USER&#039;][&#039;display_name&#039;]);
    print &quot;Hello, $display_name!&quot;;
} else {
    print &quot;Hello, world!&quot;;
}
?&gt;
</pre></div></blockquote>
<br />
Hi Maurice,<br />
<br />
the code you recommendet worked fine for the last year. But since a few days it produces &quot;Hello, r!&quot;, when i am not logged in. I changed nothing, perhaps the provider did an php update.<br />
<br />
Thanx for your suppestions!]]></description>
            <dc:creator>nds</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 28 Oct 2009 05:47:15 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138666#msg-138666</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138666#msg-138666</link>
            <description><![CDATA[ It looks like that code is inside some function or so then, where the global variable $USER is not visible (&quot;out of scope&quot;). What you could do for easier code writing (especially when you are using $USER repeatedly), is globalizing $USER before using it:<br />
<br />
[code=php]<br />
global $USER;<br />
<br />
if($USER[&quot;user_id&quot;]){<br />
    echo &quot;logged in&quot;;<br />
} else {<br />
    echo &quot;logged out&quot;;<br />
}<br />
[/code]]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Mon, 15 Jun 2009 05:25:44 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138664#msg-138664</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138664#msg-138664</link>
            <description><![CDATA[ Wow.  Here was the problem the whole time.<br />
<br />
Wrong<br />
<pre class="bbcode">
if($USER[&quot;user_id&quot;]){
    echo &quot;logged in&quot;;
} else {
    echo &quot;logged out&quot;;
}</pre>
<br />
Right<br />
<pre class="bbcode">
if($GLOBALS[&#039;USER&#039;][&#039;user_id&#039;]){
    echo &quot;logged in&quot;;
} else {
    echo &quot;logged out&quot;;
}</pre>
<br />
That&#039;s what I get for copy/pasting code and not paying attention.]]></description>
            <dc:creator>strangebeer</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 18:54:50 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138663#msg-138663</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138663#msg-138663</link>
            <description><![CDATA[ Understood.  <br />
<br />
I just replaced my errant print statement with the print_r statement and it spit out everything having to do with my account.  I now know it&#039;s not quick_auth.php.  I will continue to trace the problem.<br />
<br />
Thanks for your help thus far.]]></description>
            <dc:creator>strangebeer</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 18:46:17 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138662#msg-138662</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138662#msg-138662</link>
            <description><![CDATA[ That is exactly what I&#039;d expect to be in there: an array (containing no data or a bunch of user data). To see what&#039;s in the user data array, use <span style="color:#009900">print_r($GLOBALS[&#039;USER&#039;])</span> instead. You cannot display an array&#039;s contents using a simple print statement.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 18:36:19 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138659#msg-138659</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138659#msg-138659</link>
            <description><![CDATA[ I&#039;ve interspersed print statements throughout quick_auth.php.  Below is what follows.  The bold <b>HERE</b>s indicate where the script went:<br />
<br />
<pre class="bbcode">
&lt;?php

<b>HERE</b> print &quot;&lt;p&gt;quick_auth.php loaded&lt;br /&gt;&quot;; #DEBUG LINE
if(isset($_COOKIE[&quot;phorum_session_v5&quot;])){
<b>HERE</b> print &quot;_COOKIE[\&quot;phorum_session_v5\&quot;] set&lt;br /&gt;&quot;; #DEBUG LINE
    if(isset($PHORUM[&quot;user&quot;])){
print &quot;_PHORUM[\&quot;user\&quot;] set&lt;br /&gt;&quot;; #DEBUG LINE

        $GLOBALS[&quot;USER&quot;] = $PHORUM[&quot;user&quot;];

    } else {

<b>HERE</b> print &quot;_PHORUM[\&quot;user\&quot;] not set&lt;br /&gt;&quot;; #DEBUG LINE
        define(&quot;PHORUM&quot;, &quot;quick_auth&quot;);

        // wrap all this in a function to protect it and other code
        function check_session()
        {
            // one of these needs to be commented out.
            $require = &quot;sessid_lt&quot;;  // long term cookie that will exist over time
            //$require = &quot;sessid_st&quot;; // short term cookie that may not be required at all, but is more secure
<b>HERE</b> print &quot;Require: $require&lt;br /&gt;&quot;;
            include_once($_SERVER[&quot;DOCUMENT_ROOT&quot;].&quot;/board/include/db/config.php&quot;);
            list( $user_id, $sess_id ) = explode( &quot;:&quot;, $_COOKIE[&quot;phorum_session_v5&quot;], 2 );

            $conn=mysql_connect($PHORUM[&quot;DBCONFIG&quot;][&quot;server&quot;], $PHORUM[&quot;DBCONFIG&quot;][&quot;user&quot;], $PHORUM[&quot;DBCONFIG&quot;][&quot;password&quot;], true);
            mysql_select_db($PHORUM[&quot;DBCONFIG&quot;][&quot;name&quot;], $conn);

            $sql=&quot;select * from &quot;.$PHORUM[&quot;DBCONFIG&quot;][&quot;table_prefix&quot;].&quot;_users where user_id=&#039;&quot;.mysql_escape_string($user_id).&quot;&#039; and $require=&#039;&quot;.mysql_escape_string($sess_id).&quot;&#039;&quot;;

            $res=mysql_query($sql, $conn);

            if(mysql_num_rows($res)){
<b>HERE</b> print &quot;Results found for &quot;.$PHORUM[&quot;DBCONFIG&quot;][&quot;table_prefix&quot;].&quot;_users where user_id=&#039;&quot;.mysql_escape_string($user_id).&quot;&lt;br /&gt;&quot;; #DEBUG LINE
                $USER=mysql_fetch_assoc($res);

                $sql=&quot;select data from &quot;.$PHORUM[&quot;DBCONFIG&quot;][&quot;table_prefix&quot;].&quot;_settings where name=&#039;PROFILE_FIELDS&#039;&quot;;

                $res=mysql_query($sql, $conn);
                if(mysql_num_rows($res)){
<b>HERE</b> print &quot;Data found for &quot;.$PHORUM[&quot;DBCONFIG&quot;][&quot;table_prefix&quot;].&quot;_settings where name=&#039;PROFILE_FIELDS&#039; &lt;br /&gt;&quot;; #DEBUG LINE
                    $fields=unserialize(mysql_result($res, 0, &quot;data&quot;));

                    $sql=&quot;select * from &quot;.$PHORUM[&quot;DBCONFIG&quot;][&quot;table_prefix&quot;].&quot;_user_custom_fields where user_id=&#039;&quot;.mysql_escape_string($user_id).&quot;&#039;&quot;;

                    $res=mysql_query($sql, $conn);
                    if(mysql_num_rows($res)){
                        while($row=mysql_fetch_assoc($res)){
<b>HERE</b> print &quot;Row data: &quot;.$row[&quot;data&quot;].&quot;&lt;br /&gt;&quot;;
                            $USER[$fields[$row[&quot;type&quot;]][&quot;name&quot;]]=$row[&quot;data&quot;];
                        }
                    }
                }

            } else {
print &quot;No user found&lt;br /&gt;&quot;; #DEBUG LINE
                $USER=array();
            }</pre>
Everything goes great until I get to this point.  The following print statement elicits the value &quot;Array&quot; as what is inside $GLOBALS[&quot;USER&quot;].  That doesn&#039;t seem right to me.<br />
<pre class="bbcode">
            $GLOBALS[&quot;USER&quot;]=$USER;
<b>HERE</b> print &quot;GLOBALS[&#039;USER&#039;]: &quot;.$GLOBALS[&quot;USER&quot;].&quot;&lt;br /&gt;&quot;;
        }


        check_session();
    }
}


?&gt;

</pre>]]></description>
            <dc:creator>strangebeer</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 17:04:55 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138658#msg-138658</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138658#msg-138658</link>
            <description><![CDATA[ Well, in that case it should work.<br />
Try to do some debugging to see if the quick auth script is loaded and what route it is following.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 16:36:22 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138657#msg-138657</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138657#msg-138657</link>
            <description><![CDATA[ Ah.. you are correct, however it was in there.  I just neglected to reflect it above.  I&#039;ve edited that post accordingly.]]></description>
            <dc:creator>strangebeer</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 15:32:02 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138656#msg-138656</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138656#msg-138656</link>
            <description><![CDATA[ One step that is not in your complete process description, is the actual inclusion of the quick auth script in your front page code. Based on your description, that would be the first available culprit.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 15:30:02 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,138655#msg-138655</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,138655#msg-138655</link>
            <description><![CDATA[ I think I&#039;m missing something really obvious, here -- I didn&#039;t see any 1,2,3 steps to implementing this script so I figured it was pretty easy.<br />
<br />
<u>My complete process:</u><br />
I downloaded the most recent version (quick_auth.php, ver 5.2), plopped it in my /lib directory, put the following in my front page:<br />
<br />
<pre class="bbcode">
require_once(&quot;/home/dcshows/www/lib/quick_auth.php&quot;);

if($USER[&quot;user_id&quot;]){
    echo &quot;logged in&quot;;
} else {
    echo &quot;logged out&quot;;
}</pre>
<br />
and I get the &quot;logged out&quot; printout.  I&#039;ve checked my phorum_session_v5 cookie and I am on the same domain with the path set as /.  I&#039;m also currently logged in to my phorum.  I feel like I&#039;m missing something.]]></description>
            <dc:creator>strangebeer</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 14 Jun 2009 15:25:44 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,137189#msg-137189</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,137189#msg-137189</link>
            <description><![CDATA[ Well, that result would be a sign that the script did not find a logged in Phorum user. So you are either nog logged in or the script does not have access to the Phorum authentication cookie. No access to the cookie could have various reasons:<br />
<br />
<ul><li> You are accessing the forum on a different domain / hostname than the main site; </li><li> Phorum is inside a subdirectory and the cookie path in the general settings was changed to reflect that; </li><li> Other reasons that I didn&#039;t think of. </li></ul>
<br />
It&#039;s hard to tell what the exact problem is for you. You&#039;ll have to do some more debugging on the code. Focus on the cookie retrieval for starters. When a Phorum cookie is available, the rest should be a breeze.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 15 Mar 2009 17:52:49 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,137184#msg-137184</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,137184#msg-137184</link>
            <description><![CDATA[ Yeah, I tried that, but it doesn&#039;t work...<br />
The file has been included successfully, I tried that by having an echo &quot;a&quot;; in the quick_auth-5.2.php.<br />
But the arry is not defined.<br />
I get<br />
[code=&quot;html4strict&quot;]<br />
&lt;br /&gt; &lt;b&gt;Notice&lt;/b&gt;: Undefined index: USER in &lt;b&gt;/....php&lt;/b&gt; on line &lt;b&gt;90&lt;/b&gt;&lt;br /&gt; <br />
[/code]<br />
when I used the first code you posted.<br />
Do you have any idea what the mistake could be?<br />
Thanks!]]></description>
            <dc:creator>munich</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 15 Mar 2009 14:25:31 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,137182#msg-137182</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,137182#msg-137182</link>
            <description><![CDATA[ As you can read in the script itself, the user data is stored in the global variable $USER. The fields that are in that variable can easily be dumped on the screen by using a bit of code like:<br />
<br />
[code=&quot;php&quot;]<br />
print &quot;&lt;xmp&gt;&quot;;<br />
print_r($GLOBALS[&#039;USER&#039;]);<br />
print &quot;&lt;/xmp&gt;&quot;;<br />
<br />
// or what will most probably work too:<br />
<br />
print &quot;&lt;xmp&gt;&quot;;<br />
print_r($USER);<br />
print &quot;&lt;/xmp&gt;&quot;;<br />
[/code]]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 15 Mar 2009 14:13:45 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,137180#msg-137180</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,137180#msg-137180</link>
            <description><![CDATA[ Great script! Ahm, but I have one question, how do I access the variables?<br />
I include the file with:<br />
[code=&quot;php&quot;]<br />
include &quot;./quick_auth-5.2.php&quot;;<br />
[/code]<br />
<br />
I guess the user data is stored in an array, but what&#039;s the name of the array and what are the names of the elements?<br />
<br />
Thanks,<br />
munich]]></description>
            <dc:creator>munich</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 15 Mar 2009 13:56:47 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,132543#msg-132543</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,132543#msg-132543</link>
            <description><![CDATA[ what are you trying to do? this script is not supposed to be run inside phorum but in another part of your page to check if a user is logged into phorum or not.]]></description>
            <dc:creator>Thomas Seifert</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 10 Aug 2008 12:02:41 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,132539#msg-132539</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,132539#msg-132539</link>
            <description><![CDATA[ Hi I don&#039;t really understand how to download this. Do you just download it to /mods? Thanks]]></description>
            <dc:creator>SecretNinjaMan Maker</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Sun, 10 Aug 2008 11:53:24 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,128246#msg-128246</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,128246#msg-128246</link>
            <description><![CDATA[ This exact code works for me. I copied the 5.2 quick auth script and my propsed code, updated the path to Phorum and ran the script. It said &quot;Hello, admin!&quot; to me.<br />
<br />
Check your browser to see if you have a cookie name &quot;phorum_session_v5&quot;.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Fri, 15 Feb 2008 09:06:37 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,128245#msg-128245</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,128245#msg-128245</link>
            <description><![CDATA[ I do not know I my friend sorry but this code does not act, &quot;Hello, world!&quot; shows all the time ... If  I am logged or not <br />
:(]]></description>
            <dc:creator>re5pect</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Fri, 15 Feb 2008 08:41:56 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,128242#msg-128242</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,128242#msg-128242</link>
            <description><![CDATA[ That is a lot less that what you stated above. If it&#039;s only the hello part that you need, then after including the quick authentication code you can use something like this (untested code):<br />
<pre class="bbcode">
&lt;?php
if ( isset($GLOBALS[&#039;USER&#039;]) &amp;&amp; !empty($GLOBALS[&#039;USER&#039;][&#039;user_id&#039;]) ) {
    $display_name = htmlspecialchars($GLOBALS[&#039;USER&#039;][&#039;display_name&#039;]);
    print &quot;Hello, $display_name!&quot;;
} else {
    print &quot;Hello, world!&quot;;
}
?&gt;
</pre>]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Fri, 15 Feb 2008 05:59:42 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,17178,128241#msg-128241</guid>
            <title>Re: Quick Authentication</title>
            <link>https://www.phorum.org/support/read.php?28,17178,128241#msg-128241</link>
            <description><![CDATA[ thx !!  this working but I dont need header and footer :/<br />
<br />
<br />
<br />
I need code which only this display<br />
<br />
{IF LOGGEDIN}<br />
  Hello, {USER-&gt;display_name}!<br />
{ELSE}<br />
  Hello, world!<br />
{/IF}<br />
<br />
<br />
On my other part]]></description>
            <dc:creator>re5pect</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Fri, 15 Feb 2008 04:33:24 -0600</pubDate>
        </item>
    </channel>
</rss>
