Lines 1-70
Link Here
|
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# Copyright 2009-2010 Kyle Hall |
4 |
# |
5 |
# This file is part of Koha. |
6 |
# |
7 |
# Koha is free software; you can redistribute it and/or modify it |
8 |
# under the terms of the GNU General Public License as published by |
9 |
# the Free Software Foundation; either version 3 of the License, or |
10 |
# (at your option) any later version. |
11 |
# |
12 |
# Koha is distributed in the hope that it will be useful, but |
13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
# GNU General Public License for more details. |
16 |
# |
17 |
# You should have received a copy of the GNU General Public License |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
20 |
use Modern::Perl; |
21 |
use Getopt::Long; |
22 |
|
23 |
BEGIN { |
24 |
|
25 |
# find Koha's Perl modules |
26 |
# test carefully before changing this |
27 |
use FindBin; |
28 |
eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib }; |
29 |
} |
30 |
|
31 |
use C4::Context; |
32 |
|
33 |
my $help; |
34 |
my $confirm; |
35 |
my $verbose; |
36 |
|
37 |
GetOptions( |
38 |
'h|help' => \$help, |
39 |
'c|confirm' => \$confirm, |
40 |
'v|verbose' => \$verbose, |
41 |
); |
42 |
my $usage = << 'ENDUSAGE'; |
43 |
|
44 |
IMPORTANT: You should no longer call this script. Please use |
45 |
cleanup_database.pl with parameter --del-exp-selfreg. |
46 |
|
47 |
This script removes confirmed OPAC based patron registrations |
48 |
that have not been changed from the patron category specified |
49 |
in the system preference PatronSelfRegistrationDefaultCategory |
50 |
within the required time period. |
51 |
|
52 |
NOTE: If you do not use self registration, do NOT run this script. |
53 |
If you use self registration, but you do not use a temporary |
54 |
category for new registrations, do NOT run this script too. |
55 |
|
56 |
This script has the following parameters : |
57 |
-c --confirm: Without this flag set, this script will do nothing. |
58 |
-h --help: Print this message. |
59 |
-v --verbose: Print number of removed patrons. |
60 |
|
61 |
ENDUSAGE |
62 |
|
63 |
if ( $help || !$confirm ) { |
64 |
print $usage; |
65 |
exit; |
66 |
} |
67 |
|
68 |
my $c= "$FindBin::Bin/cleanup_database.pl --del-exp-selfreg"; |
69 |
$c.= " -v" if $verbose; |
70 |
system($c); |
71 |
- |