Lines 23-28
use C4::Auth;
Link Here
|
23 |
use C4::Output; |
23 |
use C4::Output; |
24 |
use C4::Members; |
24 |
use C4::Members; |
25 |
use C4::Form::MessagingPreferences; |
25 |
use C4::Form::MessagingPreferences; |
|
|
26 |
use Koha::AuthUtils; |
26 |
use Koha::Patrons; |
27 |
use Koha::Patrons; |
27 |
use Koha::Patron::Modifications; |
28 |
use Koha::Patron::Modifications; |
28 |
|
29 |
|
Lines 59-75
if (
Link Here
|
59 |
$template->param( |
60 |
$template->param( |
60 |
OpacPasswordChange => C4::Context->preference('OpacPasswordChange') ); |
61 |
OpacPasswordChange => C4::Context->preference('OpacPasswordChange') ); |
61 |
|
62 |
|
62 |
my $borrower = $m->unblessed(); |
63 |
my $patron_attrs = $m->unblessed; |
|
|
64 |
$patron_attrs->{password} ||= Koha::AuthUtils::generate_password; |
63 |
|
65 |
|
64 |
my $password; |
66 |
$patron_attrs->{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory'); |
65 |
( $borrowernumber, $password ) = AddMember_Opac(%$borrower); |
67 |
my $patron = Koha::Patron->new( $patron_attrs )->store; |
66 |
|
68 |
|
67 |
if ($borrowernumber) { |
69 |
if ($patron) { |
68 |
$m->delete(); |
70 |
$m->delete(); |
69 |
C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences'); |
71 |
C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences'); |
70 |
|
72 |
|
71 |
$template->param( password_cleartext => $password ); |
73 |
$template->param( password_cleartext => $patron->plain_text_password ); |
72 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
73 |
$template->param( borrower => $patron->unblessed ); |
74 |
$template->param( borrower => $patron->unblessed ); |
74 |
$template->param( |
75 |
$template->param( |
75 |
PatronSelfRegistrationAdditionalInstructions => |
76 |
PatronSelfRegistrationAdditionalInstructions => |