Skip to content

Commit

Permalink
Item1244: joomla -> phpBB3
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/PhpBB3UsersContrib@2981 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
WillNorris authored and WillNorris committed Mar 11, 2009
1 parent d8dc626 commit 8eedf54
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 88 deletions.
45 changes: 21 additions & 24 deletions data/System/PhpBB3UsersContrib.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@

<a href="http://www.joomla.org/" ><img src="%ATTACHURL%/Joomla.png" style="float: right; padding:30px;" /></a>
<a href="http://www.phpbb.com/" ><img src="%ATTACHURL%/PhpBB3.png" style="float: right; padding:30px;" /></a>

---+!! JoomlaUsersContrib Contrib Package
---+!! PhpBB3UsersContrib Contrib Package

*tested with Joomla 1.0.13*
*tested with phpBB3 v3.0.4*


This Contrib enables you to replace the Foswiki User and Groups system with a read only access to the
User and Groups in a [[http://www.joomla.org/][Joomla]] Database. Registration of new users and their
association with Groups is then _only_ handled by Joomla, making it possible to remove the distributed Main web.
User and Groups in a [[http://phpbb.com/][phpBB3]] Database. Registration of new users and their
association with Groups is then _only_ handled by phpBB3, making it possible to remove the distributed Main web.

You are advised to use the same same host for Foswiki and the Joomla Database,
You are advised to use the same same host for Foswiki and the phpBB3 Database,
otherwise user query performance (happens every request) will severely degrade the response time.

*NOTE:* for performance reasons, the Joomla Registered Users group is _not_ brought into the system,
*NOTE:* for performance reasons, the phpBB3 Registered Users group is _not_ brought into the system.
The other groups may cause performance degradation if they have too many members

By selecting JoomlaLogin, Foswiki will also attempt to use the Joomla 'remember me' cookie -
though this requires the Foswiki and Joomla host names to be the same.
<!--
By selecting phpBB3Login, Foswiki will also attempt to use the phpBB3 'remember me' cookie - (CHECK THIS)
though this requires the Foswiki and phpBB3 host names to be the same.
-->

<a href="http://wikiring.com/" ><img src="%ATTACHURL%/wikiringlogo.png" style="float: right; padding:30px;" /></a>

Expand All @@ -27,10 +29,10 @@ Settings are in =lib/LocalSite.cfg=. the Foswiki configure script does not curre
but should also not remove them. See the Installation Instructions below for details.

* One line description:
* Set SHORTDESCRIPTION = replace the Foswiki User and Groups System with Joomla's
* Set SHORTDESCRIPTION = replace the Foswiki User and Groups System with phpBB3's

* Name of the perl package
* Set STUB = authenticate using the joomla users - disable registration.
* Set STUB = authenticate using the phpBB3 users - disable registration.

---++ Installation Instructions
* Download the ZIP file from the Plugin web (see below)
Expand All @@ -39,29 +41,24 @@ Settings are in =lib/LocalSite.cfg=. the Foswiki configure script does not curre

* Run ==%TOPIC%_installer.pl== to automatically check and install other modules that this module depends on. You can also do this step manually. Dependencies:
<table border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">DBIx::SQLEngine</td><td align="left"> &gt;=0.93</td><td align="left">(and its pre-requisites) Extends DBI with High-Level Operations</td></tr><tr><td align="left">DBD::mysql</td><td align="left"> &gt;=3.0000</td><td align="left">(and its pre-requisites) MySQL driver for the Perl5 Database Interface (DBI)</td></tr></table>
* set Foswiki::Users::JoomlaUserMapping as your UserMapping in configure's Security section
* set Foswiki::LoginManager::JoomlaLogin as your LoginManager in configure's Security section
* set Foswiki::Users::PhpBB3UserMapping as your UserMapping in configure's Security section
* set Foswiki::LoginManager::PhpBB3Login as your LoginManager in configure's Security section
* set none as your PasswordManager in configure's Security section
* set the ={AdminGroup}= in the configure security section to one of the Joomla groups (such as =Super Administrator=)
* configure JoomlaUsersContrib from the *User Managers* / *Joomla User Manager* section in configure
* this needs a dbi connection string to your Joomla database, and a valid username and password for it.
* set the ={AdminGroup}= in the configure security section to one of the phpBB3 groups (such as =admin=)
* configure PhpBB3UsersContrib from the *User Managers* / *phpBB3 User Manager* section in configure
* this needs a dbi connection string to your phpBB3 database, and a valid username and password for it.
* Test if the installation was successful:
* __enter sample here__
* see also [[Sandbox.PluginTest%TOPIC%]]

---++ Contrib Info

| Plugin Author: | Foswiki:Main.WillNorris - <img src="%ATTACHURL%/wikiring.png" /> [[http://www.wikiring.com][WikiRing.com]] |
| Plugin Author: | Foswiki:Main.SvenDowideit - of [[http://fosiki.com][fosiki.com]] - <img src="%ATTACHURL%/wikiring.png" /> [[http://www.wikiring.com][WikiRing.com]] |
| Copyright: | &copy; 2006-2009, SvenDowideit@fosiki.com |
| Copyright: | &copy; 2006-2009, SvenDowideit@fosiki.com, &copy; 2009 Will Norris |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Dependencies: | <table border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">DBIx::SQLEngine</td><td align="left"> &gt;=0.93</td><td align="left">(and its pre-requisites) Extends DBI with High-Level Operations</td></tr><tr><td align="left">DBD::mysql</td><td align="left"> &gt;=3.0000</td><td align="left">(and its pre-requisites) MySQL driver for the Perl5 Database Interface (DBI)</td></tr></table> |
| Version: | 138 |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| Mar 2009 | port to Foswiki |
| Sep 2008 | updated to 4.2.1 mapping, and fixed for Joomla 1.0.13 - where the password salts were changed |
| Nov 2007 | updated to TWiki 4.2, and released |
| 2006 | Initial version (not public) |
| 11 Mar 2009 | convert from Foswiki:Extensions.JoomlaUsersContrib |
| Home: | http://foswiki.org/Extensions/%TOPIC% |


-- SvenDowideit@fosiki.com
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/PhpBB3UsersContrib.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Foswiki::Contrib::JoomlaUsersContrib;
package Foswiki::Contrib::PhpBB3UsersContrib;
use vars qw( $VERSION );
$VERSION = '$Rev$';
1;
20 changes: 10 additions & 10 deletions lib/Foswiki/Contrib/PhpBB3UsersContrib/Config.spec
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@


# ---+ User Managers
# ---++ Joomla User Manager
# to use JoomlaUserMapping, you need to set the following settings in the "Security Setup" above
# ---++ phpBB3 User Manager
# to use PhpBB3UserMapping, you need to set the following settings in the "Security Setup" above
# <ol><li>
# UserMappingManager = 'Foswiki::Users::JoomlaUserMapping';
# UserMappingManager = 'Foswiki::Users::PhpBB3UserMapping';
# </li><li>
# SuperAdminGroup = 'Super Administrator';
# </li><li>
# LoginManager = 'Foswiki::LoginManager::JoomlaLogin'; - (This setting will allow TWiki to use the 'stay logged in' cookie that Joomla makes.)
# LoginManager = 'Foswiki::LoginManager::PhpBB3Login'; - (This setting will allow TWiki to use the 'stay logged in' cookie that phpBB3 makes.)
# </li></ol>
# **STRING 25**
# The DSN to connect to the Joomla Database.
$Foswiki::cfg{Plugins}{JoomlaUser}{DBI_dsn} = 'dbi:mysql:joomla_db:localhost';
# The DSN to connect to the phpBB3 Database.
$Foswiki::cfg{Plugins}{PhpBB3User}{DBI_dsn} = 'dbi:mysql:phpBB3_db:localhost';
# **STRING 25**
# The user to connect to the Joomla Database.
$Foswiki::cfg{Plugins}{JoomlaUser}{DBI_username} = 'mysqlpassword';
# The user to connect to the phpBB3 Database.
$Foswiki::cfg{Plugins}{PhpBB3User}{DBI_username} = 'mysqlpassword';
# **PASSWORD**
# The password to connect to the Joomla Database.
$Foswiki::cfg{Plugins}{JoomlaUser}{DBI_password} = 'pwd';
# The password to connect to the phpBB3 Database.
$Foswiki::cfg{Plugins}{PhpBB3User}{DBI_password} = 'pwd';
18 changes: 9 additions & 9 deletions lib/Foswiki/Contrib/PhpBB3UsersContrib/MANIFEST
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
data/System/JoomlaUsersContrib.txt Plugin doc page
lib/Foswiki/Contrib/JoomlaUsersContrib.pm Plugin Perl module
lib/Foswiki/LoginManager/JoomlaLogin.pm use Joomla cookie for session initilaisation
lib/Foswiki/Users/JoomlaUserMapping.pm get User and Group information from Joomla Database
lib/Foswiki/Contrib/JoomlaUsersContrib/Config.spec
pub/System/JoomlaUsersContrib/Joomla.png
pub/System/JoomlaUsersContrib/wikiring.png
pub/System/JoomlaUsersContrib/JoomlaIcon.png
templates/login.joomla.tmpl
data/System/PhpBB3UsersContrib.txt Plugin doc page
lib/Foswiki/Contrib/PhpBB3UsersContrib.pm Plugin Perl module
lib/Foswiki/LoginManager/PhpBB3Login.pm use PhpBB3 cookie for session initilaisation
lib/Foswiki/Users/PhpBB3UserMapping.pm get User and Group information from PhpBB3 Database
lib/Foswiki/Contrib/PhpBB3UsersContrib/Config.spec
pub/System/PhpBB3UsersContrib/PhpBB3.png
pub/System/PhpBB3UsersContrib/wikiring.png
pub/System/PhpBB3UsersContrib/PhpBB3Icon.png
templates/login.phpbb3.tmpl

4 changes: 2 additions & 2 deletions lib/Foswiki/Contrib/PhpBB3UsersContrib/build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use strict;

# Standard preamble
BEGIN { unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ) }
BEGIN { unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ) }

use Foswiki::Contrib::Build;

Expand All @@ -12,7 +12,7 @@ package BuildBuild;

sub new {
my $class = shift;
return bless( $class->SUPER::new( "JoomlaUsersContrib" ), $class );
return bless( $class->SUPER::new( "PhpBB3UsersContrib" ), $class );
}

# Example: Override the build target
Expand Down
12 changes: 6 additions & 6 deletions lib/Foswiki/LoginManager/PhpBB3Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

=pod
---+ package Foswiki::LoginManager::JoomlaLogin
---+ package Foswiki::LoginManager::PhpBB3Login
This is a login manager that you can specify in the security setup section of [[%SCRIPTURL%/configure%SCRIPTSUFFIX%][configure]]. It provides users with a template-based form to enter usernames and passwords, and works with the PasswordManager that you specify to verify those passwords.
Expand All @@ -25,13 +25,13 @@ methods of this class.
=cut

package Foswiki::LoginManager::JoomlaLogin;
package Foswiki::LoginManager::PhpBB3Login;

use strict;
use Assert;
use Foswiki::LoginManager::TemplateLogin;

@Foswiki::LoginManager::JoomlaLogin::ISA = ('Foswiki::LoginManager::TemplateLogin');
@Foswiki::LoginManager::PhpBB3Login::ISA = ('Foswiki::LoginManager::TemplateLogin');

sub new {
my ( $class, $session ) = @_;
Expand All @@ -45,7 +45,7 @@ sub new {
---++ ObjectMethod loadSession()
add Joomla cookie to the session management
add phpBB3 cookie to the session management
=cut

Expand All @@ -54,11 +54,11 @@ sub loadSession {
my $twiki = $this->{twiki};
my $query = $twiki->{cgiQuery};

ASSERT( $this->isa('Foswiki::LoginManager::JoomlaLogin') ) if DEBUG;
ASSERT( $this->isa('Foswiki::LoginManager::PhpBB3Login') ) if DEBUG;

my $authUser = '';

# see if there is a joomla username and password cookie
# see if there is a phpBB3 username and password cookie
#TODO: think i should check the password is right too.. otherwise ignore it
my %cookies = fetch CGI::Cookie;
if ( defined( $cookies{'usercookie[username]'} ) ) {
Expand Down
Loading

0 comments on commit 8eedf54

Please sign in to comment.