[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/members deletemem.pl [rel_2_2]
From: |
Waylon Robertson |
Subject: |
[Koha-cvs] koha/members deletemem.pl [rel_2_2] |
Date: |
Sun, 28 Jan 2007 03:42:54 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: Waylon Robertson <genji> 07/01/28 03:42:54
Modified files:
members : deletemem.pl
Log message:
Fix for bug 1269 - a normal librarian can no longer delete a
superlibrarian.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/members/deletemem.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.8&r2=1.4.2.9
Patches:
Index: deletemem.pl
===================================================================
RCS file: /sources/koha/koha/members/deletemem.pl,v
retrieving revision 1.4.2.8
retrieving revision 1.4.2.9
diff -u -b -r1.4.2.8 -r1.4.2.9
--- deletemem.pl 18 Jan 2007 14:46:28 -0000 1.4.2.8
+++ deletemem.pl 28 Jan 2007 03:42:54 -0000 1.4.2.9
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: deletemem.pl,v 1.4.2.8 2007/01/18 14:46:28 hdl Exp $
+# $Id: deletemem.pl,v 1.4.2.9 2007/01/28 03:42:54 genji Exp $
#script to delete items
#written 2/5/00
@@ -54,9 +54,10 @@
foreach (sort keys %$issues) {
$i++;
}
+my $userenv = C4::Context->userenv;
my ($bor,$flags)=getpatroninformation(\%env, $member,'');
if (C4::Context->preference("IndependantBranches")) {
- my $userenv = C4::Context->userenv;
+
unless ($userenv->{flags} == 1){
unless ($userenv->{'branch'} eq $bor->{'branchcode'}){
# warn "user ".$userenv->{'branch'} ."borrower :".
$bor->{'branchcode'};
@@ -70,14 +71,15 @@
$sth->execute($member);
my $data=$sth->fetchrow_hashref;
$sth->finish;
-
-if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
+my $bor = getpatroninformation(\%env, $member,'');
+my $accessflags = $bor->{'authflags'};
+if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne '' ||
($accessflags->{'superlibrarian'} && $userenv->{flags} != 1)){
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name =>
"members/deletemem.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {borrower => 1},
+ flagsrequired => {borrowers => 1},
debug => 1,
});
# print $input->header;
@@ -91,6 +93,9 @@
if ($data ne '') {
$template->param(guarantees => 1);
}
+ if ($accessflags->{'superlibrarian'} && $userenv->{flags} != 1){
+ $template->param(superlibrarian => 'Member is a superlibrarian, and
you are not');
+ }
# print "<table border=1>";
# if ($i > 0){
# print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";