0

我学习使用 sfGuardDoctrinePlugin,但我还不知道在哪里可以找到用户控制面板和更改密码?第二个问题 - 当新用户注册时,我该怎么做,他必须通过电子邮件帐户确认,然后 is_active 数据库 = 1。

感谢帮助!

编辑:

我找到了 [b]sfGuardChangePasswordTask.class.php[/b],所以我必须打电话来更改密码,但是怎么做?

4

1 回答 1

1

要更改用户密码,您有两种选择:创建标准 Symfony 管理后端 (http://www.symfony-project.org/jobeet/1_4/Doctrine/en/12) 或从头开始创建自己的“控制面板”你可以改变的地方。密码存储为散列,因此您应该使用 sfDoctrineGuardPlugin 方法进行更改,例如 $user->save()。

For the email confirmation, you'll need to build this yourself. So I'd probably start by generating a unique hash (associated with the given sfGuardUser with active = 0) which is then emailed to the user. When the user clicks on the link, you check the hash and set active = 1.

Anything with the word "Task" in it are generally meant to be run from the command line or as Cron jobs so you shouldn't be looking at those for the normal running of your application.

Hope that helps.

于 2011-07-03T11:38:11.800 回答