1 package FS::part_export::cardfortress;
4 use base 'FS::part_export';
6 use String::ShellQuote;
8 #tie my %options, 'Tie::IxHash';
13 'desc' => 'CardFortress',
14 'options' => {}, #\%options,
19 sub rebless { shift; }
22 my($self, $svc_acct) = (shift, shift);
24 eval "use Net::OpenSSH;";
27 open my $def_in, '<', '/dev/null' or die "unable to open /dev/null";
28 my $ssh = Net::OpenSSH->new( $self->machine,
29 default_stdin_fh => $def_in );
31 #capture2 and return STDERR, its probably useful if there's a problem
32 my $private_key = $ssh->capture(
33 { 'stdin_data' => $svc_acct->_password. "\n" },
34 '/usr/local/bin/merchant_create', map $svc_acct->$_, qw( username finger )
36 return $ssh->error if $ssh->error;
38 $svc_acct->cf_privatekey($private_key);
45 my( $self, $new, $old ) = (shift, shift, shift);
47 return 'username changes not yet supported'
48 if $old->username ne $new->username;
50 return 'password changes not yet supported'
51 if $old->_password ne $new->_password;
53 return 'Real name changes not yet supported'
54 if $old->finger ne $new->finger;
60 my( $self, $svc_acct ) = (shift, shift);
62 #well, we're just going to disable them for now, but there you go
64 eval "use Net::OpenSSH;";
67 open my $def_in, '<', '/dev/null' or die "unable to open /dev/null";
68 my $ssh = Net::OpenSSH->new( $self->machine,
69 default_stdin_fh => $def_in );
71 #capture2 and return STDERR, its probably useful if there's a problem
72 my $unused_output = $ssh->capture(
73 '/usr/local/bin/merchant_disable', map $svc_acct->$_, qw( username )
75 return $ssh->error if $ssh->error;