[open-ils-commits] r17250 - trunk/Open-ILS/src/perlmods/OpenILS/WWW (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Aug 18 13:40:20 EDT 2010


Author: erickson
Date: 2010-08-18 13:40:16 -0400 (Wed, 18 Aug 2010)
New Revision: 17250

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
Log:
provide an explicit import() sub to collect the boostrap config name at import.  force child_init to run (once) if not run by Apache

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm	2010-08-18 17:39:34 UTC (rev 17249)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm	2010-08-18 17:40:16 UTC (rev 17250)
@@ -44,7 +44,13 @@
 
 my ($bootstrap, $actor, $templates);
 my $i18n = {};
+my $init_done = 0; # has child_init been called?
 
+sub import {
+    my $self = shift;
+    $bootstrap = shift;
+}
+
 sub child_init {
     OpenSRF::System->bootstrap_client( config_file => $bootstrap );
     
@@ -54,10 +60,14 @@
     $templates = $conf->config_value("dirs", "templates");
     $actor = OpenSRF::AppSession->create('open-ils.actor');
     load_i18n();
+    $init_done = 1;
 }
 
 sub password_reset {
     my $apache = shift;
+
+    child_init() unless $init_done;
+
     return Apache2::Const::DECLINED if (-e $apache->filename);
 
     $apache->content_type('text/html');



More information about the open-ils-commits mailing list