CodeIgniter:丢失密码功能,如何实现? [英] CodeIgniter: lost password feature, how to implement?

查看:124
本文介绍了CodeIgniter:丢失密码功能,如何实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户端有一个运行在CodeIgniter上的站点(我没有创建它,并且很少知道CI),他们想添加一个丢失的密码功能,我不知道如何实现此功能使用CI。我知道PHP与我的大部分经验,它是从WordPress。

A client of mine has a site running on CodeIgniter (i did not create it, and know very little about CI), and they would like to add a lost password feature, and i have no idea how to approach implementing this feature using CI. I know PHP with most of my experience with it being from WordPress.

有人能指出我在实现这类事物的最佳实践方向吗?

Can someone point me in the right direction as to the best practices for implementing this kind of thing?

推荐答案

这是我的实现方式:


  • 用户点击链接忘记密码

  • 在用户表中放入随机密钥和临时密码

  • $ b
  • 您发送包含链接的电子邮件,以激活您设置的密码。链接包含随机键

  • 用户点击链接。

  • 您激活密码并清除临时密码和随机字符串

  • 用户登录并将其密码更改为他想要的东西

  • User clicks on link, "Forgot your password"
  • User types in his/her email address
  • You put a random key and temporary password in the user table
  • You send an email with a link to activate the password you set. The link has the random key
  • User clicks on link. The link should match the random string
  • You activate the password and clear the temporary password and the random string
  • User logs in and changes his password to something he wants

CI是PHP,所以你只需要实现它,就像你在任何其他PHP项目中一样将在控制器/模型/视图内执行。

CI is PHP so you'd just implement it as you'd do it in any other PHP projects, except you'll be doing within controllers/models/views.

这篇关于CodeIgniter:丢失密码功能,如何实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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