From: Marius Gavrilescu Date: Mon, 16 Feb 2015 15:54:18 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;ds=sidebyside;h=fd85a0df209242d83d453d9847aebfe4513100f4;hp=-c;p=plack-app-gruntmaster.git Merge branch 'master' into newmc --- fd85a0df209242d83d453d9847aebfe4513100f4 diff --combined lib/Plack/App/Gruntmaster.pm index 0cb7aab,2edc6dc..e0f921d --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@@ -163,8 -163,7 +163,8 @@@ sub dispatch_request sub (/ed/:contest) { forbid contest->is_running; - response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1); + my $pblist = db->problem_list(contest => $_{contest}, solution => 1); + response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial}; }, sub (/login) { @@@ -279,6 -278,8 +279,8 @@@ website using the following information Username: $_{username} Password: Reset token: $token + + The token is valid for 24 hours. EOF my $email = Email::Simple->create( header => [ @@@ -302,6 -303,7 +304,7 @@@ my $user = db->user($_{username}); return reply 'No such user' unless $user; my ($token, $exp) = split ':', $_{token}; + return reply 'Reset token is expired' if time >= $exp; return reply 'Bad reset token' unless $user->make_reset_hmac($exp) eq $token; $user->set_passphrase($_{password}); reply 'Password reset successfully';