get the ping username/pass from a config, good enough, RT#4610
authorivan <ivan>
Thu, 24 Sep 2009 19:59:58 +0000 (19:59 +0000)
committerivan <ivan>
Thu, 24 Sep 2009 19:59:58 +0000 (19:59 +0000)
FS/FS/Conf.pm
FS/FS/Cron/check.pm

index aa6a133..0954572 100644 (file)
@@ -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.',
index b331014..b50140c 100644 (file)
@@ -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;';