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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt (-1 / +17 lines)
Lines 16-22 Link Here
16
<div class="main">
16
<div class="main">
17
    [% WRAPPER breadcrumbs %]
17
    [% WRAPPER breadcrumbs %]
18
        [% WRAPPER breadcrumb_item bc_active= 1 %]
18
        [% WRAPPER breadcrumb_item bc_active= 1 %]
19
            <span>Registration complete</span>
19
            [% IF ( ! confirmed ) %]
20
                <span>Registration pending</span>
21
            [% ELSE %]
22
                <span>Registration complete</span>
23
            [% END %]
20
        [% END %]
24
        [% END %]
21
    [% END #/ WRAPPER breadcrumbs %]
25
    [% END #/ WRAPPER breadcrumbs %]
22
26
Lines 42-47 Link Here
42
                <div class="col order-md-1 maincontent">
46
                <div class="col order-md-1 maincontent">
43
            [% END %]
47
            [% END %]
44
48
49
                [% IF ( ! confirmed ) %]
50
                    <div id="registration-pending">
51
                        <h1>Registration pending</h1>
52
                        <p id="confirm-instruction" class="registration-line">Click the button below to confirm registration.</p>
53
                        <form action="/cgi-bin/koha/opac-registration-verify.pl" method="post" name="confirm_registration" id="confirm_registration">
54
                            <input type="hidden" name="token" value="[% token | html %]">
55
                            <input type="hidden" name="op" value="confirmed">
56
                            <input type="submit" value="Confirm" class="btn btn-primary">
57
                        </form>
58
                    </div>
59
                [% ELSE %]
45
                    <div id="registration-complete">
60
                    <div id="registration-complete">
46
                        <h1>Registration complete!</h1>
61
                        <h1>Registration complete!</h1>
47
62
Lines 80-85 Link Here
80
                            </div>
95
                            </div>
81
                        [% END %]
96
                        [% END %]
82
                    </div> <!-- /#registration-complete -->
97
                    </div> <!-- /#registration-complete -->
98
                [% END %]
83
                </div> <!-- / .col-7/9 -->
99
                </div> <!-- / .col-7/9 -->
84
100
85
                <div class="col-12 col-lg-3 order-md-2">
101
                <div class="col-12 col-lg-3 order-md-2">
(-)a/opac/opac-memberentry.pl (+2 lines)
Lines 263-268 if ( $action eq 'create' ) { Link Here
263
                $template->param( password_cleartext => $patron->plain_text_password );
263
                $template->param( password_cleartext => $patron->plain_text_password );
264
                $template->param( borrower => $patron->unblessed );
264
                $template->param( borrower => $patron->unblessed );
265
265
266
                $template->param( confirmed => 1 );
267
266
                # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
268
                # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
267
                if ( C4::Context->preference("AutoEmailNewUser") ) {
269
                if ( C4::Context->preference("AutoEmailNewUser") ) {
268
                    #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
270
                    #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
(-)a/opac/opac-registration-verify.pl (-6 / +29 lines)
Lines 41-58 unless ( C4::Context->preference('PatronSelfRegistration') ) { Link Here
41
}
41
}
42
42
43
my $token = $cgi->param('token');
43
my $token = $cgi->param('token');
44
my $op = $cgi->param('op');
45
my $confirmed;
46
if ( $op && $op eq 'confirmed' ) {
47
    $confirmed = 1;
48
}
44
my $m = Koha::Patron::Modifications->find( { verification_token => $token } );
49
my $m = Koha::Patron::Modifications->find( { verification_token => $token } );
45
50
46
my ( $template, $borrowernumber, $cookie );
51
my ( $template, $borrowernumber, $cookie );
47
my ( $error_type, $error_info );
52
my ( $error_type, $error_info );
48
53
54
my $rego_found;
49
if (
55
if (
50
    $m # The token exists and the email is unique if requested
56
    $m    # The token exists and the email is unique if requested
51
    and not(
57
    and not(C4::Context->preference('PatronSelfRegistrationEmailMustBeUnique')
52
            C4::Context->preference('PatronSelfRegistrationEmailMustBeUnique')
58
        and Koha::Patrons->search( { email => $m->email } )->count )
53
        and Koha::Patrons->search( { email => $m->email } )->count
54
    )
59
    )
55
  )
60
{
61
    $rego_found = 1;
62
}
63
64
if ( $rego_found
65
    and !$confirmed )
66
{
67
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
68
        {
69
            template_name   => "opac-registration-confirmation.tt",
70
            type            => "opac",
71
            query           => $cgi,
72
            authnotrequired => C4::Context->preference("OpacPublic") ? 1 : 0,
73
        }
74
    );
75
    $template->param( "token" => $token );
76
}
77
elsif ( $rego_found
78
    and $confirmed )
56
{
79
{
57
    my $patron_attrs = $m->unblessed;
80
    my $patron_attrs = $m->unblessed;
58
    $patron_attrs->{password} ||= Koha::AuthUtils::generate_password(Koha::Patron::Categories->find($patron_attrs->{categorycode}));
81
    $patron_attrs->{password} ||= Koha::AuthUtils::generate_password(Koha::Patron::Categories->find($patron_attrs->{categorycode}));
Lines 88-93 if ( Link Here
88
                authnotrequired => C4::Context->preference("OpacPublic") ? 1 : 0,
111
                authnotrequired => C4::Context->preference("OpacPublic") ? 1 : 0,
89
            }
112
            }
90
        );
113
        );
114
        $template->param( "confirmed" => 1 );
91
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
115
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
92
116
93
        $template->param( password_cleartext => $patron->plain_text_password );
117
        $template->param( password_cleartext => $patron->plain_text_password );
94
- 

Return to bug 35445