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

(-)a/installer/data/mysql/atomicupdate/bug_30700_-_add_StaffLoginResetPassword_syspref.pl (+12 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30700",
5
    description => "Add new system preference StaffLoginResetPassword",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('StaffLoginResetPassword', '0', NULL, 'If enabled, patrons with access to the staff interface can change their password via the staff interface.', 'YesNo') });
11
    },
12
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 635-640 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
635
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
635
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
636
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
636
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
637
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
637
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
638
('StaffLoginResetPassword', '0', NULL, 'If enabled, patrons with access to the staff interface can change their password via the staff interface.', 'YesNo'),
638
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
639
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
639
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
640
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
640
('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'),
641
('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-3 / +5 lines)
Lines 193-201 Link Here
193
                        </li>
193
                        </li>
194
                    [% END %]
194
                    [% END %]
195
195
196
                    <li class ="toplinks-changepassword">
196
                    [% IF Koha.Preference('StaffLoginResetPassword') %]
197
                        <a class="toplinks" href="/cgi-bin/koha/members/member-password.pl?member=[% loggedinusernumber | html %]">Change password</a>
197
                        <li class ="toplinks-changepassword">
198
                    </li>
198
                            <a class="toplinks" href="/cgi-bin/koha/members/member-password.pl?member=[% loggedinusernumber | html %]">Change password</a>
199
                        </li>
200
                    [% END %]
199
201
200
                    <li>
202
                    <li>
201
                        <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a>
203
                        <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 15-21 Link Here
15
        [% END %]
15
        [% END %]
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>
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>
17
    [% END %]
17
    [% END %]
18
    [% IF CAN_user_borrowers_edit_borrowers || patron.borrowernumber == logged_in_user.borrowernumber %]
18
    [% IF CAN_user_borrowers_edit_borrowers || ( Koha.Preference('StaffLoginResetPassword') && 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>
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 %]
20
    [% END %]
21
21
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (+6 lines)
Lines 181-186 Staff interface: Link Here
181
                  1: Show
181
                  1: Show
182
                  0: "Don't show"
182
                  0: "Don't show"
183
            - a search field pulldown for 'Search the catalog' boxes.
183
            - a search field pulldown for 'Search the catalog' boxes.
184
        -
185
            - pref: StaffLoginResetPassword
186
              choices:
187
                  1: Allow
188
                  0: "Don't allow"
189
            - patrons with access to the staff interface (have the <em>catalogue</em> permission) to change their password via the staff interface.
184
    Authentication:
190
    Authentication:
185
        -
191
        -
186
            - pref: staffShibOnly
192
            - pref: staffShibOnly
(-)a/members/member-password.pl (-2 / +1 lines)
Lines 35-41 my ( $template, $loggedinuser, $cookie, $staffflags ) = get_template_and_user( Link Here
35
my $patron_id    = $input->param('member');
35
my $patron_id    = $input->param('member');
36
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
36
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
37
37
38
if ( !$logged_in_user->has_permission({ borrowers => 'edit_borrowers' }) and $loggedinuser != $patron_id ) {
38
if ( !$logged_in_user->has_permission({ borrowers => 'edit_borrowers' }) or ( $loggedinuser != $patron_id and C4::Context->preference('StaffLoginResetPassword') ) ) {
39
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
39
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
40
40
41
} else {
41
} else {
42
- 

Return to bug 30700