承接 fulgurio/light-cms-user-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fulgurio/light-cms-user-bundle

Composer 安装命令:

composer require fulgurio/light-cms-user-bundle

包简介

Users module of LigthCMS bundle

README 文档

README

This bundle for LightCMS is the user manager bundle.

To use it, just follow these steps :

  1. Install LightCMSBundle and configure it
  2. Download this bundle
  3. Enable the Bundle
  4. Import routing
  5. Configure your yml files
  6. Add new user account

Step 1: Install LightCMSBundle and configure it

Follow the installation doc to install LightCMS.

Step 2: Download this bundle

Add this line into your composer.json file

{
    "require": {
        "fulgurio/light-cms-user-bundle" : "dev-master"
    }
}

After, just launch composer, it will load all dependencies

$ ./composer update

Step 3: Enable the bundle

Finally, enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Fulgurio\LightCMSUserBundle\FulgurioLightCMSUserBundle(),
    );
}

Step 4: Import routing file

You need to put the following line before FulgurioLightCMSBundle routing :

# app/config/routing.yml
FulgurioLightCMSUserBundle:
    resource: "@FulgurioLightCMSUserBundle/Resources/config/routing.yml"
    prefix:   /

Step 5: Configure your yml files

You need to set on the anonymous access, and to limit admin access. Edit config/security.yml file and put the following configuration :

security:
    encoders:
        Symfony\Component\Security\Core\User\UserInterface: plaintext
    providers:
        lightcms:
            entity:
                class: Fulgurio\LightCMSUserBundle\Entity\User
                property: username
    firewalls:
        lightcms_secured_area:
            form_login:
                provider:   lightcms
                login_path: /login
                check_path: /login_check
            logout:
                path:       /logout
                target:     /
            anonymous:      ~
    access_control:
        - { path: ^/admin/, roles: ROLE_ADMIN }

Step 6: Add new user account

Now, you need to add your first user. To do that, there's a command with the console :

$ ./app/console user:add

user:add username password email [role]

Just type your login informations, like :

./app/console user:add admin mypassword admin@foo.bar ROLE_ADMIN

Note: you need to use the role which is allowed to access to /admin, in this document, it's ROLE_ADMIN. Actually, roles are unused, there's no difference between ROLE_USER or ROLE_ADMIN.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-1.0-or-later
  • 更新时间: 2015-05-02