From b050afd1e11317e7c4833d5aba591afdd2615931 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 18 Aug 2010 17:40:16 +0000 Subject: [PATCH] provide an explicit import() sub to collect the boostrap config name at import. force child_init to run (once) if not run by Apache git-svn-id: svn://svn.open-ils.org/ILS/trunk@17250 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm b/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm index 2e3fc2fbc0..17ec3059f0 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm @@ -44,6 +44,12 @@ my $U = 'OpenILS::Application::AppUtils'; 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 @@ sub child_init { $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'); -- 2.11.0