kaystrobach/password
Composer 安装命令:
composer require kaystrobach/password
包简介
Add description here
README 文档
README
Password Validation Package for version 4.x of the neos/flow framework.
Update for flow 5.x is planned.
Inclusion in Template
The Validator requires 2 fields, which are named like the controller parameter appended with [0] and [1].
<div class="form-group">
<label for="newPassword" class="col-sm-4 control-label">neues Passwort</label>
<div class="col-sm-4">
<div class="input-group passwordfield">
<f:form.password id="newPassword" name="newPassword[0]" class="form-control" />
<span class="input-group-addon passwordDisplayArea" style="display: none;" data-behaviour="clipboard"></span>
<span class="input-group-btn">
<button class="btn btn-default" type="button" title="Passwort generieren">
<span class="glyphicon glyphicon-random"></span>
</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<label for="newPasswordDuplicate" class="col-sm-4 control-label">neues Passwort bestätigen</label>
<div class="col-sm-4">
<f:form.password name="newPassword[1]" class="form-control passwordfield-duplicate" id="newPasswordDuplicate" />
<p class="help-block">
Wird nur gespeichert, wenn beide gleich sind und mindestens 6 Zeichen lang.
</p>
</div>
</div>
Controller
Build an action controller and add an action to change the password.
/**
* @Flow\Inject()
* @var HashService
*/
protected $hashService;
/**
* @Flow\Inject()
* @var AccountRepository
*/
protected $accountRepository;
/**
* @param array $newPassword
* @throws StopActionException
*
* @Flow\Validate(argumentName="newPassword", type="KayStrobach\Password\Validation\Validator\PasswordValidator", options={"minimumChars":6, "accountIdentifierNotContained":1, "partyNameNotContained":1})
*/
public function changePasswordAction($newPassword) {
$account->setCredentialsSource($this->hashService->hashPassword($plainPassword, 'default'));
if($this->persistenceManager->isNewObject($account)) {
$this->accountRepository->add($account);
} else {
$this->accountRepository->update($account);
}
$this->addFlashMessage('Password changed');
$this->redirect('index');
}
kaystrobach/password 适用场景与选型建议
kaystrobach/password 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.98k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 07 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kaystrobach/password 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kaystrobach/password 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-03