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 695-700 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
695
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
695
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
696
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
696
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
697
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
697
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
698
('StaffLoginResetPassword', '0', NULL, 'If enabled, patrons with access to the staff interface can change their password via the staff interface.', 'YesNo'),
698
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
699
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
699
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
700
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
700
('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'),
701
('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 210-218 Link Here
210
                        </li>
210
                        </li>
211
                    [% END %]
211
                    [% END %]
212
212
213
                    <li class ="toplinks-changepassword">
213
                    [% IF Koha.Preference('StaffLoginResetPassword') %]
214
                        <a class="toplinks" href="/cgi-bin/koha/members/member-password.pl?member=[% loggedinusernumber | html %]">Change password</a>
214
                        <li class ="toplinks-changepassword">
215
                    </li>
215
                            <a class="toplinks" href="/cgi-bin/koha/members/member-password.pl?member=[% loggedinusernumber | html %]">Change password</a>
216
                        </li>
217
                    [% END %]
216
218
217
                    <li>
219
                    <li>
218
                        <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a>
220
                        <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 199-204 Staff interface: Link Here
199
                  1: Show
199
                  1: Show
200
                  0: "Don't show"
200
                  0: "Don't show"
201
            - a search field pulldown for 'Search the catalog' boxes.
201
            - a search field pulldown for 'Search the catalog' boxes.
202
        -
203
            - pref: StaffLoginResetPassword
204
              choices:
205
                  1: Allow
206
                  0: "Don't allow"
207
            - patrons with access to the staff interface (have the <em>catalogue</em> permission) to change their password via the staff interface.
202
    Authentication:
208
    Authentication:
203
        -
209
        -
204
            - pref: staffShibOnly
210
            - 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' }) and ( $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