Bug 7057: CheckReserves uses GetMemberDetails unnecessarily
[koha.git] / members / setdebar.pl
blobb12ab57ab70e73e635054268cbba40f467bc236a
1 #!/usr/bin/perl
3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
10 # version.
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 =head1 setdebar.pl
23 script to set or lift debarred status
24 written 2/8/04
25 by oleonard@athenscounty.lib.oh.us
27 =cut
29 use strict;
30 use warnings;
32 use CGI;
33 use C4::Context;
34 use C4::Auth;
36 my $input = new CGI;
38 my $flagsrequired;
39 $flagsrequired->{borrowers} = 1;
40 my ( $loggedinuser, $cookie, $sessionID ) =
41 checkauth( $input, 0, $flagsrequired );
43 my $destination = $input->param("destination") || '';
44 my $cardnumber = $input->param("cardnumber");
45 my $borrowernumber = $input->param('borrowernumber');
46 my $status = $input->param('status');
48 my $dbh = C4::Context->dbh;
49 my $sth =
50 $dbh->prepare("Update borrowers set debarred = ? where borrowernumber = ?");
51 $sth->execute( $status, $borrowernumber );
52 $sth->finish;
54 if ( $destination eq "circ" ) {
55 print $input->redirect(
56 "/cgi-bin/koha/circ/circulation.pl?findborrower=".$cardnumber);
58 else {
59 print $input->redirect(
60 "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");