Lines 84-101
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('ProtectSuperlibrarianPrivileges') || C4::Context->IsSuperLibrarian ) { |
87 |
my $old_flags = $patron->flags // 0; |
88 |
$sth->execute($module_flags, $member); |
88 |
if( ( $old_flags == 1 || $module_flags == 1 ) && |
89 |
} else { |
89 |
$old_flags != $module_flags ) { |
90 |
my $old_flags = $patron->flags // 0; |
90 |
die "Non-superlibrarian is changing superlibrarian privileges" if !C4::Context->IsSuperLibrarian && C4::Context->preference('ProtectSuperlibrarianPrivileges'); # Interface should not allow this, so we can just die here |
91 |
if( ( $old_flags == 1 || $module_flags == 1 ) && |
|
|
92 |
$old_flags != $module_flags ) { |
93 |
die "Non-superlibrarian is changing superlibrarian privileges"; # Interface should not allow this, so we can just die here |
94 |
} else { |
95 |
$sth->execute($module_flags, $member); |
96 |
} |
97 |
} |
91 |
} |
98 |
|
92 |
$sth->execute($module_flags, $member); |
|
|
93 |
|
99 |
# deal with subpermissions |
94 |
# deal with subpermissions |
100 |
$sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?"); |
95 |
$sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?"); |
101 |
$sth->execute($member); |
96 |
$sth->execute($member); |
102 |
- |
|
|