costsrl / cost-authentication
基于DoctrineORMModule的认证
Requires
- php: >=7.0
README
什么是CostAuthentication?
CostAuthentication具体做什么?
CsnUser是为了教育目的而创建的,以演示如何进行认证。它是完全功能的。
CsnUser模块包括
- 带“记住我”的登录
- 带验证码和确认邮件的注册
- 带确认邮件的忘记密码。
此外,密码有两级保护 - 动态盐和静态盐。
还有什么用途?
在添加更多功能的基础上,ZfcUser的替代方案。
安装
- 在应用配置文件
./config/application.config.php
中添加CostAuthentication
、DoctrineModule
和DoctrineORMModule
。示例配置可能如下所示
http://git.cost.it/cost/cost-authentication.git 的 'master' 分支
'modules' => array(
'Application',
'DoctrineModule',
'DoctrineORMModule',
'CostAuthentication'
)
配置
CostAuthentication需要设置Doctrine连接、简单的邮件配置以及导入数据库模式。
-
创建一个新的数据库(或使用现有的数据库,专门用于您的应用)。
-
将
./vendor/cost/cost-authentication/config/doctrineorm.local.php.dist
中的样本Doctrine配置复制到./config/autoload
,将其重命名为 doctrineorm.local.php。编辑文件,将值(用户名、密码等)替换为您自己的数据库参数。 -
运行
./vendor/bin/doctrine-module orm:schema-tool:create
生成数据库模式。导入位于./vendor/cost/cost-authentication/data/SampleData.sql
的样本SQL数据(用于默认角色和语言)。例如,可以使用 PhpMyAdmin 来完成此操作。 -
将样本邮件配置从
./vendor/cost/cost-authentication/config/mail.config.local.php.dist
复制到./config/autoload
,将其重命名为 mail.config.local.php。编辑文件,将值(主机、用户名等)替换为您的SMTP服务器参数。 -
依赖:Database覆盖Enity "User"类在data/EntityPlatform下并重命名它。选项
CostAuthentication模块有一些选项,允许您快速自定义基本功能。
在安装CostAuthentication后,在vendor目录下创建novigo文件夹。将 ./vendor/cost/cost-authentication/config/cost-authentication.global.php.dist
复制到 ./config/autoload
,重命名为 cost-authentication.global.php 并根据说明更改值。
以下选项可用
- STATIC_SALT 常量字符串值,在哈希之前添加到密码之前
- login_redirect_route 字符串值,应用中用户登录成功后将被重定向到的路由名称。
- logout_redirect_route 字符串值,用户登出后将被重定向到的应用中的路由名称。
- nav_menu 布尔值,显示或隐藏导航菜单。
准备好了吗?
在浏览器中导航到 [主机名]/user 以查看登录、注册、忘记密码等不同选项。
依赖项
此模块依赖于以下模块
-
[DoctrineORMModule] (https://github.com/doctrine/DoctrineORMModule) - DoctrineORMModule可以将Doctrine 2 ORM与Laminas Framework 2快速且容易地集成。
推荐
https://rsalvatori_novigo@bitbucket.org/novigoteam/cost-authentication.git 的 'laminas' 分支
- https://gitlab.cost.it/cost/cost-authentication 的 'laminas' 分支
- cost/cost-authentication;