Bugzilla – Attachment 25038 Details for
Bug 8753
Add forgot password link to OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8753 - Add forgot password link to OPAC (patch)
Bug-8753---Add-forgot-password-link-to-OPAC-patch.patch (text/plain), 2.50 KB, created by
Blou
on 2014-02-04 19:28:31 UTC
(
hide
)
Description:
Bug 8753 - Add forgot password link to OPAC (patch)
Filename:
MIME Type:
Creator:
Blou
Created:
2014-02-04 19:28:31 UTC
Size:
2.50 KB
patch
obsolete
>From 9afc63a02157ac1ae88367dca02f3e34f9d6607e Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Tue, 4 Feb 2014 14:24:46 -0500 >Subject: [PATCH] Bug 8753 - Add forgot password link to OPAC (patch) > >When asking for a new link when one was already sent now causes an update of the one in the DB. >This >- makes the previous link invalid >- reset the timestamp to allow for two more days. >--- > C4/Members.pm | 11 ++++++++--- > opac/opac-password-recovery.pl | 2 +- > 2 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 41c7504..e6fcdcc 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -2268,6 +2268,7 @@ sub SendPasswordRecoveryEmail { > my $borrowernumber = shift; > my $email = shift; > my $query = shift; >+ my $update = shift; > my $dbh = C4::Context->dbh; > my $username = GetMemberDetails($borrowernumber)->{userid}; > >@@ -2278,9 +2279,13 @@ sub SendPasswordRecoveryEmail { > > #insert into database > my $expirydate = DateTime->now(time_zone => C4::Context->tz())->add( days => 2 ); >- my $sth = $dbh->prepare( 'INSERT INTO borrower_password_recovery VALUES (?, ?, ?)'); >- $sth->execute($borrowernumber, $uuid_str, $expirydate->ymd()); >- >+ if($update){ >+ my $sth = $dbh->prepare( 'UPDATE borrower_password_recovery set uuid=?, valid_until=? where borrowernumber=?'); >+ $sth->execute($uuid_str, $expirydate->datetime(), $borrowernumber); >+ } else { >+ my $sth = $dbh->prepare( 'INSERT INTO borrower_password_recovery VALUES (?, ?, ?)'); >+ $sth->execute($borrowernumber, $uuid_str, $expirydate->ymd()); >+ } > my $userEmail = ( $email ) ? $email : GetFirstValidEmailAddress($borrowernumber); > #define to/from emails > my $kohaEmail = C4::Context->preference( 'KohaAdminEmailAddress' ); >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index 0a6d9e8..262c6c8 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -87,7 +87,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > email => HTML::Entities::encode($email), > ); > } >- elsif ( SendPasswordRecoveryEmail( $borrower_number, $email, $query ) ) {#generate uuid and send recovery email >+ elsif ( SendPasswordRecoveryEmail( $borrower_number, $email, $query, $query->param('resendEmail') ) ) {#generate uuid and send recovery email > $template->param( > mail_sent => 1, > email => $email >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8753
:
21502
|
21512
|
21521
|
21849
|
22175
|
22430
|
24586
|
24780
|
24781
|
24846
|
24853
|
24854
|
24855
|
24862
|
24906
|
24907
|
24908
|
25038
|
25039
|
25051
|
29111
|
33175
|
33176
|
34472
|
36819
|
37492
|
39049
|
39144
|
39165
|
39166
|
39167
|
39168
|
39827
|
41181
|
41192
|
41193
|
41455
|
41686
|
41687
|
41688
|
41706
|
43017
|
43183
|
43576
|
44305
|
44306
|
44307
|
44308
|
44309
|
44310
|
44311
|
44323
|
44324
|
44325
|
44326
|
44327
|
44329
|
44330
|
45209
|
45210
|
45211
|
45212
|
45213
|
45214
|
45215
|
45223
|
45224
|
45225
|
45226
|
45227
|
45228
|
45229
|
45230
|
46379
|
47164
|
47165
|
47166
|
47167
|
47168
|
47169
|
47170
|
47171
|
47357
|
47366