From a6e423aa1070bde95bd2f55d656e9685e58de452 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 24 Sep 2009 19:59:58 +0000 Subject: [PATCH] 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 aa6a13321..09545720c 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3004,6 +3004,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' => 'disable-cust-pkg_class', 'section' => 'UI', 'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.', 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