定制 l91/sulu-website-user-bundle 二次开发

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

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

l91/sulu-website-user-bundle

Composer 安装命令:

composer require l91/sulu-website-user-bundle

包简介

Sulu Bundle for Website Login, Registration, Double Opt-In, Password Forget/Reset, Profile

README 文档

README

WE MOVED!!!

We did a complete rewrite of the bundle for sulu 1.3.0. Use the following bundle for all future uses:

https://github.com/sulu/SuluCommunityBundle

When use it?

You use Sulu to build an application, intranet, shop, ... where users can login, register and need to manage their contact data on the website. This bundle will give all basics you need:

  • Website Security User Role
  • Login Form
  • Registration Form
  • Password Forget / Reset Form
  • Profile Form
  • Double Opt-In, Single Opt-In or Admin activation
  • Notification Emails for every action (User + Admin)
  • Multiple WebSpace Support

Installation

0. Install over composer

composer require l91/sulu-website-user-bundle:~1.0
composer install

1. Add Security Bundle to WebsiteKernel

app/WebsiteKernel.php:

$bundles[] = new Symfony\Bundle\SecurityBundle\SecurityBundle();

2. Add Bundle to AbstractKernel:

app/AbstractKernel.php:

new L91\Sulu\Bundle\WebsiteUserBundle\L91SuluWebsiteUserBundle(),

3. Add new routes to routing config

app/config/website/routing.yml and app/config/admin/routing.yml:

l91_sulu_website_user:
    type: portal
    resource: "@L91SuluWebsiteUserBundle/Resources/config/routing.yml"

4. Add Security system to your webspace

app/Resources/webspaces/<your_webspace>.xml:

    <security>
        <system>Website</system>
    </security>

5. Update your website security file

app/config/website/security.yml:

Example:

security:
    session_fixation_strategy: none

    access_decision_manager:
        strategy: affirmative

    acl:
        connection: default

    encoders:
        Sulu\Bundle\SecurityBundle\Entity\User:
            algorithm: sha512
            iterations: 5000
            encode_as_base64: false

    providers:
        sulu:
            id: sulu_security.user_provider

    access_control:
        - { path: /profile, roles: ROLE_USER }

    firewalls:
        website:
            pattern: (login|profile|logout)
            anonymous: ~
            form_login:
                login_path: l91_sulu_website_user.login
                check_path: l91_sulu_website_user.login
            logout:
                path: l91_sulu_website_user.logout
                target: l91_sulu_website_user.login

sulu_security:
    checker:
        enabled: true

6. Create your Templates

Create the following templates in your theme under <your_theme>/templates/security. (see https://github.com/alexander-schranz/sulu-website-user-bundle/tree/master/Resources/themes/default/templates/security as examples)

  • login.html.twig
  • registration.html.twig
  • confirmation.html.twig
  • password-forget.html.twig
  • password-reset.html.twig
  • profile.html.twig
  • emails/registration-user.html.twig
  • emails/password-forget-user.html.twig
  • embed/login.html.twig

Update Liip Theme Bundle with your Bundle

sulu/sulu#1966

app/config/config.yml:

liip_theme:
    path_patterns:
        app_resource:
            - %%app_path%%/../../src/Client/Bundle/WebsiteBundle/Resources/themes/%%current_theme%%/%%template%%

7. Set Config

app/config/config.yml:

Basic:

l91_sulu_website_user:
    webspaces:
        <webspace_key>:
            from: no-reply@example.at

Extended:

l91_sulu_website_user:
    webspaces:
        <webspace_key>:
            from: no-reply@example.at
            to: ~
            reply_to: ~
            subject: ~
            role: Website
            form_types:
                contact: L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\ContactType
                contact_address: L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\ContactAddressType
                address: L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\ContactAddressType
            login:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                templates:
                    form: '::templates/security/login.html.twig'
                    form_embed: '::templates/security/embed/login.html.twig'
                    admin: ~
                    user: ~
            registration:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                activate_user: false
                form_type: 'L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\RegistrationType'
                templates:
                    form: '::templates/security/registration.html.twig'
                    admin: ~
                    user: '::templates/security/emails/registration-user.html.twig'
            confirmation:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                activate_user: true
                form_type: 'L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\ConfirmationType'
                templates:
                    form: '::templates/security/confirmation.html.twig'
                    admin: ~
                    user: ~
            password_forget:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                form_type: 'L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\PasswordForgetType'
                templates:
                    form: '::templates/security/password-forget.html.twig'
                    admin: ~
                    user: '::templates/security/emails/password-forget-user.html.twig'
            password_reset:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                form_type: 'L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\PasswordResetType'
                templates:
                    form: '::templates/security/password-reset.html.twig'
                    admin: ~
                    user: ~
            profile:
                from: ~
                to: ~
                reply_to: ~
                subject: ~
                form_type: 'L91\Sulu\Bundle\WebsiteUserBundle\Form\Type\ProfileType'
                templates:
                    form: '::templates/security/profile.html.twig'
                    admin: ~
                    user: ~

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固