adding (stub) bsdshell and textradius exports
[freeside.git] / FS / FS / part_export / bsdshell.pm
1 package FS::part_export::bsdshell;
2
3 use vars qw(@ISA);
4 use FS::part_export;
5
6 @ISA = qw(FS::part_export);
7
8 sub rebless { shift; }
9
10 sub _export_insert {
11   my($self, $svc_acct) = (shift, shift);
12   $err_or_queue = $self->bsdshell_queue( $svc_acct->svcnum, 'insert',
13     $svc_acct->username, $svc_acct->_password );
14   ref($err_or_queue) ? '' : $err_or_queue;
15 }
16
17 sub _export_replace {
18   my( $self, $new, $old ) = (shift, shift, shift);
19   #return "can't change username with bsdshell"
20   #  if $old->username ne $new->username;
21   #return '' unless $old->_password ne $new->_password;
22   $err_or_queue = $self->bsdshell_queue( $new->svcnum,
23     'replace', $new->username, $new->_password );
24   ref($err_or_queue) ? '' : $err_or_queue;
25 }
26
27 sub _export_delete {
28   my( $self, $svc_acct ) = (shift, shift);
29   $err_or_queue = $self->bsdshell_queue( $svc_acct->svcnum,
30     'delete', $svc_acct->username );
31   ref($err_or_queue) ? '' : $err_or_queue;
32 }
33
34 #a good idea to queue anything that could fail or take any time
35 sub bsdshell_queue {
36   my( $self, $svcnum, $method ) = (shift, shift, shift);
37   my $queue = new FS::queue {
38     'svcnum' => $svcnum,
39     'job'    => "FS::part_export::bsdshell::bsdshell_$method",
40   };
41   $queue->insert( @_ ) or $queue;
42 }
43
44 sub bsdshell_insert { #subroutine, not method
45 }
46 sub bsdshell_replace { #subroutine, not method
47 }
48 sub bsdshell_delete { #subroutine, not method
49 }
50