[freeside-commits] branch master updated. 01eb5584fe47513d2e61459c7df303670104bd9a

Ivan ivan at 420.am
Sun Sep 25 11:01:36 PDT 2016


The branch, master has been updated
       via  01eb5584fe47513d2e61459c7df303670104bd9a (commit)
      from  38e8bacd564b497854017c54dff8ebc0abe2cb33 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 01eb5584fe47513d2e61459c7df303670104bd9a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Sep 25 11:01:35 2016 -0700

    suspend/unsuspend CF users

diff --git a/FS/FS/part_export/cardfortress.pm b/FS/FS/part_export/cardfortress.pm
index 8c94135..ae8e296 100644
--- a/FS/FS/part_export/cardfortress.pm
+++ b/FS/FS/part_export/cardfortress.pm
@@ -55,10 +55,15 @@ sub _export_replace {
   '';
 }
 
-sub _export_delete {
-  my( $self, $svc_acct ) = (shift, shift);
+#well, we're just going to disable them for now, but there you go
+sub _export_delete    { shift->merchant_disable(@_) }
+
+sub _export_suspend   { shift->merchant_disable(@_) }
 
-  #well, we're just going to disable them for now, but there you go
+sub _export_unsuspend { shift->merchant_enable(@_) }
+
+sub merchant_disable {
+  my( $self, $svc_acct ) = (shift, shift);
 
   open my $def_in, '<', '/dev/null' or die "unable to open /dev/null";
   my $ssh = Net::OpenSSH->new( $self->machine,
@@ -74,4 +79,21 @@ sub _export_delete {
 
 }
 
+sub merchant_enable {
+  my( $self, $svc_acct ) = (shift, shift);
+
+  open my $def_in, '<', '/dev/null' or die "unable to open /dev/null";
+  my $ssh = Net::OpenSSH->new( $self->machine,
+                               default_stdin_fh => $def_in );
+
+  #capture2 and return STDERR, its probably useful if there's a problem
+  my $unused_output = $ssh->capture(
+    '/usr/local/bin/merchant_enable', map $svc_acct->$_, qw( username )
+  );
+  return $ssh->error if $ssh->error;
+
+  '';
+
+}
+
 1;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_export/cardfortress.pm |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list