Bug 11945: The script should die if the pref are not filled
authorJonathan Druart <jonathan.druart@biblibre.com>
Sat, 11 Oct 2014 20:43:52 +0000 (22:43 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 24 Oct 2014 13:02:01 +0000 (10:02 -0300)
If the 2 prefs are not defined, the script should die.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

misc/cronjobs/delete_expired_opac_registrations.pl

index 7a24d47..b88b9b6 100755 (executable)
@@ -69,6 +69,9 @@ my $delay =
 my $category_code =
   C4::Context->preference('PatronSelfRegistrationDefaultCategory');
 
+die "PatronSelfRegistrationExpireTemporaryAccountsDelay and PatronSelfRegistrationDefaultCategory should be filled to use this script!"
+    if not $category_code or not defined $delay or $delay eq q||;
+
 my $query = "
     SELECT borrowernumber
     FROM borrowers