<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — who really successfully integrate mediawiki and punbb?]]></title>
		<link>https://punbb.informer.com/forums/topic/19634/who-really-successfully-integrate-mediawiki-and-punbb/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/19634/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in who really successfully integrate mediawiki and punbb?.]]></description>
		<lastBuildDate>Sun, 14 Sep 2008 04:03:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117653/#p117653</link>
			<description><![CDATA[<p>Problem solved!</p><p>The newest version of MediaWiki (1.13.1) dose not support this funtion: <strong>AutoAuthenticate</strong></p><p>So my friend changed to use MediaWiki ver.1.21, this version support this function. And then we use the following codes and succeeded in the end <img src="https://punbb.informer.com/forums/img/smilies/wink.png" width="15" height="15" alt="wink" />:</p><div class="codebox"><pre><code>&lt;?php
# PunBB MediaWiki extension

if( !defined( &#039;MEDIAWIKI&#039; ) )
die();

$wgExtensionCredits[&#039;other&#039;][] = array(
    &#039;name&#039; =&gt; &#039;PunBB Authentication&#039;,
    &#039;description&#039; =&gt; &#039;Auto-authenticates the current PunBB user&#039;,
    &#039;author&#039; =&gt; &#039;Bradley Bell&#039;
);


# PunBB integration

//define(&#039;FORUM_QUIET_VISIT&#039;, 1);
define(&#039;FORUM_ROOT&#039;, &#039;/home/andywxy/andywxy.cn/arch/&#039;);
require FORUM_ROOT.&#039;include/common.php&#039;;

$wgHooks[&#039;AutoAuthenticate&#039;][] = &#039;AutoAuthenticatePunBB&#039;;
$wgHooks[&#039;UserLogout&#039;][] = &#039;UserLogoutPunBB&#039;;
$wgHooks[&#039;UserLoginForm&#039;][] = &#039;UserLoginFormPunBB&#039;;

function AutoAuthenticatePunBB(&amp;$user) {
        global $forum_user;

        if ($forum_user[&#039;is_guest&#039;]) {
                return true;
        }

        $user = User::newFromName(ucfirst(strtolower($forum_user[&quot;username&quot;])));
        if ( $user-&gt;getID() == 0 ) {
                $user-&gt;addToDatabase();
                $user-&gt;setId($user-&gt;idFromName(ucfirst(strtolower($forum_user[&quot;username&quot;]))));
                $user-&gt;setToken();
                $user-&gt;setRealName($forum_user[&#039;realname&#039;]);
                $user-&gt;setEmail($forum_user[&#039;email&#039;]);
                $user-&gt;confirmEmail();
                if ($forum_user[&#039;g_id&#039;] == FORUM_ADMIN) {
                        $user-&gt;addGroup(&quot;sysop&quot;);
                }
        } else {
                /* Should cache some day, I guess :) */
                $user-&gt;loadFromDatabase();
                $user-&gt;setToken();
        }

        return true;
}

function UserLogoutPunBB(&amp;$user) {
        global $forum_user;
    $target_url = &#039;logout&#039;.$forum_user[&#039;id&#039;];
        $referer = $_SERVER[&#039;HTTP_REFERER&#039;] ? $_SERVER[&#039;HTTP_REFERER&#039;] : &#039;index.php&#039;;
    $token = &#039;&amp;csrf_token=&#039;. sha1(str_replace(&#039;&amp;amp;&#039;, &#039;&amp;&#039;, $target_url) . $forum_user[&#039;csrf_token&#039;]);
    //$token =&quot;&quot;;
        redirect(&#039;../login.php?action=out&amp;id=&#039;.$forum_user[&#039;id&#039;].$token.&#039;&amp;redirect_url=&#039;.$referer, &#039;Logging out now ....&#039;);
}

function UserLoginFormPunBB(&amp;$template) {
        $referer = $_SERVER[&#039;HTTP_REFERER&#039;] ? $_SERVER[&#039;HTTP_REFERER&#039;] : &#039;index.php&#039;;
    redirect(&#039;../login.php?redirect_url=&#039;.$referer, &#039;Loggin now ....&#039;);
        #header(&#039;Location: http://arch.andywxy.cn/login.php?redirect_url=&#039;.$referer);
       return true;
}

?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (AndyWxy)]]></author>
			<pubDate>Sun, 14 Sep 2008 04:03:14 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117653/#p117653</guid>
		</item>
		<item>
			<title><![CDATA[Re: who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117609/#p117609</link>
			<description><![CDATA[<p>PunBB 1.3 is using the POST data to log user in via login.php.<br />See <a href="http://punbb.informer.com/trac/browser/punbb/branches/punbb-1.3-dev/upload/login.php#L44">http://punbb.informer.com/trac/browser/ … in.php#L44</a></p><p>Try to send POST data to <a href="http://arch.abc.cn/login.php">http://arch.abc.cn/login.php</a><br />Google out how to do this right.</p>]]></description>
			<author><![CDATA[null@example.com (Anatoly)]]></author>
			<pubDate>Thu, 11 Sep 2008 15:17:08 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117609/#p117609</guid>
		</item>
		<item>
			<title><![CDATA[Re: who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117605/#p117605</link>
			<description><![CDATA[<p>Thank you Anatoly! I just change all the &quot;pun_&quot; and &quot;PUN_&quot; to &quot;forum_&quot; and &quot;FORUM_&quot;, and set the paths to my website. However, when I click login/register in MediaWiki, the whole page turns me back to the index page of my PunBB forum ...</p><p>It seems that there is a redirect problem when accessing PunBB&#039;s account information, following it my remodified PunBBAuth.php file:</p><div class="codebox"><pre><code>&lt;?php
# PunBB MediaWiki extension

if( !defined( &#039;MEDIAWIKI&#039; ) )
die();

$wgExtensionCredits[&#039;other&#039;][] = array(
    &#039;name&#039; =&gt; &#039;PunBB Authentication&#039;,
    &#039;description&#039; =&gt; &#039;Auto-authenticates the current PunBB user&#039;,
    &#039;author&#039; =&gt; &#039;Bradley Bell&#039;
);


# PunBB integration

//define(&#039;FORUM_QUIET_VISIT&#039;, 1);
define(&#039;FORUM_ROOT&#039;, &#039;/home/abc/abc.cn/arch/&#039;);
require FORUM_ROOT.&#039;include/common.php&#039;;

$wgHooks[&#039;AutoAuthenticate&#039;][] = &#039;AutoAuthenticatePunBB&#039;;
$wgHooks[&#039;UserLogout&#039;][] = &#039;UserLogoutPunBB&#039;;
$wgHooks[&#039;UserLoginForm&#039;][] = &#039;UserLoginFormPunBB&#039;;

function AutoAuthenticatePunBB(&amp;$user) {
        global $forum_user;

        if ($forum_user[&#039;is_guest&#039;]) {
                return true;
        }


        $user = User::newFromName(ucfirst(strtolower($forum_user[&quot;username&quot;])));
        if ( $user-&gt;getID() == 0 ) {
                $user-&gt;addToDatabase();
                $user-&gt;setId($user-&gt;idFromName(ucfirst(strtolower($forum_user[&quot;username&quot;]))));
                $user-&gt;setToken();
                $user-&gt;setRealName($forum_user[&#039;realname&#039;]);
                $user-&gt;setEmail($forum_user[&#039;email&#039;]);
                $user-&gt;confirmEmail();
                if ($forum_user[&#039;g_id&#039;] == FORUM_ADMIN) {
                        $user-&gt;addGroup(&quot;sysop&quot;);
                }
        } else {
                /* Should cache some day, I guess :) */
                $user-&gt;loadFromDatabase();
                $user-&gt;setToken();
        }

        return true;
}

function UserLogoutPunBB(&amp;$user) {
        global $forum_user;

        redirect(&#039;../login.php?action=out&amp;id=&#039;.$forum_user[&#039;id&#039;], &#039;Logging out. Redirecting &amp;hellip;&#039;);
}

function UserLoginFormPunBB(&amp;$template) {
        $referer = $_SERVER[&#039;HTTP_REFERER&#039;] ? $_SERVER[&#039;HTTP_REFERER&#039;] : &#039;index.php&#039;;
        header(&#039;Location: http://arch.abc.cn/login.php?redirect_url=&#039;.$referer);
       return true;
}

?&gt;</code></pre></div><p>The situation of mine is:</p><p>I installed PunBB 1.3rc in <strong>abc.cn/arch</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MediaWiki 1.13.1 in <strong>abc.cn/wiki</strong></p><p>And I change the &quot;cookie_domain = .abc.cn&quot; in config.php</p>]]></description>
			<author><![CDATA[null@example.com (AndyWxy)]]></author>
			<pubDate>Thu, 11 Sep 2008 12:04:16 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117605/#p117605</guid>
		</item>
		<item>
			<title><![CDATA[Re: who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117595/#p117595</link>
			<description><![CDATA[<p><a href="http://www.mediawiki.org/wiki/Extension:PunBB_Authentication">Tihs</a> must be a PunBB 1.2 integration mediawiki-extension.<br />It won&#039;t work with 1.3 branch.</p><p>Nevertheless, you may try to update this extension.<br />First of all, replace all &quot;$pun_&quot; with &quot;$forum_&quot; and &quot;PUN_&quot; with &quot;FORUM_&quot;.<br />And PunBB URLs may need to be updated proper way.</p>]]></description>
			<author><![CDATA[null@example.com (Anatoly)]]></author>
			<pubDate>Thu, 11 Sep 2008 07:51:33 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117595/#p117595</guid>
		</item>
		<item>
			<title><![CDATA[Re: who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117583/#p117583</link>
			<description><![CDATA[<p>I have used this extension with mediawiki 1.1.3.1 and punbb 1.3rc, but nothing happens after that, either.</p><p>In the half way it says FORUM_ROOT should be defined first so I define it the same as the PUN_ROOT. However, after I sign into punbb and then switch to mediawiki, it still ask me for account to access. Im faint ... what is the key?</p>]]></description>
			<author><![CDATA[null@example.com (AndyWxy)]]></author>
			<pubDate>Wed, 10 Sep 2008 13:17:16 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117583/#p117583</guid>
		</item>
		<item>
			<title><![CDATA[who really successfully integrate mediawiki and punbb?]]></title>
			<link>https://punbb.informer.com/forums/post/117066/#p117066</link>
			<description><![CDATA[<p>I&#039;ve searched around the post on this topic, and i know there&#039;re many requests on that, and some extensions like this are avaliable: <br /><a href="http://www.mediawiki.org/wiki/Extension:PunBB_Authentication">http://www.mediawiki.org/wiki/Extension … entication</a></p><p>but after my trials, i still can&#039;t install them correctly. I&#039;m using mediawiki 1.12 and punbb 2. Could anyone confirm me if there&#039;s actually any extension to integrate both systems (mw1.12 and punbb2) ?</p>]]></description>
			<author><![CDATA[null@example.com (zozzen)]]></author>
			<pubDate>Fri, 08 Aug 2008 04:56:31 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/117066/#p117066</guid>
		</item>
	</channel>
</rss>
