diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-09-25 11:01:37 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-09-25 11:01:37 -0700 |
commit | 98de62fed599dcecb7b9c63ec2b947cd34ff124d (patch) | |
tree | 04260e90675991cc0ffdabd7cae9be2867e86a11 /FS/FS/part_export/cardfortress.pm | |
parent | 38f5f57e1fa7e252c796c95b819579503ce65577 (diff) |
suspend/unsuspend CF users
Diffstat (limited to 'FS/FS/part_export/cardfortress.pm')
-rw-r--r-- | FS/FS/part_export/cardfortress.pm | 28 |
1 files changed, 25 insertions, 3 deletions
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; |