定制 telixj/phpbb-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

telixj/phpbb-bundle

最新稳定版本:3.1.0

Composer 安装命令:

composer require telixj/phpbb-bundle

包简介

Symfony integration with phpBB

README 文档

README

Symfony integration with phpBB. Use phpBB as a authentication provider and share its sessions.

Configuration

First of all, make sure in your application to ignore the phpBB tables, by using (This is needed for each entity manager):

doctrine:
    dbal:
        schema_filter: ~^(?!phpbb_)~

where phpbb_ is your table prefix for tables generated by phpBB. Not making this configuration change can cause your forum tables to be deleted!

Then, if you have your forum in other database, add a custom entity_manager and dbal to your doctrine connections:

doctrine:
    dbal:
        default_connection: default
        connections:
            acme: # this is an example for your website's database but it's not required
                driver:   "%database_driver%"
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  "UTF8"
            forum:
                driver:   "%forum_database_driver%"
                host:     "%forum_database_host%"
                port:     "%forum_database_port%"
                dbname:   "%forum_database_name%"
                user:     "%forum_database_user%"
                password: "%forum_database_password%"
                charset:  "UTF8"

    orm:
        entity_managers:
            default: # same here, not required, but you will probably have this in your configuration
                connection: default
            forum:
                connection: forum
                mappings:
                    PhpbbBundle: ~

Then add the bundle configuration to config/packages/phpbb.yaml

phpbb:
    session:
        cookie_name: "phpbb_foo" # must match your forum admin cookie name configuration
        login_page: "ucp.php?mode=login" # your login page, by default phpbb login page but you can use a custom page
        force_login: false # if true, anonymous users will be redirected to the login page
    database:
        entity_manager: "forum" # must match the key bellow doctrine.orm.entity_managers
        prefix: "phpbb_" # change this if you do not use the default "phpbb_" prefix
    roles: #relation between group_id from groups table of phpBB and roles of your application
        1: anonymous #GUESTS
        2: user #REGISTERED
        4: moderator #GLOBAL_MODERATORS
        5: administrator #ADMINISTRATORS
        6: bot #BOTS
        7: app_role_name #example of new group create in phpBB and new role in your application
        8: administrator #you can assing same application roles to various phpBB groups

Update your config/packages/security.yaml to match this:

security:
    enable_authenticator_manager: true
    firewalls:
        main:
            pattern: ^/
            stateless: true # stateless should be set to true, or your symfony user may be stored in the session even if you logged out from the phpbb instance
            custom_authenticators:
                - TeLiXj\PhpbbBundle\Security\PhpbbSessionAuthenticator

And to use remember me function you must edit the ucp.php in your forum to enable the redirection after detect a correct session key. Change the line redirect(append_sid("{$phpbb_root_path}index.$phpEx")); to redirect($request->variable('redirect', append_sid("{$phpbb_root_path}index.$phpEx")));

Missing functionality

There are some few edge functionality missing:

  • Session IP validation is considered as "A.B.C", no matter what you specified in your Admin Control Panel configuration

统计信息

  • 总下载量: 341
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2023-12-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固