修改/astro/signin/mail.php、/astro/signin/checksignin.php、/astro/user/checklogin.php、/astro/equip/mysqlconnection.php
violin9906 / ustcaaa Goto Github PK
View Code? Open in Web Editor NEWWebsite for USTC AAA
Website for USTC AAA
在用户登录界面,添加一个“忘记密码”链接,点击链接跳转到“忘记密码”页,在“忘记密码”页输入并提交学号和邮箱。若学号和邮箱都存在,发送verifycode邮件并跳转至重设密码页。
在重设密码页,提交verifycode和新密码,若verifycode验证通过,将当前学号对应的用户密码重置为新密码。
在新用户注册时记录其邮箱,为保持兼容,数据库中email列可以为空。
#2 相关
为方便已忘记密码且未设邮箱的用户找回密码,在财务部管理界面,允许管理员为用户添加/修改邮箱。
数据库:user表新增一个email列
新增一个用户账户管理页(比如叫”我的账户“)。
如果用户还没有邮箱,允许用户添加邮箱。
如果用户已经有邮箱,在这个页面上显示该邮箱。
(修改邮箱功能可以先不做)
在服务器上设置好环境变量,代码中从环境变量读取需要的敏感信息。这样不用在每次发布时再修改文件了。
参考 http://php.net/manual/zh/book.password.php ,使用password_hash
创建密码的hash,验证密码时使用password_verify
。
数据库:user表新增一个passwordhash列。
为使现在已经使用老密码hash的用户能继续登录,应在保留现有hash的基础上,在下一次用户登录时,成功验证密码以后,将密码计算新hash并保存,再删去老hash。
新用户注册时可以直接新hash。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.