X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Feveryone_net.pm;h=7386973e492dc6812803ee30a47b76ba4460b798;hb=ffa18709ee8a4d05e18d2d406cf73afe79e52524;hp=5a85b8df7228f0546ae07c1855ed73a19aa24957;hpb=7600393bd5aa643ae776a2149174fc63d372dd8f;p=freeside.git diff --git a/FS/FS/part_export/everyone_net.pm b/FS/FS/part_export/everyone_net.pm index 5a85b8df7..7386973e4 100644 --- a/FS/FS/part_export/everyone_net.pm +++ b/FS/FS/part_export/everyone_net.pm @@ -10,15 +10,19 @@ tie my %options, 'Tie::IxHash', 'clientID' => { label=>'clientID' }, 'password' => { label=>'Password' }, #'workgroup' => { label=>'Default Workgroup' }, + 'debug' => { label=>'Enable debugging', + type=>'checkbox' }, ; %info = ( 'svc' => 'svc_acct', 'desc' => 'Real-time export to Everyone.net outsourced mail service', 'options'=> \%options, + 'no_machine' => 1, + 'default_svc_class' => 'Email', 'notes' => <<'END' Real-time export to -Everyone.net via the XRC Remote API. +Everyone.net via the XRC Remote API. Requires installation of Net::XRC from CPAN. @@ -51,14 +55,17 @@ sub _xrc_command { eval "use Net::XRC qw(:types);"; return $@ if $@; + local($Net::XRC::DEBUG) = 1 + if $self->option('debug'); + my $xrc = new Net::XRC ( 'clientID' => $self->option('clientID'), 'password' => $self->option('password'), ); my $dresponse = $xrc->lookupMXReadyClientIDByEmailDomain( string($domain) ); - return $response->error unless $response->is_success; - my $clientID = $response->content; + return $dresponse->error unless $dresponse->is_success; + my $clientID = $dresponse->content; return "clientID for domain $domain not found" if $clientID == -1; @@ -82,7 +89,6 @@ sub _export_replace { $self->_xrc_command( 'setUserPassword', $new->domain, - $domain_clientID, string($new->username), string($new->_password), ); @@ -108,7 +114,6 @@ sub _export_suspend { $self->_xrc_command( 'suspendUser', $svc_acct->domain, - $domain_clientID, string($svc_acct->username), ); }