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

(-)a/installer/data/mysql/atomicupdate/bug_20100.perl (-1 / +1 lines)
Lines 1-7 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q|
3
    $dbh->do( q|
4
INSERT IGNORE INTO systempreferences ( value, variable, options, explanation, type ) VALUES ( '0', 'ProtectSuperlibPrivs', NULL, 'If enabled, non-superlibrarians cannot set superlibrarian privileges', 'YesNo' );
4
INSERT IGNORE INTO systempreferences ( value, variable, options, explanation, type ) VALUES ( '0', 'ProtectSuperlibrarianPrivileges', NULL, 'If enabled, non-superlibrarians cannot set superlibrarian privileges', 'YesNo' );
5
    |);
5
    |);
6
6
7
    SetVersion( $DBversion );
7
    SetVersion( $DBversion );
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 443-449 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
443
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
443
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
444
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
444
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
445
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
445
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
446
('ProtectSuperlibPrivs','0',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
446
('ProtectSuperlibrarianPrivileges','0',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
447
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
447
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
448
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
448
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
449
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
449
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 200-206 Patrons: Link Here
200
           class: integer
200
           class: integer
201
         - failed login attempts.
201
         - failed login attempts.
202
     -
202
     -
203
         - pref: ProtectSuperlibPrivs
203
         - pref: ProtectSuperlibrarianPrivileges
204
           choices:
204
           choices:
205
               yes: Allow only superlibrarians
205
               yes: Allow only superlibrarians
206
               no: Do not block permitted non-superlibrarians
206
               no: Do not block permitted non-superlibrarians
(-)a/members/member-flags.pl (-3 / +2 lines)
Lines 84-90 if ($input->param('newflags')) { Link Here
84
    }
84
    }
85
    
85
    
86
    $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
86
    $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
87
    if( !C4::Context->preference('ProtectSuperlibPrivs') || C4::Context->IsSuperLibrarian ) {
87
    if( !C4::Context->preference('ProtectSuperlibrarianPrivileges') || C4::Context->IsSuperLibrarian ) {
88
        $sth->execute($module_flags, $member);
88
        $sth->execute($module_flags, $member);
89
    } else {
89
    } else {
90
        my $old_flags = $patron->flags // 0;
90
        my $old_flags = $patron->flags // 0;
Lines 206-212 $template->param( Link Here
206
    loop           => \@loop,
206
    loop           => \@loop,
207
    csrf_token =>
207
    csrf_token =>
208
        Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
208
        Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
209
    disable_superlibrarian_privs => C4::Context->preference('ProtectSuperlibPrivs') ? !C4::Context->IsSuperLibrarian : 0,
209
    disable_superlibrarian_privs => C4::Context->preference('ProtectSuperlibrarianPrivileges') ? !C4::Context->IsSuperLibrarian : 0,
210
);
210
);
211
211
212
    output_html_with_http_headers $input, $cookie, $template->output;
212
    output_html_with_http_headers $input, $cookie, $template->output;
213
- 

Return to bug 20100