Extension talk:Phpbb Single Sign-On
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| 1.18, and login either direction | 3 | 22:07, 9 May 2012 |
| Log into wiki first and then into phpBB? | 0 | 22:05, 9 May 2012 |
| Gday everyone, this is my very first posting | 0 | 16:44, 24 April 2012 |
| thank you | 0 | 18:48, 6 April 2012 |
| Using Special:UserLogon and Special:UserLogout in liue of skins modifications | 3 | 15:54, 29 March 2012 |
| 1.18 | 2 | 07:55, 28 March 2012 |
| Auto-Logout ... not a feature. | 0 | 01:15, 15 February 2012 |
| phpBB Debug - Invalid argument supplied for foreach() | 0 | 17:01, 26 January 2012 |
| Works only with Refresh (F5) | 1 | 19:45, 25 January 2012 |
| Getting this error... :S | 1 | 18:17, 15 January 2012 |
| how do i fix the .$prefsUrl.? | 1 | 07:12, 23 December 2011 |
| Allow access to mediawiki based on group membership | 3 | 03:41, 2 December 2011 |
| 1.17 compatibility | 1 | 17:30, 21 October 2011 |
| Comparison with Extension:PHPBB/Users Integration | 1 | 17:29, 21 October 2011 |
| Installation gave an odd error: | 1 | 17:28, 21 October 2011 |
| Use usernames from phpBB | 0 | 08:27, 8 June 2011 |
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)
Hi everybody! I only wished to tell you greetings. This is my first message here. See you in the near future!
Thank you for good site. Very helpful. I add your web site in my google reader. I will return again. bye...
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() {
Sorry about the formatting for those insertions. Doesn't look like I can fix that after posting.
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 ;)
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.
It works in 1.18 if you change
$phpbbUser = new phpbbSSO();
to
$phpbbUser = new phpbbSSO('./../forum/');
in skin file
'./../forum/' is forum dir
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.
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...
[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
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?
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
the .$prefsUrl. doesn't take me or my users to the preferences page using mediawiki 1.18.
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>';
}
?>
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.
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.
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?
Hi, What are the advantages of this system to Extension:PHPBB/Users Integration?
--Paul
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?
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.