ogogo / forgotpassword
此包最新版本(1.1)没有可用的许可证信息。
为 ZfcUser (自定义) 添加忘记密码功能
1.1
2016-07-05 13:01 UTC
Requires
- php: >=5.3.3
- ogogo/mailservice: *
- zendframework/zendframework: 2.*
- zf-commons/zfc-base: 0.*
- zf-commons/zfc-user: 1.4.*
This package is not auto-updated.
Last update: 2024-09-24 17:24:48 UTC
README
版本 1.0 由 Finbarr 创建
简介
一个 Zend Framework 2 (ZF2) 模块,为 ZfcUser 提供通过电子邮件重置密码的功能
信息
要求
- Zend Framework 2 (最新主分支)。
- ZfcBase (最新主分支)。
- ZfcUser (最新主分支)。
- MailService (最新主分支)。
特性/目标
- 添加可插拔行为以请求密码重置 [已完成]
- 提供更新的登录视图 [已完成]
安装
主要设置
使用 composer
-
将此项目和需求添加到您的 composer.json 中
"require": { "ogogo/forgotpassword": "1.0" }
-
现在运行以下命令以让 composer 下载 ZfcUser
$ php composer.phar update
安装后
-
在您的
application.config.php
文件中启用它。<?php return array( 'modules' => array( // ... 'ZfcBase', 'ZfcUser', 'MailService', 'ForgotPassword' ), // ... );
-
然后导入位于
./vendor/ogogo/forgotpassword/data/schema.sql
的 SQL 模式。 -
确保 MailService 配置正确。
安装后:Zend\Db
-
如果您在服务管理器配置中还没有有效的 Zend\Db\Adapter\Adapter,请在
./config/autoload/database.local.php
中放入以下内容<?php $dbParams = array( 'database' => 'changeme', 'username' => 'changeme', 'password' => 'changeme', 'hostname' => 'changeme', ); return array( 'service_manager' => array( 'factories' => array( 'Zend\Db\Adapter\Adapter' => function ($sm) use ($dbParams) { return new Zend\Db\Adapter\Adapter(array( 'driver' => 'pdo', 'dsn' => 'mysql:dbname='.$dbParams['database'].';host='.$dbParams['hostname'], 'database' => $dbParams['database'], 'username' => $dbParams['username'], 'password' => $dbParams['password'], 'hostname' => $dbParams['hostname'], )); }, ), ), );
安装后:Doctrine2 ORM
有一个额外的模块用于 Doctrine 集成 ForgotPasswordORM
使用方法
导航到 http://yourproject/user,您应该会进入登录页面。
选项
ForgotPassword 模块提供了一些选项,允许您快速自定义基本功能。安装后,将 ./vendor/ogogo/forgotpassword/config/forgotpassword.global.php.dist
复制到 ./config/autoload/forgotpassword.global.php
并根据需要更改值。
以下选项可用
- password_entity_class - 要使用的实体类名称。如果使用默认提供的实体类,则很有用。默认为
RememberMe\Entity\RememberMe
。 - reset_expire - 当登录 cookie 应该过期时的秒数整数值。默认为
86400
(24小时)。 - email_transport - 要使用的传输类字符串值。默认为
Zend\Mail\Transport\Sendmail
。 - reset_email_subject_line - 要使用的传输类字符串值。默认为
您请求重置密码
。 - email_from_address - 数组默认为
array( 'email' => 'your_email_address@here.com', 'name' => '您的姓名', )
。