diff options
author | ivan <ivan> | 2010-12-10 22:08:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-12-10 22:08:36 +0000 |
commit | 1318909d7eb16d736cbfb9f641eecccb00d4636c (patch) | |
tree | 24eb3ede37c104ea8b4e799013ae2d2d136eb207 /FS/FS | |
parent | 457da870c23db87fbbc29d7c667a73f41422dd71 (diff) |
cardfortress backend support
Diffstat (limited to 'FS/FS')
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/Schema.pm | 38 | ||||
-rw-r--r-- | FS/FS/part_export/cardfortress.pm | 64 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 8 |
4 files changed, 114 insertions, 3 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index ebeebb261..a05ad0358 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4103,6 +4103,13 @@ and customer address. Include units.', ], }, + { + '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" }, diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 70aab4315..b48e5af8a 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1746,6 +1746,8 @@ sub tables_hashref { '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 @@ -3094,7 +3096,43 @@ sub tables_hashref { '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 diff --git a/FS/FS/part_export/cardfortress.pm b/FS/FS/part_export/cardfortress.pm new file mode 100644 index 000000000..4916a6ee0 --- /dev/null +++ b/FS/FS/part_export/cardfortress.pm @@ -0,0 +1,64 @@ +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; diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index f2b13c312..ac336b8f6 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1207,16 +1207,19 @@ sub check { || $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') @@ -1224,7 +1227,6 @@ sub check { || $self->ut_textn('cgp_skinname') || $self->ut_textn('cgp_prontoskinname') || $self->ut_alphan('cgp_sendmdnmode') - #XXX RPOP settings ; return $error if $error; |