From e8bf694b45f68f0cf934d2548086560562de9553 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 24 Sep 2009 20:00:36 +0000 Subject: [PATCH 1/1] get the ping username/pass from a config, good enough, RT#4610 --- FS/FS/Conf.pm | 14 ++++++++++++++ FS/FS/Cron/check.pm | 7 ++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 362b63c4d..bb1058f77 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2464,6 +2464,20 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'sg-ping_username', + 'section' => '', + 'description' => "Don't use this.", + 'type' => 'text', + }, + + { + 'key' => 'sg-ping_password', + 'section' => '', + 'description' => "Don't use this.", + 'type' => 'text', + }, + + { 'key' => 'queued-max_kids', 'section' => '', 'description' => 'Maximum number of queued processes. Defaults to 10.', diff --git a/FS/FS/Cron/check.pm b/FS/FS/Cron/check.pm index b331014ab..b50140ca1 100644 --- a/FS/FS/Cron/check.pm +++ b/FS/FS/Cron/check.pm @@ -47,14 +47,14 @@ sub check_selfservice { sub check_sg { my $conf = new FS::Conf; + #different trigger if they ever stop using multicustomer_hack ? return 1 unless $conf->exists('sg-multicustomer_hack'); my $ua = new LWP::UserAgent; $ua->agent("FreesideCronCheck/0.1 " . $ua->agent); - #XXX shiiiiit. - my $USER = ''; - my $PASS = ''; + my $USER = $conf->config('sg-ping_username'); + my $PASS = $conf->config('sg-ping_password'); my $req = new HTTP::Request GET=>"https://$USER:$PASS\@localhost/sg/ping.cgi"; my $res = $ua->request($req); @@ -68,6 +68,7 @@ sub check_sg { sub check_sgng { my $conf = new FS::Conf; + #different trigger if they ever stop using multicustomer_hack ? return 1 unless $conf->exists('sg-multicustomer_hack'); eval 'use RPC::XML; use RPC::XML::Client;'; -- 2.11.0