Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug提交-快速添加密码不能加密 #22

Open
kdlz30 opened this issue Oct 20, 2018 · 1 comment
Open

bug提交-快速添加密码不能加密 #22

kdlz30 opened this issue Oct 20, 2018 · 1 comment

Comments

@kdlz30
Copy link

kdlz30 commented Oct 20, 2018

/application/admin/controller/Admin.php
add 方法,password类型保存的时候没有加密,建议加上
foreach ($form['items'] as $item) {
if($item[0]=='password'){
$data[$item[1]]=Hash::make((string)$data[$item[1]]);
}
}

@caiweiming
Copy link
Owner

如果有这种需求,建议手动实现add和edit方法。因为假设在自动添加页面有password类型,即使在保存的时候自动加密,那么在自动编辑页面password字段会自动填写上已加密的密码,这样用户就不得不每次在编辑页面都要修改一次密码,否则保存后密码就会再次被加密一次,这样体验就比较差。

或者你可能会在自动编辑页面去掉password字段,但万一真的有需求在编辑页面添加password字段呢,那还是得重新写一个edit方法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants