],
},
+ {
+ 'key' => 'svc_acct-cf_privatekey-message',
+ 'section' => '',
+ 'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
+ 'type' => 'textarea',
+ },
+
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
'pbxsvc', 'int', 'NULL', '', '', '',
'last_login', @date_type, '', '',
'last_logout', @date_type, '', '',
+ #cardfortress field(s)
+ 'cf_privatekey', 'text', 'NULL', '', '', '',
#communigate pro fields (quota = MaxAccountSize)
'cgp_aliases', 'varchar', 'NULL', 255, '', '',
#settings
'unique' => [],
'index' => [], #recnum
},
+
+ 'nms_device' => {
+ 'columns' => [
+ 'nms_devicenum', 'serial', '', '', '', '',
+ #'agentnum', 'int', 'NULL', '', '', '',
+ 'devicename', 'varchar', '', $char_d, '', '',
+ 'ip', 'varchar', '', 15, '', '',
+ 'protocol', 'varchar', '', $char_d, '', '',
+# 'last', 'int', '', '', '', '',
+ ],
+ 'primary_key' => 'nms_devicenum',
+ 'unique' => [],
+ 'index' => [],
+ },
+ 'nms_deviceport' => {
+ 'columns' => [
+ 'portnum', 'serial', '', '', '', '',
+ 'nms_devicenum', 'int', '', '', '', '',
+ 'deviceport', 'int', '', '', '', '',
+ #'ip', 'varchar', 'NULL', 15, '', '',
+ 'svcnum', 'int', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'portnum',
+ 'unique' => [ [ 'nms_devicenum', 'deviceport' ] ],
+ 'index' => [ [ 'svcnum' ] ],
+ },
+
+ 'svc_port' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '', '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [],
+ 'index' => [], #recnum
+ },
+
# name type nullability length default local
--- /dev/null
+package FS::part_export::cardfortress;
+
+use strict;
+use base 'FS::part_export';
+use vars qw( %info );
+use String::ShellQuote;
+
+#tie my %options, 'Tie::IxHash';
+#;
+
+%info = (
+ 'svc' => 'svc_acct',
+ 'desc' => 'CardFortress',
+ 'options' => {}, #\%options,
+ 'nodomain' => 'Y',
+ 'notes' => '',
+);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+
+ eval "use Net::OpenSSH;";
+ return $@ if $@;
+
+ 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 );
+
+ my $private_key = $ssh->capture(
+ { 'stdin_data' => $svc_acct->_password. "\n" },
+ '/usr/local/bin/merchant_create', map $svc_acct->$_, qw( username finger )
+ );
+ return $ssh->error if $ssh->error;
+
+ $svc_acct->cf_privatekey($private_key);
+
+ $svc_acct->replace;
+
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+
+ return 'username changes not yet supported'
+ if $old->username ne $new->username;
+
+ return 'password changes not yet supported'
+ if $old->_password ne $new->_password;
+
+ return 'Real name changes not yet supported'
+ if $old->finger ne $new->finger;
+
+ '';
+}
+
+sub _export_delete {
+ #my( $self, $svc_x ) = (shift, shift);
+
+ return 'deletion not yet supproted';
+}
+
+1;
|| $self->ut_enum('_password_encoding', ['',qw(plain crypt ldap)])
|| $self->ut_enum('password_selfchange', [ '', 'Y' ])
|| $self->ut_enum('password_recover', [ '', 'Y' ])
+ #cardfortress
+ || $self->ut_anything('cf_privatekey')
+ #communigate
|| $self->ut_textn('cgp_accessmodes')
|| $self->ut_alphan('cgp_type')
|| $self->ut_textn('cgp_aliases' ) #well
- #settings
+ # settings
|| $self->ut_alphasn('cgp_rulesallowed')
|| $self->ut_enum('cgp_rpopallowed', [ '', 'Y' ])
|| $self->ut_enum('cgp_mailtoall', [ '', 'Y' ])
|| $self->ut_enum('cgp_addmailtrailer', [ '', 'Y' ])
|| $self->ut_snumbern('cgp_archiveafter')
- #preferences
+ # preferences
|| $self->ut_alphasn('cgp_deletemode')
|| $self->ut_enum('cgp_emptytrash', $self->cgp_emptytrash_values)
|| $self->ut_alphan('cgp_language')
|| $self->ut_textn('cgp_skinname')
|| $self->ut_textn('cgp_prontoskinname')
|| $self->ut_alphan('cgp_sendmdnmode')
- #XXX RPOP settings
;
return $error if $error;
}
my %hash = $svcnum ? $old->hash : ();
-map {
+for ( fields('svc_acct'), qw( pkgnum svcpart usergroup ) ) {
$hash{$_} = scalar($cgi->param($_));
- #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir
- # shell quota slipip)
- } (fields('svc_acct'), qw ( pkgnum svcpart usergroup ));
+}
+if ( $svcnum ) {
+ for ( grep $old->$_, qw( cf_privatekey ) ) {
+ $hash{$_} = $old->$_;
+ }
+}
my $new = new FS::svc_acct ( \%hash );
my $error = '';
</FORM>
<BR>
+<% include( 'svc_acct/cardfortress.html',
+ 'svc_acct' => $svc_acct,
+ %gopt,
+ )
+%>
+
<% include( 'svc_acct/hosting.html',
%gopt,
)
--- /dev/null
+% if ( $svc_acct->cf_privatekey ) {
+
+<div class="fscontainer">
+<div class="fsbox">
+<div class="fsbox-title">
+ <span class="left">Card Fortress</span>
+</div>
+
+ <PRE><FONT STYLE="font-family:monospace"><% $svc_acct->cf_privatekey %></FONT></PRE>
+
+ <% $conf->config('svc_acct-cf_privatekey-message') %>
+
+%#XXX and then there should be a remove link to get rid of it
+
+% }
+
+</div>
+</div>
+<%init>
+
+my %opt = @_;
+
+my $svc_acct = $opt{'svc_acct'};
+
+my $conf = new FS::Conf;
+
+</%init>