From 170f8d1e6ee557bc09dce0bd451f9442d175656f Mon Sep 17 00:00:00 2001 From: Blou Date: Tue, 28 Jan 2014 15:23:50 -0500 Subject: [PATCH] Removed unnecessary argument in call to SendPasswordRecoveryEmail. Improved var naming http://bugs.koha-community.org/show_bug.cgi?id=8753 --- C4/Members.pm | 8 +++----- opac/opac-password-recovery.pl | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index c6fe793..ee44313 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2267,7 +2267,6 @@ $query is the CGI object, required to determine if http or https must be used sub SendPasswordRecoveryEmail { my $borrowernumber = shift; my $email = shift; - my $query = shift; my $dbh = C4::Context->dbh; my $username = GetMemberDetails($borrowernumber)->{userid}; @@ -2285,13 +2284,12 @@ sub SendPasswordRecoveryEmail { #define to/from emails my $kohaEmail = C4::Context->preference( 'KohaAdminEmailAddress' ); + my $query = new CGI; #create link - my $https = $query->https() ? "https://" : "http://"; - my $uuidLink = $https . C4::Context->preference( 'OPACBaseURL' ) . "/cgi-bin/koha/opac-password-recovery.pl?uniqueKey=$uuid_str"; - #warn $uuidLink; + my $protocol = $query->https() ? "https://" : "http://"; + my $uuidLink = $protocol . C4::Context->preference( 'OPACBaseURL' ) . "/cgi-bin/koha/opac-password-recovery.pl?uniqueKey=$uuid_str"; #build email content - my $query = new CGI; my ( $template2, $borrower_number, $cookie ) = C4::Auth::get_template_and_user( { template_name => "opac-send-password-recovery.tmpl", diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 3ae4cbf..7b03ad4 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -102,7 +102,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { } else { #generate uuid and send recovery email - if ( SendPasswordRecoveryEmail( $borrower_number, $email, $query ) ) { + if ( SendPasswordRecoveryEmail( $borrower_number, $email ) ) { # if it works.... $template->param( mail_sent => 1, -- 1.7.10.4