<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Passing authentificator using own login</title>
        <description> Hi,

i know that this is the thousands thread about intergrating phorum in a selfmade site. I read mostly all others threads about that topic, but now im stuck at a point where even that doenst help me anymore.

After many frustrating hours and several coffees I finally made it to set the phorums session and cookie using the userid from my session. The embed-module by mkay was a big help until here.
But I still can&amp;#039;t write messages or go to my profile in phorum, because of the authenticator (i think it is in user.php). I really dont know how to say phorum, after I loaded cookie and session and fed GLOBAL[PHORUM][user] and [LOGGEDIN] and [PHOURM_SESSION_LONGTERM] with the right values, that the user is really logged in and so it doesnt have to show the login-form and send the user directly to the desired page.

I could have used the embed-module but there are used to many functions i just dont need. I simply get a user_id from another session and log in the user with this id in phorum. The rest still should be handled by phorum itself.

Hope you can help,

luki</description>
        <link>https://www.phorum.org/phorum5/read.php?28,121035,121035#msg-121035</link>
        <lastBuildDate>Sat, 14 Mar 2026 01:58:07 -0400</lastBuildDate>
        <generator>Phorum 5.2.22</generator>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121081#msg-121081</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121081#msg-121081</link>
            <description><![CDATA[ Well, I do not know what goes wrong on your setup. I just tested a simple embedding setup with the embed module and disabled cookies. Things went just fine after that. I still was logged in as the user returned by $connector-&gt;get_user_id(). So something is going wrong in your customized code. Time to do some debugging I guess.<br />
<br />
One thought: isn&#039;t the site which you are integrating with depending on cookies? So see if get_user_id() is really returning the user_id that you are expecting there. If you made a direct copy of my code, then it sounds like get_user_id() is return NULL instead of a valid user_id.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Thu, 22 Mar 2007 07:12:17 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121077#msg-121077</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121077#msg-121077</link>
            <description><![CDATA[ Well, I did this, too. But when I disable cookies in my browser im not logged in anymore because the sessionid is no longer saved in the GET_VARS.]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Thu, 22 Mar 2007 05:02:49 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121069#msg-121069</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121069#msg-121069</link>
            <description><![CDATA[ In the module, I tell Phorum that cookies are not used by overriding the &quot;use_cookies&quot; setting in the common_pre hook. So any logic around &quot;are cookies enabled?&quot; is futile. All that Phorum sees is a user which does not use  cookies, but URI authenticattion to keep track of the user session.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 14:17:22 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121065#msg-121065</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121065#msg-121065</link>
            <description><![CDATA[ Thank you very much for your help. Just to refresh your memory: The function were you &quot;clean that mess&quot; as you call it, is common_pre_user. ;) But you just unset the [GET_VARS] without checking if cookies are enabled or not (by forum or by browser). Or is that done somewhere else? Shouldn&#039;t it do it when i just aks if cookies are enabled by forum AND if the browser has enabled cookies and then unset the [GETVARS} and else not?<br />
<br />
Hope this was my last question! Thanks again for your great help.<br />
<br />
Lukas]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 13:42:13 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121061#msg-121061</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121061#msg-121061</link>
            <description><![CDATA[ You should really read the rest of the embedding module. You are reinventing the wheel here ;-) The embedding module does some additional work (from the top of my head, this is done in the common hook) to get rid of the URI authentication after Phorum has recognized the user.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 09:21:45 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121060#msg-121060</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121060#msg-121060</link>
            <description><![CDATA[ Hmm, just as I thought. So this couldnt be the reason why my login doesnt work completely.<br />
<br />
Cookies are set, Database written and $GLOBALS[PHORUM][&quot;args&quot;][PHORUM_SESSION_LONG_TERM] set to current session id (as in database). But phorum only shows me as logged in user, when I set LOGGEDIN and FULLY_LOGGEDIN to 1. What could I do else?<br />
<br />
Edit: Sorry, my fault. Changed the name of the function to common_pre but not the hook (before the pipe). Nearly as worse as forgetting a semicolon (;). Shame on me. :(<br />
<br />
Edit2: Hmm but now, when I click a link phorum always sends the sessionid with the link (sessionid is visible). I thought thats only when cookies are disabled?]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 09:13:04 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121059#msg-121059</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121059#msg-121059</link>
            <description><![CDATA[ The only reason for me to set the cookie through an image, is to make sure that there won&#039;t be problems if other parts of the software already printed info, in which case I cannot set a header anymore (the famous error about being able to send header data, because output started at ...). With this image hack, setting the cookie will work in all environments. If in your environment setting a cookie at that point is no problem, then do so. There&#039;s no  difference in these two methods. A cookie is a cookie is a cookie.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 08:23:32 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121058#msg-121058</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121058#msg-121058</link>
            <description><![CDATA[ okay, i had a look and noticed that the only thing i dont have is setting the cookie though an image. i just set the cookie as normal and it works. do i have to set the cookie with an image to let the phorum set the [LOGGEDIN] values by itself?]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 08:17:12 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121052#msg-121052</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121052#msg-121052</link>
            <description><![CDATA[ If you do the same as in the embedding module, then it should work. So you apparently not doing the same here. Do you generate a cookie and store it with the user data? Do you setup Phorum to disable tight security and cookie auth? Basically check against the source of the embedding module if you really are doing the same.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 07:30:40 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121050#msg-121050</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121050#msg-121050</link>
            <description><![CDATA[ Hmm, okay I used just common. Now I changed it to common_pre and took out [LOGGEDIN]=1 and [FULLY_LOGGEDIN=1]. But when I refresh the page now, im not logged in anymore.<br />
<br />
I think I did the same you do in your module too. Any ideas?]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 07:00:40 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121048#msg-121048</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121048#msg-121048</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
Is that the row where you fake the URI? Because I use that too, but its not enough to convince phorum that the usewr is logged in. </div></blockquote>
<br />
Maybe you do it too late. I handle this from the common_pre hook, so the URI auth is set at a really early stage.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
Edit: What happens in your module when you deactivate cookies in your browser?</div></blockquote>
<br />
Depends on the master application. Phorum does not care, since it gets the authentication handed over from the master. If the master handles authentication without cookies, then so does Phorum. The only thing is that without cookies, the embedding code will not be able to store the embedding session cookie. This will not affect the functionality of the module. It will only cause some code to be run less efficient.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 06:48:59 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121046#msg-121046</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121046#msg-121046</link>
            <description><![CDATA[ // Setup (fake) URI authentication for Phorum to recognize the user.<br />
    $GLOBALS[&quot;PHORUM&quot;][&quot;args&quot;][PHORUM_SESSION_LONG_TERM] = $sessid;<br />
<br />
Is that the row where you fake the URI? Because I use that too, but its not enough to convince phorum that the usewr is logged in.<br />
<br />
The reaon why I dont use your module, although it is great :) , is that still need some things controled by phorum. For example I have no need of the module feature where it puts phorum in an outputbuffer to place it between my other page. phorum still runs on an own subdomain and just have to know which user is logged in at the mainpage.<br />
<br />
Security. Thats one point where im still not sure if my module is good. Well, I just get a user_id from a session, use that user_id to create/load a phorum session and cookie and fake a logged in user. Could that be wrong? I dont know that much about security and phorum to be sure that my method is secure.<br />
<br />
Edit: What happens in your module when you deactivate cookies in your browser?]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 21 Mar 2007 05:29:48 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121038#msg-121038</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121038#msg-121038</link>
            <description><![CDATA[ Of course you should have used the embed module ;-) Even though you don&#039;t use many of its features, it&#039;s still the easiest way (IMO, but I am predudiced) to fit Phorum in a website. Providing a user_id to Phorum is one of the key features in fact.<br />
<br />
You now have followed a different path to convince Phorum that the user is authenticated. Based on the description, it doesn&#039;t look like a really bad method. The difference between the embed module and your method is that the embed module tries to setup a minimal fake URI authentication where Phorum will setup the correct environment after that. So I don&#039;t have to tinker with the authentication related environment variables myself from the module. In the long run, that might be the safest way, because no adaption to new internal code is needed that way.]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 20 Mar 2007 14:50:26 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121036#msg-121036</guid>
            <title>Re: Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121036#msg-121036</link>
            <description><![CDATA[ Okay, i just got the solution, even if im not quite sure if it is correct and clean. I also set [FULLY_LOGGEDIN] to 1 in my module. Now I can log in at my site and then surf and post in phorum. If im not logged in i&#039;ve just reading permissions. That is exactly what i wanted, but i have a bad feeling about the way I choose.]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 20 Mar 2007 14:02:34 -0400</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?28,121035,121035#msg-121035</guid>
            <title>Passing authentificator using own login</title>
            <link>https://www.phorum.org/phorum5/read.php?28,121035,121035#msg-121035</link>
            <description><![CDATA[ Hi,<br />
<br />
i know that this is the thousands thread about intergrating phorum in a selfmade site. I read mostly all others threads about that topic, but now im stuck at a point where even that doenst help me anymore.<br />
<br />
After many frustrating hours and several coffees I finally made it to set the phorums session and cookie using the userid from my session. The embed-module by mkay was a big help until here.<br />
But I still can&#039;t write messages or go to my profile in phorum, because of the authenticator (i think it is in user.php). I really dont know how to say phorum, after I loaded cookie and session and fed GLOBAL[PHORUM][user] and [LOGGEDIN] and [PHOURM_SESSION_LONGTERM] with the right values, that the user is really logged in and so it doesnt have to show the login-form and send the user directly to the desired page.<br />
<br />
I could have used the embed-module but there are used to many functions i just dont need. I simply get a user_id from another session and log in the user with this id in phorum. The rest still should be handled by phorum itself.<br />
<br />
Hope you can help,<br />
<br />
luki]]></description>
            <dc:creator>luuuki</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 20 Mar 2007 13:40:17 -0400</pubDate>
        </item>
    </channel>
</rss>
