diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt index 0bc8e13285..5a20e52350 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt @@ -16,7 +16,11 @@
[% WRAPPER breadcrumbs %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Registration complete + [% IF ( ! confirmed ) %] + Registration pending + [% ELSE %] + Registration complete + [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -42,6 +46,17 @@
[% END %] + [% IF ( ! confirmed ) %] +
+

Registration pending

+

Click the button below to confirm registration.

+
+ + + +
+
+ [% ELSE %]

Registration complete!

@@ -80,6 +95,7 @@
[% END %]
+ [% END %]
diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index a0f5a3ace2..51f03fca19 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -263,6 +263,8 @@ if ( $action eq 'create' ) { $template->param( password_cleartext => $patron->plain_text_password ); $template->param( borrower => $patron->unblessed ); + $template->param( confirmed => 1 ); + # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. if ( C4::Context->preference("AutoEmailNewUser") ) { #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index 60a004e18f..7acbd9d229 100755 --- a/opac/opac-registration-verify.pl +++ b/opac/opac-registration-verify.pl @@ -41,18 +41,41 @@ unless ( C4::Context->preference('PatronSelfRegistration') ) { } my $token = $cgi->param('token'); +my $op = $cgi->param('op'); +my $confirmed; +if ( $op && $op eq 'confirmed' ) { + $confirmed = 1; +} my $m = Koha::Patron::Modifications->find( { verification_token => $token } ); my ( $template, $borrowernumber, $cookie ); my ( $error_type, $error_info ); +my $rego_found; if ( - $m # The token exists and the email is unique if requested - and not( - C4::Context->preference('PatronSelfRegistrationEmailMustBeUnique') - and Koha::Patrons->search( { email => $m->email } )->count + $m # The token exists and the email is unique if requested + and not(C4::Context->preference('PatronSelfRegistrationEmailMustBeUnique') + and Koha::Patrons->search( { email => $m->email } )->count ) ) - ) +{ + $rego_found = 1; +} + +if ( $rego_found + and !$confirmed ) +{ + ( $template, $borrowernumber, $cookie ) = get_template_and_user( + { + template_name => "opac-registration-confirmation.tt", + type => "opac", + query => $cgi, + authnotrequired => C4::Context->preference("OpacPublic") ? 1 : 0, + } + ); + $template->param( "token" => $token ); +} +elsif ( $rego_found + and $confirmed ) { my $patron_attrs = $m->unblessed; $patron_attrs->{password} ||= Koha::AuthUtils::generate_password(Koha::Patron::Categories->find($patron_attrs->{categorycode})); @@ -88,6 +111,7 @@ if ( authnotrequired => C4::Context->preference("OpacPublic") ? 1 : 0, } ); + $template->param( "confirmed" => 1 ); C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences'); $template->param( password_cleartext => $patron->plain_text_password );