<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Amit Yadav &#187; single-login</title>
	<atom:link href="http://www.amityadav.name/tag/single-login/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amityadav.name</link>
	<description>Things to know for effective coding</description>
	<lastBuildDate>Fri, 19 Aug 2011 17:51:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Common Login for phpBB3 and WordPress</title>
		<link>http://www.amityadav.name/test-post/</link>
		<comments>http://www.amityadav.name/test-post/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 19:37:16 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[single-login]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=4</guid>
		<description><![CDATA[I was just working on a site where i have to integrate phpBB3 and wordpress, i tried searching for things on internet but was not able to find a simple and feasible solution for the problem, so i thought of diving into the code and get things working on my own, and wow i got [...]]]></description>
			<content:encoded><![CDATA[<p>I was just working on a site where i have to integrate phpBB3 and wordpress, i tried searching for things on internet but was not able to find a simple and feasible solution for the problem, so i thought of diving into the code and get things working on my own, and wow i got success. Here are the function that you should call to start a phpBB and WordPress session.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.amityadav.name/wp-content/plugins/wp-codebox/wp-codebox.php?p=4&amp;download=auth_function.php">auth_function.php</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p42"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code" id="p4code2"><pre class="text" style="font-family:monospace;">function authenticateForumAdmin($username, $pass)
{
 global $dbObject, $user, $auth, $db;
&nbsp;
 $loginDetails = $auth-&gt;login($username, $pass, false, 1, 1);
&nbsp;
 if($loginDetails[&quot;error_msg&quot;] != &quot;&quot;)
 {
     return false;
 }else{
     return true;
 }
}
&nbsp;
&nbsp;
&nbsp;
function wp_authentication($username, $pass)
{
 global $_POST, $_COOKIE;
&nbsp;
 if (function_exists('get_userdatabylogin')) {
     $user = get_userdatabylogin($username);
&nbsp;
     if (! $user or $username != $user-&gt;user_login) {
	 if ((bool) get_option('http_authentication_auto_create_user')) {
	     // Create user and re-read from database for login (next step)
	     $this-&gt;create_user($username);
	     $user = get_userdatabylogin($username);
	 }
	 else {
	     // User is not in the WordPress database, and thus not authorized
	     die(&quot;User $username does not exist in the WordPress database&quot;);
	 }
     }
&nbsp;
     // Login the user by feeding WordPress a double-MD5 hash
     $password = md5($user-&gt;user_pass);
&nbsp;
     // User is now authorized; force WordPress to use the generated password
     $using_cookie = true;
     wp_setcookie($user-&gt;user_login, $password, $using_cookie);
 }
 else {
     die(&quot;Could not load user data&quot;);
 }
}</pre></td></tr></table></div>

<p>I am still looking for a single sign-on solution for phpBB3 and WordPress. Will post here once i am done with it.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Ftest-post%2F&amp;title=Common%20Login%20for%20phpBB3%20and%20WordPress" id="wpa2a_2"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/test-post/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

