Extension talk:Phpbb Single Sign-On

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
1.18, and login either direction322:07, 9 May 2012
Log into wiki first and then into phpBB?022:05, 9 May 2012
Gday everyone, this is my very first posting016:44, 24 April 2012
thank you018:48, 6 April 2012
Using Special:UserLogon and Special:UserLogout in liue of skins modifications315:54, 29 March 2012
1.18207:55, 28 March 2012
Auto-Logout ... not a feature.001:15, 15 February 2012
phpBB Debug - Invalid argument supplied for foreach()017:01, 26 January 2012
Works only with Refresh (F5)119:45, 25 January 2012
Getting this error... :S118:17, 15 January 2012
how do i fix the .$prefsUrl.?107:12, 23 December 2011
Allow access to mediawiki based on group membership303:41, 2 December 2011
1.17 compatibility117:30, 21 October 2011
Comparison with Extension:PHPBB/Users Integration117:29, 21 October 2011
Installation gave an odd error:117:28, 21 October 2011
Use usernames from phpBB008:27, 8 June 2011

1.18, and login either direction

Will you be updating this extension (if necessary) to MW 1.18?

It would be really great if this extension would log the user into phpBB when they log onto the wiki, as well as the other direction. Do you think that is possible? - Amgine 23:45, 10 December 2011 (UTC)

Amgine23:45, 10 December 2011

Hi Amgine, hi all

I found this useful extension and just tried it on a test installation with phpBB.3.0.10 and MW.1.18.1 : it works just fine ! So I guess it isn't necessary, unless there's a bug I still haven't found.

@+ Mutos

Is a user logged into the phpbb when they log into the Wiki?

Amgine (talk)20:06, 4 April 2012

I would like to achieve exactly the same - started a new thread... Hopefully we will get an answer...

Britpoper (talk)22:07, 9 May 2012
 
 
 

Log into wiki first and then into phpBB?

Does the login process also work in the other direction - So that I'm automatically logged into phpBB when I log into the wiki?

If yes, can this extension also be used with MediaWiki 1.19?

Thanks!

Britpoper (talk)22:05, 9 May 2012

Gday everyone, this is my very first posting

Hi everybody! I only wished to tell you greetings. This is my first message here. See you in the near future!

46.227.239.14016:44, 24 April 2012

Thank you for good site. Very helpful. I add your web site in my google reader. I will return again. bye...

71.253.119.2318:48, 6 April 2012

Using Special:UserLogon and Special:UserLogout in liue of skins modifications

Edited by another user.
Last edit: 12:09, 16 December 2011

So far, this plugin is working very well. I just wanted to mention, that instead of using the recommended modification to the skins, I configured Special:UserLogin and Special:UserLogout by modifying the following files:

Add to LocalSettings.php: $wgPhpbbSSO_Forum_URL = '/forum/';

Change phpbSSO.php: from:

        function phpbbSSO_hook() {

to:

   
        $wgSpecialPages['UserLogin'] = 'UserLogin';
        $wgSpecialPageGroups['UserLogin'] = 'other'; 
 
        $wgSpecialPages['UserLogout'] = 'UserLogout';
        $wgSpecialPageGroups['UserLogout'] = 'other';
 
        class UserLogin extends SpecialPage {
                function __construct() {
                        parent::__construct( 'UserLogin' );
                }
 
                function execute( $par ) {
                        global $wgRequest, $wgOut, $wgPhpbbSSO_Forum_URL;
 
                        $this->setHeaders();
 
                        # Get request data from, e.g.
                        $param = $wgRequest->getText('param');
 
                        # Redirect to phpbb Login page
                        $wgOut->redirect( $wgPhpbbSSO_Forum_URL . "ucp.php?mode=login" );
                }
        }
 
        class UserLogout extends SpecialPage {
                function __construct() {
                        parent::__construct( 'UserLogout' );
                }
 
                function execute( $par ) {
                        global $wgRequest, $wgOut, $wgPhpbbSSO_Forum_URL, $wgPhpbbSSO;
 
                        $this->setHeaders();
 
                        # Get request data from, e.g.
                        $param = $wgRequest->getText('param');
 
                        # Redirect to phpbb Login page
                        $wgOut->redirect( $wgPhpbbSSO_Forum_URL . "ucp.php?mode=logout&sid=" . $wgPhpbbSSO->session_id);
                }
        }
 
        function phpbbSSO_hook() {
75.148.42.2118:06, 21 September 2011

Sorry about the formatting for those insertions. Doesn't look like I can fix that after posting.

75.148.42.2118:08, 21 September 2011

Hi.

I tried this mod and I now get the normal MW login screen as desired. However, when I click on the login link nothing happens. I assume it is supposed to go to the phpbb login screen? Any idea why it isn't working? I'm running MW 1.16.5 and phpbb 3.0.9.

Thanks!

I fixed the formatting in your post by the way. Hope you don't mind ;)

Mitchelln12:03, 16 December 2011

Hi all,


Thanks for this modification ! I just used it with phpBB.3.0.10 and MW.1.18.1, had to edit it a little, but now it works just marvelously. I just had two issues with my installation being in French and not in English, then I wanted to do something better in the way of rediection. Everything is described below...

First, for non-English-wikiing users:

  • I had to use the translated version of "UserLogin" and "UserLogout" in for instance $wgSpecialPages['UserLogout'] so that the plugin finds the right classes. For me in French, it gives for instance:
       $wgSpecialPages['Connexion'] = 'UserLogin';
       $wgSpecialPageGroups['Connexion'] = 'other'; 

       $wgSpecialPages['Deconnexion'] = 'UserLogout';
       $wgSpecialPageGroups['Deconnexion'] = 'other';
  • Second, as French uses accents in "Logout" translation : I had to suppress accented letters from the "Logout" page title while keeping them in the display. All this lies in the MessagesFr.php file, giving:
       'Userlogout'                => array( 'Deconnexion' ),

Moreover, I wanted to get redirected to the current page whenever I logged in or out, and I had to modify phpbSSO.php, and upc.php in phpBB to get this result. First, I made phpbSSO.php call ucp.php with the extra parameter redirect containing the URL of the current page. Then, I found out that this worked on login, but not on logout. There was a hack described on the net, that I applied and it worked. Below are my edits:

In phpbSSO.php

       class UserLogin extends SpecialPage {
               function __construct() {
                       parent::__construct( 'UserLogin' );
               }

               function execute( $par ) {
                       global $wgRequest, $wgOut, $wgPhpbbSSO_Forum_URL, $wgServer, $wgScriptPath, $wgScriptExtension;

                       $this->setHeaders();

                       # Get request data from, e.g.
                       $param = $wgRequest->getText('param');
                       $returnTo = $wgRequest->getVal( 'returnto' );

                       # Redirect to phpbb Login page then return to the current page
                       $wgOut->redirect( $wgPhpbbSSO_Forum_URL . "ucp.php?mode=login&redirect=$wgServer$wgScriptPath/index$wgScriptExtension?title=$returnTo" );
               }
       }

       class UserLogout extends SpecialPage {
               function __construct() {
                       parent::__construct( 'UserLogout' );
               }

               function execute( $par ) {
                       global $wgRequest, $wgOut, $wgPhpbbSSO_Forum_URL, $wgPhpbbSSO, $wgServer, $wgScriptPath, $wgScriptExtension;;

                       $this->setHeaders();

                       # Get request data from, e.g.
                       $param = $wgRequest->getText('param');
                       $returnTo = $wgRequest->getVal( 'returnto' );

                       # Redirect to phpbb Logout page then return to the current page
                       $wgOut->redirect( $wgPhpbbSSO_Forum_URL . "ucp.php?mode=logout&sid=" . $wgPhpbbSSO->session_id . "&redirect=$wgServer$wgScriptPath/index$wgScriptExtension?title=$returnTo");
               }
       }

In upc.php

               #meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
               meta_refresh(3, append_sid(request_var('redirect', "{$phpbb_root_path}index.$phpEx")));          

               $message = $message . '

' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . append_sid(request_var('redirect', "{$phpbb_root_path}index.$phpEx")) . '">', '</a> ');

And now it works like a charm !

 
 
 

This doesn't presently appear to be working with 1.18 or 1.17, any chance someone could take a stab at getting this to work again and maybe integrating the Special:UserLogin pages into main article, this is really a god send when it works for integration between the two.

174.100.113.919:42, 29 November 2011

It works in 1.18 if you change

         $phpbbUser = new phpbbSSO();

to

         $phpbbUser = new phpbbSSO('./../forum/');

in skin file

'./../forum/' is forum dir

Zlotek18:12, 27 December 2011

For information : just installed it in a test forum, prior to using it for my site, and it works perfectly OK.

My configuration is the following, with vanilla install of both packages, but in french language :

  • phpBB 3.0.10
  • MediaWiki 1.18.1

I installed it just as it is described in the main article, without any problem.

 
 

Auto-Logout ... not a feature.

I am having a problem with MediaWiki .18. Every time I login to phpBB and go to the Wiki, it shows I am logged in, when I try to edit a page it logges me off. Check it out www.openstora.com/forum. I can't figure out whats happening...

75.74.41.6201:15, 15 February 2012

phpBB Debug - Invalid argument supplied for foreach()

[phpBB Debug] PHP Warning: in file /home/mmalinke/public_html/wiki18/includes/SpecialPageFactory.php on line 519: Invalid argument supplied for foreach()

I get this error every once in a while while browsing the wiki. any suggestions?

Thanks in advance

24.36.161.10017:01, 26 January 2012

Works only with Refresh (F5)

I have a problem. When i log into forum i have to refresh (F5) a wiki to be logged into wiki. How to cope with this?

Zlotek18:16, 28 December 2011

i got the same problem with 1.18... any suggestions?

24.36.161.10019:45, 25 January 2012
 

Getting this error... :S

Notice: Constant IN_PHPBB already defined in /home/****/public_html/wiki/extensions/phpbSSO/phpbb.php on line 34

Fatal error: Call to undefined method User::session_begin() in /home/****/public_html/wiki/extensions/phpbSSO/phpbb.php on line 42

Swstem02:21, 14 December 2011

I believe this is typically an issue when the wiki can not find the phpbb install.

72.195.135.14918:17, 15 January 2012
 

how do i fix the .$prefsUrl.?

the .$prefsUrl. doesn't take me or my users to the preferences page using mediawiki 1.18.

173.81.42.23718:23, 22 December 2011

i somewhat found a way to fix the error. instead of using $prefsurl i used the full link to it.

so i would of put http://www.example.com/wiki/index.php?title=Special:Preferences instead. it worked for me.

this is my code:

<?php                

$phpbbUser = new phpbbSSO();
$forumURL = '../forum';            
 
if($phpbbUser->isAnonymous()){
        //If a logged in user is not part of the group, he's treated as not logged in. Thus we don't display the Login link if group membership is required.
        if(!phpbbSSO::REQUIRE_GROUP){
                echo '<a href="'.$forumURL.'/ucp.php?mode=login" title="Login" accesskey="l">Login</a>
                 / <a href="'.$forumURL.'/ucp.php?mode=register">Register</a>';
        }
}else{
        echo '
        <a href=http://uniquegamers.tk/wiki/index.php?title=Special:Preferences>wiki preferences</a> | 
        <a href="'.$forumURL.'/ucp.php?i=pm&folder=inbox"><strong>'.$phpbbUser->messages.'</strong> new messages</a> | 
        <a href="'.$forumURL.'/ucp.php?mode=logout&sid='.$phpbbUser->session_id.'" title="Logout [ '.$phpbbUser->userName.' ]" accesskey="l">Logout [ '.$phpbbUser->userName.' ]</a>';
}

?>
Deathwish07:12, 23 December 2011
 

Allow access to mediawiki based on group membership

Wow, this is great stuff, actually.

In addition, it would be nice to be able to check group membership and allow access to mediawiki based on that like Extension:PHPBB/Users Integration does.

13:43, 3 June 2011

Done! - Just added this - Will need to configure it to have access to your phpbb DB if used. - Only changed phpbb.php Configuration could probably be moved to local settings, but didnt do that for now.

Noverflow01:48, 18 June 2011

Just made it even better. You dont need to configure anything to enable this any more. No more Database information needed.

Noverflow03:30, 11 July 2011

Any chance you could update this to 1.18?

174.100.113.903:41, 2 December 2011
 
 
 

1.17 compatibility

I tried this with phpBB 3.0.9 and a fresh installation of MediaWiki 1.17, and it didn't work. It doesn't complain anything, but it also doesn't create a new user nor login an existing user. Is this MediaWiki 1.17 compatible yet?

Ef15:16, 16 August 2011

I haven't tried it yet. Sorry.

It may not give an error if errors are suppressed by your wiki. You may need to turn of debugging.

Noverflow17:30, 21 October 2011
 

Comparison with Extension:PHPBB/Users Integration

Hi, What are the advantages of this system to Extension:PHPBB/Users Integration?

--Paul

108.41.198.1300:02, 22 August 2011

This extension does not require that a user log in or out separately on the wiki. When the user logs into the forum, they are also logged into the wiki. When they logout. They are logged out of the wiki as well.

This removes loggin in/out of the wiki.

Noverflow17:29, 21 October 2011
 

Installation gave an odd error:

I installed this on my forum and wiki, and the mediawiki install gave me this in response: Fatal error: Call to a member function session_begin() on a non-object in /home/amglett/public_html/asimovrpg/extensions/phpbSSO/phpbb.php on line 42

What should I do about that?

65.185.108.5111:38, 16 September 2011

Im not sure, but it seems like it can not find your install of phpbb.

Noverflow17:28, 21 October 2011
 

Use usernames from phpBB

To use the very same username as in phpBB, I do the following change in phpbb.php: Replace

$this->username_clean = $this->phpbb_user->data['username_clean'];

by

$this->username_clean = $this->phpbb_user->data['username'];

I use user names like "Firstname Lastname" and it works for me, but is not guaranteed to work with arbitrary user names.

13:46, 7 June 2011
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox