[account settings now requires old password to change password thomashartman1@gmail.com**20080912142430] hunk ./src/Controller.hs 108 -accountSettingsPage (ChangeUserInfo pass1 pass2) = - [ ServerPartT $ \rq -> - if pass1 == pass2 +accountSettingsPage (ChangeUserInfo oldpass newpass1 newpass2) = + [ ServerPartT $ \rq -> do + if newpass1 == newpass2 hunk ./src/Controller.hs 114 - (\user -> do update $ ModifyUser user pass1 - startsess user rq ) + (\user -> do allowed <- query $ AuthUser user oldpass + if allowed + then do update $ ModifyUser user newpass1 + ( tutlayoutReq rq [] "accountsettings-changed" ) -- startsess user rq + else errW "old password incorrect" rq) hunk ./src/Controller.hs 120 - hunk ./src/Controller.hs 122 - where errW msg rq = ( tutlayoutReq rq [("errormsgRegister", msg)] ) "register" + where errW msg rq = ( tutlayoutReq rq [("errormsgAccountSettings", msg)] ) "accountsettings" hunk ./src/Model.hs 16 -data ChangeUserInfo = ChangeUserInfo String String +data ChangeUserInfo = ChangeUserInfo String String String hunk ./src/Model.hs 28 - fromData = liftM2 ChangeUserInfo (look "password" `mplus` return "nopassword") - (look "password2" `mplus` return "nopassword2") + fromData = liftM3 ChangeUserInfo (look "oldpass" `mplus` return "no old password") + (look "password" `mplus` return "no password") + (look "password2" `mplus` return "no password2") hunk ./templates/accountsettings.st 4 - -
- -
- + + + + + + + + +
Old Password:
Password:
Verify Password:
hunk ./templates/login.st 4 - + Username: hunk ./templates/login.st 6 - + Password: hunk ./templates/register.st 1 -
- -
- -
- -
- -
+

Register

+
+ + + + + + + +
Username:
Password:
Verify Password: