sfDoctrineGuard 和忘记密码功能 [英] sfDoctrineGuard and Forgot Password function

查看:40
本文介绍了sfDoctrineGuard 和忘记密码功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 smyfony 的新手,我整天都在玩那个 sfDoctrineGuard 插件.它在大多数情况下都有效.我只是在使用 forgot_password 功能时遇到了麻烦.

I'm pretty new to smyfony and I've been playing around with that sfDoctrineGuard plugin the whole day. it's working for the most part. I'm just having troubles with the forgot_password function.

其实我都是按照插件里的自述文件做的.

Actually I did everything according to the readme file in the plugin.

问题是:

在 security.yml 中我设置

in security.yml i set

默认:is_secure:true

default: is_secure:true

显然在 sfGuard 模块中有一个 security.yml 说明:

obviously in the module sfGuard there's a security.yml that sais:

安全:is_secure: 假

secure: is_secure: false

登录:is_secure: 假

signin: is_secure: false

退出:is_secure: 假

signout: is_secure: false

这是有道理的,否则登录站点将无法访问.

which makes sense, cause otherwise the login site wouldn't be accessible.

但是

它似乎不适用于 forgot_password 功能:

it doesn't seem to work with the forgot_password function:

路由.yml

sf_guard_signin:网址:/登录参数:{ 模块:sfGuardAuth,动作:登录}

sf_guard_signin: url: /login param: { module: sfGuardAuth, action: signin }

sf_guard_signout:网址:/注销参数:{ 模块:sfGuardAuth,动作:退出}

sf_guard_signout: url: /logout param: { module: sfGuardAuth, action: signout }

sf_guard_forgot_password:网址:/forgot_password参数:{ 模块:sfGuardForgotPassword,动作:索引 }

sf_guard_forgot_password: url: /forgot_password param: { module: sfGuardForgotPassword, action: index }

sf_guard_forgot_password_change:网址:/forgot_password/:unique_key类:sfDoctrineRoute选项:{ 模型:sfGuardForgotPassword,类型:对象}参数:{ 模块:sfGuardForgotPassword,动作:更改}要求:sf_method:[获取,发布]

sf_guard_forgot_password_change: url: /forgot_password/:unique_key class: sfDoctrineRoute options: { model: sfGuardForgotPassword, type: object } param: { module: sfGuardForgotPassword, action: change } requirements: sf_method: [get, post]

我无法访问/forgot_password,因为我被重新路由到/login 页面.所以我把 security.yml 和

i cannot access /forgot_password as I am rerouted to the /login page. so i put a security.yml with

忘记密码:is_secure: 假

forgot_password: is_secure: false

在 sfGuardForgotPassword 模块的 config 目录中.但这似乎不起作用.

in the config directory of the sfGuardForgotPassword module. But that doesn't seem to be working.

如果我把它放在全局 security.yml 中它也不起作用:-(

and it's not working if i put this in the global security.yml either :-(

有人知道吗?

推荐答案

/app/modules/sfGuardForgotPassword/config/security.yml 我有:

secure:
  is_secure: true

index:
  is_secure: false

change:
  is_secure: false

在该应用程序的 routing.yml 文件中,我有:

In that app's routing.yml file I have:

sf_guard_signin:
  url:   /login
  param: { module: sfGuardAuth, action: signin }

sf_guard_signout:
  url:   /logout
  param: { module: sfGuardAuth, action: signout }

sf_guard_forgot_password:
  url:   /forgot_password
  param: { module: sfGuardForgotPassword, action: index }

sf_guard_forgot_password_change:
  url:   /forgot_password/:unique_key
  class: sfDoctrineRoute
  options: { model: sfGuardForgotPassword, type: object }
  param: { module: sfGuardForgotPassword, action: change }
  requirements:
    sf_method: [get, post]

这篇关于sfDoctrineGuard 和忘记密码功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆