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

(-)a/members/member-flags.pl (-2 / +12 lines)
Lines 87-93 if ($input->param('newflags')) { Link Here
87
    }
87
    }
88
    
88
    
89
    $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
89
    $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
90
    $sth->execute($module_flags, $member);
90
    if( !C4::Context->preference('ProtectSuperlibPrivs') || C4::Context->IsSuperLibrarian ) {
91
        $sth->execute($module_flags, $member);
92
    } else {
93
        my $old_flags = $patron->flags // 0;
94
        if( ( $old_flags == 1 || $module_flags == 1 ) &&
95
              $old_flags != $module_flags ) {
96
           die "Non-superlibrarian is changing superlibrarian privileges"; # Interface should not allow this, so we can just die here
97
        } else {
98
            $sth->execute($module_flags, $member);
99
        }
100
    }
91
    
101
    
92
    # deal with subpermissions
102
    # deal with subpermissions
93
    $sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?");
103
    $sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?");
Lines 200-205 $template->param( Link Here
200
    loop           => \@loop,
210
    loop           => \@loop,
201
    csrf_token =>
211
    csrf_token =>
202
        Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
212
        Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
213
    disable_superlibrarian_privs => C4::Context->preference('ProtectSuperlibPrivs') ? !C4::Context->IsSuperLibrarian : 0,
203
);
214
);
204
215
205
    output_html_with_http_headers $input, $cookie, $template->output;
216
    output_html_with_http_headers $input, $cookie, $template->output;
206
- 

Return to bug 20100