定制 flowpack/neos-frontendlogin 二次开发

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

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

flowpack/neos-frontendlogin

Composer 安装命令:

composer require flowpack/neos-frontendlogin

包简介

Neos plugin demonstrating a simple frontend login

README 文档

README

Neos plugin demonstrating a simple "frontend login"

DISCLAIMER

This package mainly serves for demonstration purpose. You should be fine using it in productive applications, but if you need any custom behavior/style it's probably the easiest to create your own login form plugin. It's just a few files.

Setup & Use

  • Install the package to Packages/Plugin/Flowpack.Neos.FrontendLogin (e.g. via composer require flowpack/neos-frontendlogin)
  • Login to the Neos backend and create a new page "Login" (e.g. at /login)
  • On that page insert the new plugin Frontend login form
  • (Optionally) create a page (and subpages) for a "Members area" (e.g. at /members) and protect it as documented below
  • Publish all changes
  • Create a new Frontend User using the UI (in "Management > Frontend Users")
  • Alternatively you can use the neos.neos:user:create command (e.g. ./flow user:create --authentication-provider "Flowpack.Neos.FrontendLogin:Frontend" --roles "Flowpack.Neos.FrontendLogin:User")

Now you should be able to test the frontend login by navigating to /login.html

Protected Member Area

If you want to create a "Member Area" that is only visible to authenticated frontend users, add the following Policy.yaml to your site package:

privilegeTargets:

  'Neos\ContentRepository\Security\Authorization\Privilege\Node\ReadNodePrivilege':

    'Acme.YourPackage:MembersArea':
        # Replace <NodeIdentifier> with the node's identifier to be targeted (you can see the identifier in the "Additional info"
        # group in the Property Inspector of the Neos Backend)
      matcher: 'isDescendantNodeOf("<NodeIdentifier>")'


roles:

  'Flowpack.Neos.FrontendLogin:User':
    privileges:
      -
          # Grant "frontend users" access to the "Member area"
        privilegeTarget: 'Acme.YourPackage:MembersArea'
        permission: GRANT


  'Neos.Neos:Editor':
    privileges:
      -
          # Grant "backend users" to access the "Member area" - Otherwise those pages would be hidden in the backend, too!
        privilegeTarget: 'Acme.YourPackage:MembersArea'
        permission: GRANT

The specified node and all its child-nodes will be hidden from anonymous users!

Note: Replace "Acme.YourPackage" with the package key of your site package and replace "<NodeIdentifier>" with the node identifier of the "member area" node (as described).

Rewriting the template path to your package

You might want to modify the template(s) according to your needs. Create a Views.yaml file and add the following configuration there:

-
  requestFilter: 'isPackage("Flowpack.Neos.FrontendLogin") && isController("Authentication") && isAction("index")'
  options:
    templatePathAndFilename: 'resource://Acme.YourPackage/Private/Templates/Authenticate/Index.html'

Adjust the actual value in templatePathAndFilename to your needs and copy the original template to that location in order to adjust it at will.

Redirect after login/logout

It is possible to specify pages the user will be redirected to after login and/or logout (since version 2.1.) in the login form properties.

Hint: In order to redirect to an external URL you can create a Shortcut node pointing to that URL and specify it as target for the redirect options.

User management UI

The user management UI is available to administrators and everyone else having the role Flowpack.Neos.FrontendLogin.Ui:UserAdministrator.

It allows to manage users with the Flowpack.Neos.FrontendLogin:Frontend authentication provider exclusively.

Remove expired users

The CLI command user:deleteexpired can be used to remove expired users.

It will delete all users having exactly one account with the Flowpack.Neos.FrontendLogin:Frontend authentication provider.

flowpack/neos-frontendlogin 适用场景与选型建议

flowpack/neos-frontendlogin 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 224.8k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2015 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 flowpack/neos-frontendlogin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 flowpack/neos-frontendlogin 我们能提供哪些服务?
定制开发 / 二次开发

基于 flowpack/neos-frontendlogin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 10
  • Forks: 19
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-25