summaryrefslogtreecommitdiff
path: root/FS/FS/part_export.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/part_export.pm')
-rw-r--r--FS/FS/part_export.pm104
1 files changed, 96 insertions, 8 deletions
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
index 752bbb1d3..52c8213a0 100644
--- a/FS/FS/part_export.pm
+++ b/FS/FS/part_export.pm
@@ -141,7 +141,7 @@ sub insert {
'';
-};
+}
=item delete
@@ -371,6 +371,7 @@ sub rebless {
my $exporttype = $self->exporttype;
my $class = ref($self). "::$exporttype";
eval "use $class;";
+ die $@ if $@;
bless($self, $class);
}
@@ -413,6 +414,26 @@ sub export_delete {
$self->_export_delete(@_);
}
+=item export_suspend
+
+=cut
+
+sub export_suspend {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_suspend(@_);
+}
+
+=item export_unsuspend
+
+=cut
+
+sub export_unsuspend {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_unsuspend(@_);
+}
+
#fallbacks providing useful error messages intead of infinite loops
sub _export_insert {
my $self = shift;
@@ -429,6 +450,20 @@ sub _export_delete {
return "_export_delete: unknown export type ". $self->exporttype;
}
+#fallbacks providing null operations
+
+sub _export_suspend {
+ my $self = shift;
+ #warn "warning: _export_suspened unimplemented for". ref($self);
+ '';
+}
+
+sub _export_unsuspend {
+ my $self = shift;
+ #warn "warning: _export_unsuspend unimplemented for ". ref($self);
+ '';
+}
+
=back
=head1 SUBROUTINES
@@ -465,6 +500,12 @@ Returns the applicable I<svcdb> for an I<exporttype>.
=cut
+# This subroutine should be modified or removed. In its present form, it
+# imposes the arbitrary restriction that no export type can be associated
+# with more than one svcdb. The only place it's used is in edit/part_svc.cgi
+# to generate the list of allowed exports, which can be done more cleanly by
+# export_info anyway.
+
sub exporttype2svcdb {
my $exporttype = $_[0];
foreach my $svcdb ( keys %exports ) {
@@ -473,6 +514,20 @@ sub exporttype2svcdb {
'';
}
+tie my %sysvshell_options, 'Tie::IxHash',
+ 'crypt' => { label=>'Password encryption',
+ type=>'select', options=>[qw(crypt md5)],
+ default=>'crypt',
+ },
+;
+
+tie my %bsdshell_options, 'Tie::IxHash',
+ 'crypt' => { label=>'Password encryption',
+ type=>'select', options=>[qw(crypt md5)],
+ default=>'crypt',
+ },
+;
+
tie my %shellcommands_options, 'Tie::IxHash',
#'machine' => { label=>'Remote machine' },
'user' => { label=>'Remote username', default=>'root' },
@@ -496,7 +551,7 @@ tie my %shellcommands_options, 'Tie::IxHash',
;
tie my %sqlradius_options, 'Tie::IxHash',
- 'datasrc' => { label=>'DBI data source' },
+ 'datasrc' => { label=>'DBI data source ' },
'username' => { label=>'Database username' },
'password' => { label=>'Database password' },
;
@@ -545,6 +600,11 @@ tie my %bind_slave_options, 'Tie::IxHash',
default => '/etc/bind/named.conf' },
;
+tie my %sqlmail_options, 'Tie::IxHash',
+ 'datasrc' => { label=>'DBI data source' },
+ 'username' => { label=>'Database username' },
+ 'password' => { label=>'Database password' },
+;
#export names cannot have dashes...
@@ -553,12 +613,16 @@ tie my %bind_slave_options, 'Tie::IxHash',
'sysvshell' => {
'desc' =>
'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV)',
- 'options' => {},
+ 'options' => \%sysvshell_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'MD5 crypt requires installation of <a href="http://search.cpan.org/search?dist=Crypt-PasswdMD5">Crypt::PasswdMD5</a> from CPAN. Run shell.export, etc.',
},
'bsdshell' => {
'desc' =>
'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
- 'options' => {},
+ 'options' => \%bsdshell_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'MD5 crypt requires installation of <a href="http://search.cpan.org/search?dist=Crypt-PasswdMD5">Crypt::PasswdMD5</a> from CPAN. Run shell.export, etc.',
},
# 'nis' => {
# 'desc' =>
@@ -568,6 +632,7 @@ tie my %bind_slave_options, 'Tie::IxHash',
'textradius' => {
'desc' => 'Batch export of a text /etc/raddb/users file (Livingston, Cistron)',
'options' => {},
+ 'notes' => 'unfinished...',
},
'shellcommands' => {
@@ -581,7 +646,14 @@ tie my %bind_slave_options, 'Tie::IxHash',
'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)',
'options' => \%sqlradius_options,
'nodomain' => 'Y',
- 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for <a href="http://www.freeradius.org/">FreeRADIUS</a> or <a href="http://radius.innercite.com/">ICRADIUS</a>. Use <a href="../docs/man/bin/freeside-sqlradius-reset">freeside-sqlradius-reset</a> to delete and repopulate the tables from the Freeside database.',
+ 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for <a href="http://www.freeradius.org/">FreeRADIUS</a> or <a href="http://radius.innercite.com/">ICRADIUS</a>. Use <a href="../docs/man/bin/freeside-sqlradius-reset">freeside-sqlradius-reset</a> to delete and repopulate the tables from the Freeside database. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.23/DBI.pm">DBI documentation</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">documentation for your DBD</a> for the exact syntax of a DBI data source. If using <a href="http://www.freeradius.org/">FreeRADIUS</a> 0.5 or above, make sure your <b>op</b> fields are set to allow NULL values.',
+ },
+
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested.',
},
'cyrus' => {
@@ -618,13 +690,21 @@ tie my %bind_slave_options, 'Tie::IxHash',
'bind' => {
'desc' =>'Batch export to BIND named',
'options' => \%bind_options,
- 'notes' => 'bind export notes',
+ 'notes' => 'bind export notes File::Rsync dependancy, run bind.export',
},
'bind_slave' => {
'desc' =>'Batch export to slave BIND named',
'options' => \%bind_slave_options,
- 'notes' => 'bind export notes (secondary munge)',
+ 'notes' => 'bind export notes (secondary munge) File::Rsync dependancy, run bind.export',
+ },
+
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and
+ Exim. Others could work but are untested.',
},
@@ -632,7 +712,15 @@ tie my %bind_slave_options, 'Tie::IxHash',
'svc_acct_sm' => {},
- 'svc_forward' => {},
+ 'svc_forward' => {
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and
+ Exim. Others could work but are untested.',
+ },
+ },
'svc_www' => {},