summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-07-03 10:33:37 +0000
committerivan <ivan>2002-07-03 10:33:37 +0000
commit0da4c69a66e13410b0eff18966e13170d1306f22 (patch)
tree114bf49efe75585fd9808927f7cd065019b80a9e
parente48985560b4c23e511658f2d638b762c061beee1 (diff)
preload all dbdefs
-rw-r--r--FS/FS/InitHandler.pm75
-rw-r--r--FS/MANIFEST2
-rw-r--r--FS/t/InitHandler.t5
3 files changed, 82 insertions, 0 deletions
diff --git a/FS/FS/InitHandler.pm b/FS/FS/InitHandler.pm
new file mode 100644
index 000000000..9a2154aa1
--- /dev/null
+++ b/FS/FS/InitHandler.pm
@@ -0,0 +1,75 @@
+package FS::InitHandler;
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record;
+
+sub handler {
+
+=pod
+
+ use Date::Format;
+ use Date::Parse;
+ use Tie::IxHash;
+ use HTML::Entities;
+ use IO::Handle;
+ use IO::File;
+ use String::Approx:
+ use HTML::Widgets::SelectLayers 0.02;
+ #use FS::UID;
+ #use FS::Record;
+ use FS::Conf;
+ use FS::CGI;
+ use FS::Msgcat;
+
+ use FS::agent;
+ use FS::agent_type;
+ use FS::domain_record;
+ use FS::cust_bill;
+ use FS::cust_bill_pay;
+ use FS::cust_credit;
+ use FS::cust_credit_bill;
+ use FS::cust_main;
+ use FS::cust_main_county;
+ use FS::cust_pay;
+ use FS::cust_pkg;
+ use FS::cust_refund;
+ use FS::cust_svc;
+ use FS::nas;
+ use FS::part_bill_event;
+ use FS::part_pkg;
+ use FS::part_referral;
+ use FS::part_svc;
+ use FS::pkg_svc;
+ use FS::port;
+ use FS::queue qw(joblisting);
+ use FS::raddb;
+ use FS::session;
+ use FS::svc_acct;
+ use FS::svc_acct_pop qw(popselector);
+ use FS::svc_acct_sm;
+ use FS::svc_domain;
+ use FS::svc_forward;
+ use FS::svc_www;
+ use FS::type_pkgs;
+ use FS::part_export;
+ use FS::part_export_option;
+ use FS::export_svc;
+ use FS::msgcat;
+
+=cut
+
+ open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets")
+ or die "can't read $FS::UID::conf_dir/mapsecrets: $!";
+
+ while (<MAPSECRETS>) {
+ /^([\w\-\.]+)\s/ or do { warn "strange line in mapsecrets: $_"; next; };
+ my $user = $1;
+ adminsuidsetup($user);
+ }
+
+ close MAPSECRETS;
+
+}
+
+1;
diff --git a/FS/MANIFEST b/FS/MANIFEST
index d9860b15f..da04b1d5c 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -19,6 +19,7 @@ bin/freeside-expiration-alerter
bin/freeside-reexport
FS.pm
FS/CGI.pm
+FS/InitHandler.pm
FS/Conf.pm
FS/ConfItem.pm
FS/Record.pm
@@ -94,6 +95,7 @@ FS/cust_tax_exempt.pm
t/agent.t
t/agent_type.t
t/CGI.t
+t/InitHandler.t
t/Conf.t
t/ConfItem.t
t/Record.t
diff --git a/FS/t/InitHandler.t b/FS/t/InitHandler.t
new file mode 100644
index 000000000..0ce60c833
--- /dev/null
+++ b/FS/t/InitHandler.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::InitHandler;
+$loaded=1;
+print "ok 1\n";