View | Details | Raw Unified | Return to bug 15548
Collapse All | Expand All

(-)a/C4/Passwordrecovery.pm (-1 / +1 lines)
Lines 103-109 sub GetValidLinkInfo { Link Here
103
=cut
103
=cut
104
104
105
sub SendPasswordRecoveryEmail {
105
sub SendPasswordRecoveryEmail {
106
    my $borrower  = shift;    # Koha::Borrower
106
    my $borrower  = shift;    # Koha::Patron
107
    my $userEmail = shift;    #to_address (the one specified in the request)
107
    my $userEmail = shift;    #to_address (the one specified in the request)
108
    my $update    = shift;
108
    my $update    = shift;
109
109
(-)a/Koha/SMS/Provider.pm (-2 / +2 lines)
Lines 21-27 use Modern::Perl; Link Here
21
21
22
use Carp;
22
use Carp;
23
23
24
use Koha::Borrowers;
24
use Koha::Patrons;
25
25
26
use base qw(Koha::Object);
26
use base qw(Koha::Object);
27
27
Lines 47-53 Gives the number of patrons using this provider Link Here
47
sub patrons_using {
47
sub patrons_using {
48
    my ( $self ) = @_;
48
    my ( $self ) = @_;
49
49
50
    return Koha::Borrowers->search( { sms_provider_id => $self->id } )->count();
50
    return Koha::Patrons->search( { sms_provider_id => $self->id } )->count();
51
}
51
}
52
52
53
=head3 _type
53
=head3 _type
(-)a/opac/opac-password-recovery.pl (-3 / +3 lines)
Lines 11-17 use C4::Context; Link Here
11
use C4::Passwordrecovery
11
use C4::Passwordrecovery
12
  qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery);
12
  qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery);
13
use Koha::AuthUtils qw(hash_password);
13
use Koha::AuthUtils qw(hash_password);
14
use Koha::Borrowers;
14
use Koha::Patrons;
15
my $query = new CGI;
15
my $query = new CGI;
16
use HTML::Entities;
16
use HTML::Entities;
17
17
Lines 58-67 if ( $query->param('sendEmail') || $query->param('resendEmail') ) { Link Here
58
58
59
    # Find the borrower by his userid or email
59
    # Find the borrower by his userid or email
60
    if ($username) {
60
    if ($username) {
61
        $search_results = [ Koha::Borrowers->search( { userid => $username } ) ];
61
        $search_results = [ Koha::Patrons->search( { userid => $username } ) ];
62
    }
62
    }
63
    elsif ($email) {
63
    elsif ($email) {
64
        $search_results = [ Koha::Borrowers->search( { -or => { email => $email, emailpro => $email, B_email  => $email } } ) ];
64
        $search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email  => $email } } ) ];
65
    }
65
    }
66
    if ( not $search_results || scalar @$search_results > 1 ) {
66
    if ( not $search_results || scalar @$search_results > 1 ) {
67
        $hasError           = 1;
67
        $hasError           = 1;
(-)a/t/db_dependent/Passwordrecovery.t (-3 / +2 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use C4::Context;
20
use C4::Context;
21
use C4::Letters;
21
use C4::Letters;
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Borrowers;
23
use Koha::Patrons;
24
24
25
use Test::More tests => 16;
25
use Test::More tests => 16;
26
26
Lines 134-140 ok( C4::Passwordrecovery::CompletePasswordRecovery($uuid2) == 0, "[CompletePassw Link Here
134
# C4::Passwordrecovery::SendPasswordRecoveryEmail #
134
# C4::Passwordrecovery::SendPasswordRecoveryEmail #
135
###################################################
135
###################################################
136
136
137
my $borrower = shift [ Koha::Borrowers->search( { userid => $userid1 } ) ];
137
my $borrower = shift [ Koha::Patrons->search( { userid => $userid1 } ) ];
138
ok( C4::Passwordrecovery::SendPasswordRecoveryEmail($borrower, $email1, 0) == 1, "[SendPasswordRecoveryEmail] Returns 1 on success" );
138
ok( C4::Passwordrecovery::SendPasswordRecoveryEmail($borrower, $email1, 0) == 1, "[SendPasswordRecoveryEmail] Returns 1 on success" );
139
my $letters = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber1, limit => 99 } );
139
my $letters = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber1, limit => 99 } );
140
ok( scalar @$letters == 1, "[SendPasswordRecoveryEmail] There is a letter in the queue for our borrower");
140
ok( scalar @$letters == 1, "[SendPasswordRecoveryEmail] There is a letter in the queue for our borrower");
141
- 

Return to bug 15548