![]() |
|
prestaForumConnectorPlugin - 1.0.4Provide an easy way to connect an user management system to the forum solution of your choice. |
|
![]() |
17
users
Sign-in
to change your status |
The prestaForumConnectorPlugin aims to provide an easy way to connect an user management system to the forum solution of your choice. Just choose the connectors of you choice for the user management system on one part and for the forum solution, follow the install instructions and you will be able to use the same user database and the same login process. For example, this will allow you to connect sfGuard to phpBB3. Currently only sfGuard (Propel or Doctrine versions) and phpBB3 are supported. More will come. |
The prestaForumConnectorPlugin aims to provide an easy way to connect an user management system to the forum solution of your choice.
IMPORTANT : this plugin was designed for phpBB 3.0.6 and sfDoctrineGuardPlugin 4.X. If you use other versions, it is necessary to validate that the existing connectors are functional. We will not make further changes to this plugin and we will not correct the problems raised, unless a patch is being provided and we just have to integrate it and create a new minor release.
Just choose the connectors of your choice for the user management system on one part and for the forum solution, follow the install instructions and you will be able to use the same user database and the same login process.
For example, this will allow you to connect sfGuard to phpBB3. Currently only sfGuard (Propel or Doctrine versions) and phpBB3 are supported.
Orginally developed by Prestaconcept for it's projects.
| Name | Status | |
|---|---|---|
|
|
lead | ten.tpecnocatserp <<ta>> tevilodc |
|
|
lead | ten.tpecnocatserp <<ta>> ydnarm |
Copyright (c) 2009 PrestaConcept
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
| Version | License | API | Released |
|---|---|---|---|
| 1.0.5stable | MIT license | 1.0.5stable | 07/06/2012 |
| 1.0.4stable | MIT license | 1.0.0stable | 09/12/2010 |
| 1.0.3stable | MIT license | 1.0.0stable | 05/01/2010 |
| 1.0.2stable | MIT license | 1.0.0stable | 04/01/2010 |
| 1.0.1stable | MIT license | 1.0.0stable | 29/12/2009 |
| 1.0.0stable | MIT license | 1.0.0stable | 24/11/2009 |
| Version | License | API | Released |
|---|---|---|---|
| 1.0.5stable | MIT license | 1.0.5stable | 07/06/2012 |
| 1.0.4stable | MIT license | 1.0.0stable | 09/12/2010 |
| 1.0.3stable | MIT license | 1.0.0stable | 05/01/2010 |
| 1.0.2stable | MIT license | 1.0.0stable | 04/01/2010 |
| 1.0.1stable | MIT license | 1.0.0stable | 29/12/2009 |
| 1.0.0stable | MIT license | 1.0.0stable | 24/11/2009 |
| Version | License | API | Released |
|---|---|---|---|
| 1.0.5stable | MIT license | 1.0.5stable | 07/06/2012 |
| 1.0.4stable | MIT license | 1.0.0stable | 09/12/2010 |
| 1.0.3stable | MIT license | 1.0.0stable | 05/01/2010 |
| 1.0.2stable | MIT license | 1.0.0stable | 04/01/2010 |
| 1.0.1stable | MIT license | 1.0.0stable | 29/12/2009 |
| 1.0.0stable | MIT license | 1.0.0stable | 24/11/2009 |
| Version | License | API | Released |
|---|---|---|---|
| 1.0.5stable | MIT license | 1.0.5stable | 07/06/2012 |
| 1.0.4stable | MIT license | 1.0.0stable | 09/12/2010 |
| 1.0.3stable | MIT license | 1.0.0stable | 05/01/2010 |
| 1.0.2stable | MIT license | 1.0.0stable | 04/01/2010 |
| 1.0.1stable | MIT license | 1.0.0stable | 29/12/2009 |
| 1.0.0stable | MIT license | 1.0.0stable | 24/11/2009 |
Add pgSQL compatibility Fixed admin permissions when you promote an user Update README file Update unit tests
The prestaForumConnectorPlugin aims to provide an easy way to connect an user management system to the forum solution of your choice.
Just choose the connectors of your choice for the user management system on one part and for the forum solution, follow the install instructions and you will be able to use the same user database and the same login process.
For example, this will allow you to connect sfGuard to phpBB3. Currently only sfGuard (Propel or Doctrine versions) and phpBB3 are supported. More will come.
Extending the plugin in order to create a connector to an other user management system can be done very quickly.
Install the plugin
./symfony plugin:install prestaForumConnectorPlugin ./symfony cc
Be sure to have the plugin enabled in /config/ProjectConfiguration.class.php
In /config/ProjectConfiguration.class.php in setup method add a connector to the clear:cache task event in order to clear forum cache when clearing project's cache
// listen to symfony's clear:cache task's event $this->dispatcher->connect( 'task.cache.clear', array( 'prestaForumFactory', 'listenToClearCacheEvent' ) );
In /config/database.yml be sure to have a connection for the database that will contain forum's tables (can be the same database as for the project or a different one).
In /config/app.yml add the following options (and personalize them for your needs)
all:
prestaForumConnector:
userConnector:
class: presta%%UsedUserConnectorName%%Connector # the name of the connector to use (here we use sfGuardPropel as user management tools)
# param:
# for the required parameters see the help related to the connector that you're using
forumConnector:
class: presta%%UsedForumConnectorName%%Connector # the name of the connector to use (here we use phpBB3 as forum platform tools)
# param:
# for the required parameters see the help related to the connector that you're using
forumWebDir: <?php echo sfConfig::get('sf_web_dir');?>/forum/ # path to the forum directory
forumDatabaseId: default # the identifier of the database connection to use for the forum solution as defined in database.ymlIf necessary add the following line to .htaccess file under the "RewriteEngine On" line
# redirect to the index file if index.php in not present in url for the forum RewriteRule ^forum/$ forum/index.php [QSA,L]
See the help related to the connectors you use for continuing the installation.
Once the connector installation is finished launch the patchForum task, that will patch you're forum solution in order to link it with user management system.
./symfony prestaForumConnector:patchForum frontend --env=dev
Once this task is finished and has succeed, you can synchronize your user database.
./symfony prestaForumConnector:synchUser frontend all --env=dev
In /config/app.yml define the following options for the forumConnector
all:
prestaForumConnector:
forumConnector:
class: prestaPhpBB3ConnectorIn /web/index.php Replace
sfContext::createInstance($configuration)->dispatch();
With
if(!defined('SYMFONY_FORUM')) { sfContext::createInstance($configuration)->dispatch(); }
Copy all the forum files inside you're web directory (eg: /web/forum/). Use here the name that will appears in the URL (no .htacess redirection on directory name are actually possible).
Commit your project, in order to have an original version of you're forum code.
Add svn:ignore * (or similar command for your versionning tool) to "/cache/", "/files/", "/store/" and "/images/avatars/upload/" forum's sub-directories (and other cache directories of the eventually installed mod)
Access to the forum in you're navigator and follow the installation instruction of phpBB3.
Commit your project again, in order to have the freshly installed version of you're forum code.
Delete the phpBB3's "install" directory and commit again you're project.
Notice that when some code that interact with this plugin is executed it require that an application has been instanciated. This should always be the case for HTPP request, but not always the case for symfony tasks. So if you use tasks that have an optionnal "application" parameter (like for sfGuardPlugin), ensure to fill this parameter.
In order to promote a user as a super admin, launch the following task once everything has be installed. The user id given here is the user ID of the user management tools
./symfony prestaForumConnector:promoteUser frontend %userIdToPromote% --env=dev
This taks will ask for user's password, and ask if the user should be considered as the forum's founder
If you want to do a forum upgrade (eg from v3.0.5 to v3.0.6), it is recommanded that you reinstall the forum from scratch in order to get the forum patcher to work.
Be sure to have sfGuardPlugin installed and configured
In /config/app.yml define the following option for the userConnector:
all:
prestaForumConnector:
userConnector:
class: prestaSfGuardPropelConnector
param:
getUsernameMethod: getUsername # define here the name of the sfGuardUser's method to use for retrieving the username
getEmailMethod: getEmail # define here the name of the sfGuardUser's method to use for retrieving the email. Can be getUsername if the username is the email. If needed create yourself this method if the email is stored in another table like the profile table.
getCultureMethod: getCulture # define here the name of the sfGuardUser's method to use for retrieving the user's preferred culture. If needed create yourself this method if the culture is stored in another table like the profile table or if it is a constant.Change the parent class in myUser.class.php
class myUser extends prestaForumConnectorSfGuardPropelSecurityUser { }
Add the following methods to sfGuardUser.php in order to synchronize forum's users when sfGuard's users are updated
/** * Override save method in order to update the forum's user * * @see sfGuardPlugin/lib/model/om/BasesfGuardUser#save($con) * @param PropelPDO $con optional connection parameter * @return void */ public function save(PropelPDO $con = null) { parent::save($con); prestaForumFactory::getForumConnectorInstance()->synchUser( $this->getId() ); } /** * Override delete method in order to update the forum's user * * @see sfGuardPlugin/lib/model/plugin/PluginsfGuardUser#delete($con) * @param PropelPDO $con optional connection parameter * @return void */ public function delete(PropelPDO $con = null) { $userId = $this->getId(); parent::delete($con); prestaForumFactory::getForumConnectorInstance()->deleteForumUser( $userId ); }
Be sure to have sfDoctrineGuardPlugin installed and configured
In /config/app.yml define the following option for the userConnector:
all:
prestaForumConnector:
userConnector:
class: prestaSfGuardDoctrineConnector
param:
getUsernameMethod: getUsername # define here the name of the sfGuardUser's method to use for retrieving the username
getEmailMethod: getEmail # define here the name of the sfGuardUser's method to use for retrieving the email (should be getEmailAddress for latest sfDoctrineGuardPlugin). Can be getUsername if the username is the email. If needed create yourself this method if the email is stored in another table like the profile table.
getCultureMethod: getCulture # define here the name of the sfGuardUser's method to use for retrieving the user's preferred culture. If needed create yourself this method if the culture is stored in another table like the profile table or if it is a constant.
Warning: If you use latest sfDoctrineGuardPlugin version with email field included, be sure to redefine the 'getEmailMethod' to 'getEmailAddress'.
Change the parent class in myUser.class.php
class myUser extends prestaForumConnectorSfGuardDoctrineSecurityUser { }
Add the following methods to sfGuardUser.php in order to synchronize forum's users when sfGuard's users are updated
/** * Override save method in order to update the forum's user * * @param Doctrine_Connection $conn optional connection parameter * @return void */ public function save(Doctrine_Connection $conn = null) { parent::save( $conn ); prestaForumFactory::getForumConnectorInstance()->synchUser( $this->getId() ); } /** * Override delete method in order to update the forum's user * * @param Doctrine_Connection $conn optional connection parameter * @return void */ public function delete(Doctrine_Connection $conn = null) { $userId = $this->getId(); parent::delete( $conn ); prestaForumFactory::getForumConnectorInstance()->deleteForumUser( $userId ); }
