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 199-204
$template->param(
Link Here
|
199 |
loop => \@loop, |
209 |
loop => \@loop, |
200 |
csrf_token => |
210 |
csrf_token => |
201 |
Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), |
211 |
Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), |
|
|
212 |
disable_superlibrarian_privs => C4::Context->preference('ProtectSuperlibPrivs') ? !C4::Context->IsSuperLibrarian : 0, |
202 |
); |
213 |
); |
203 |
|
214 |
|
204 |
output_html_with_http_headers $input, $cookie, $template->output; |
215 |
output_html_with_http_headers $input, $cookie, $template->output; |
205 |
- |
|
|