Fixing missing padding on module version
[koha.git] / members / setdebar.pl
1 #!/usr/bin/perl
2
3 # Copyright 2000-2002 Katipo Communications
4 #
5 # This file is part of Koha.
6 #
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.
11 #
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.
15 #
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.
19
20
21 =head1 setdebar.pl
22
23 script to set or lift debarred status
24 written 2/8/04
25 by oleonard@athenscounty.lib.oh.us
26
27 =cut
28
29 use strict;
30 use warnings;
31
32 use CGI;
33 use C4::Context;
34 use C4::Auth;
35
36 my $input = new CGI;
37
38 my $flagsrequired;
39 $flagsrequired->{borrowers} = 1;
40 my ( $loggedinuser, $cookie, $sessionID ) =
41   checkauth( $input, 0, $flagsrequired );
42
43 my $destination    = $input->param("destination") || '';
44 my $cardnumber     = $input->param("cardnumber");
45 my $borrowernumber = $input->param('borrowernumber');
46 my $status         = $input->param('status');
47
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;
53
54 if ( $destination eq "circ" ) {
55     print $input->redirect(
56         "/cgi-bin/koha/circ/circulation.pl?findborrower=".$cardnumber);
57 }
58 else {
59     print $input->redirect(
60         "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
61 }