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 649-654 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
649
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
649
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
650
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
650
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
651
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
651
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
652
('StaffLoginResetPassword', '0', NULL, 'If enabled, patrons with access to the staff interface can change their password via the staff interface.', 'YesNo'),
652
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
653
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
653
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
654
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
654
('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'),
655
('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 193-198 Staff interface: Link Here
193
                  1: Show
193
                  1: Show
194
                  0: "Don't show"
194
                  0: "Don't show"
195
            - a search field pulldown for 'Search the catalog' boxes.
195
            - a search field pulldown for 'Search the catalog' boxes.
196
        -
197
            - pref: StaffLoginResetPassword
198
              choices:
199
                  1: Allow
200
                  0: "Don't allow"
201
            - patrons with access to the staff interface (have the <em>catalogue</em> permission) to change their password via the staff interface.
196
    Authentication:
202
    Authentication:
197
        -
203
        -
198
            - pref: staffShibOnly
204
            - 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