New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change password feature #3

Open
wants to merge 2 commits into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+11 −7
Diff settings

Always

Just for now

Viewing a subset of changes. View all
Prev

Added fieldsets

  • Loading branch information...
Goheeca committed Aug 10, 2015
commit 48925e60084d5db4edcb2374fcc20da68e343529
View
@@ -199,7 +199,7 @@ Your new password is: ${ password }")))
((not (string= new-password confirm-password)) (err "cpw"))
((check-password password *account*)
(let ((salt (make-random-string 50)))
(update-account account
(update-account *account*
account-password-digest (password-digest new-password salt)
account-password-salt salt))
#/site/preferences-ok?what=Password)
@@ -209,26 +209,29 @@ Your new password is: ${ password }")))
(if *account*
(progn
#H[<h3>Change account preferences</h3>
<h2>Change password</h2>
<form id="changepassword" class="prefs" method="post"
action="$(#/site/change-password)">
<fieldset class="prefs">
<legend>Password</legend>
<dl>]
(maybe-show-form-error error "npw" "Bad password")
#H[<dt><label for="new-password">New password:</label></dt>
<dd><input class="regin" type="password" name="new-password" title="new password" /></dd>]
(maybe-show-form-error error "cpw" "Different passwords")
#H[<dt><label for="confirm-password">New password:</label></dt>
#H[<dt><label for="confirm-password">Confirm password:</label></dt>
<dd><input class="regin" type="password" name="confirm-password" title="confirm password" /></dd>]
(maybe-show-form-error error "opw" "Wrong password")
#H[<dt><label for="password">Old password:</label></dt>
<dd><input class="regin" type="password" name="password" /></dd>
<dt /><dd><input type="submit" value="change password" /></dd>
</dl>
</form>]
</fieldset>
</form>]
<h2>Change email</h2>
#H[<form id="changemail" class="prefs" method="post"
#H[<form id="changemail" class="prefs" method="post"
action="$(#/site/change-email)">
<fieldset class="prefs">
<legend>Email</legend>
<dl>]
(maybe-show-form-error error "email" "Bad email address")
#H[<dt><label for="email">New email:</label></dt>
@@ -239,7 +242,8 @@ Your new password is: ${ password }")))
<dd><input class="regin" type="password" name="password" /></dd>
<dt /><dd><input type="submit" value="change email" /></dd>
</dl>
</form>])
</fieldset>
</form>])
(redirect #/)))
;;; moderation
ProTip! Use n and p to navigate between commits in a pull request.