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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (+5 lines)
Lines 200-205 Link Here
200
                            <a class="toplinks" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% loggedinusernumber | html %]">My checkouts</a>
200
                            <a class="toplinks" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% loggedinusernumber | html %]">My checkouts</a>
201
                        </li>
201
                        </li>
202
                    [% END %]
202
                    [% END %]
203
204
                    <li class ="toplinks-changepassword">
205
                        <a class="toplinks" href="/cgi-bin/koha/members/member-password.pl?member=[% loggedinusernumber | html %]">Change password</a>
206
                    </li>
207
203
                    <li>
208
                    <li>
204
                        <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a>
209
                        <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a>
205
                    </li>
210
                    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +3 lines)
Lines 13-21 Link Here
13
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
13
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
14
            <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantor_id=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> Add guarantee</a>
14
            <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantor_id=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> Add guarantee</a>
15
        [% END %]
15
        [% END %]
16
        <a id="changepassword" class="btn btn-default" href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | html %]"><i class="fa fa-lock"></i> Change password</a>
17
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</a>
16
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</a>
18
    [% END %]
17
    [% END %]
18
    [% IF CAN_user_borrowers_edit_borrowers || patron.borrowernumber == logged_in_user.borrowernumber %]
19
        <a id="changepassword" class="btn btn-default" href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | html %]"><i class="fa fa-lock"></i> Change password</a>
20
    [% END %]
19
21
20
    [% IF CAN_user_circulate_circulate_remaining_permissions %]
22
    [% IF CAN_user_circulate_circulate_remaining_permissions %]
21
    <div class="btn-group">
23
    <div class="btn-group">
(-)a/members/member-password.pl (-4 / +15 lines)
Lines 28-38 my ( $template, $loggedinuser, $cookie, $staffflags ) = get_template_and_user( Link Here
28
        template_name   => "members/member-password.tt",
28
        template_name   => "members/member-password.tt",
29
        query           => $input,
29
        query           => $input,
30
        type            => "intranet",
30
        type            => "intranet",
31
        flagsrequired   => { borrowers => 'edit_borrowers' },
31
        flagsrequired   => { catalogue => 1 },
32
    }
32
    }
33
);
33
);
34
34
35
my $patron_id    = $input->param('member');
35
my $patron_id    = $input->param('member');
36
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
37
38
if ( !$logged_in_user->has_permission({ borrowers => 'edit_borrowers' }) and $loggedinuser != $patron_id ) {
39
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
40
41
} else {
42
# patron has permission to edit other borrowers, or is changing their own password
43
36
my $destination  = $input->param('destination');
44
my $destination  = $input->param('destination');
37
my $newpassword  = $input->param('newpassword');
45
my $newpassword  = $input->param('newpassword');
38
my $newpassword2 = $input->param('newpassword2');
46
my $newpassword2 = $input->param('newpassword2');
Lines 40-46 my $new_user_id = $input->param('newuserid'); Link Here
40
48
41
my @errors;
49
my @errors;
42
50
43
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
44
my $patron = Koha::Patrons->find( $patron_id );
51
my $patron = Koha::Patrons->find( $patron_id );
45
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
52
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
46
53
Lines 68-74 if ( $newpassword and not @errors) { Link Here
68
        $patron->userid($new_user_id)->store
75
        $patron->userid($new_user_id)->store
69
            if $new_user_id and $new_user_id ne $patron->userid;
76
            if $new_user_id and $new_user_id ne $patron->userid;
70
        $template->param( newpassword => $newpassword );
77
        $template->param( newpassword => $newpassword );
71
        if ( $destination eq 'circ' ) {
78
        if ( !$patron->has_permission({ borrowers => 'edit_borrowers' }) ) {
79
            print $input->redirect("/cgi-bin/koha/mainpage.pl");
80
        }
81
        elsif ( $destination eq 'circ' ) {
72
            print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=" . $patron->cardnumber);
82
            print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=" . $patron->cardnumber);
73
        }
83
        }
74
        else {
84
        else {
Lines 107-110 if ( scalar(@errors) ) { Link Here
107
    }
117
    }
108
}
118
}
109
119
120
} # patron has permission to edit other borrowers, or is changing their own password
121
110
output_html_with_http_headers $input, $cookie, $template->output;
122
output_html_with_http_headers $input, $cookie, $template->output;
111
- 

Return to bug 30700