sfDoctrineGuardPlugin 在数据转储后重新哈希来自装置的密码
我有 s symfony 1.4,带有 Doctrine 和 sfDoctrineGuardPlugin。
我在sfGuardUser的加载装置方面遇到问题,这些装置是由symfonydoctrine:data-dump
核心 制成的问题的关键在于,fixture 文件中的密码未加密,它们会在fixture 加载过程中加密。
另一方面,当我们从数据库中转储数据时,密码已经加密,如果我们尝试再次加载它们,密码的值将被第二次重新哈希。
有人知道如何避免这种情况吗?
我正在使用此过程来防止模型需要更改时丢失数据。如果有人知道这个特定问题的其他解决方案,我将不胜感激!
I have s symfony 1.4 with Doctrine and sfDoctrineGuardPlugin.
I am experiencing a problem with loading fixtures for sfGuardUser which are made from symfony doctrine:data-dump
The core of the problem is that the passwords in the fixture file are not encrypted and they will be encrypted in the process of fixture loading.
In the other hand - when we dump data from the data base, the passwords are already encrypted and if we try to load them again, the value of the password will be rehashed for the second time.
Does anybody know how to avoid this situation?
I am using this process to prevent data loss when the model needs to be changed. If anybody knows other solution for this particular problem, I will appreciate!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
旧 symfony 论坛中有一个解决方案。
简而言之:在您的用户模型中创建一个 setEncryptedPassword 函数,如下所示:
并在转储中将所有出现的
password
更改为encrypted_password
。There's a solution to this in the old symfony forum.
In short: create a setEncryptedPassword function in your user model like this:
And in your dump change all
password
occurences toencrypted_password
.