summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/domain_record.pm4
-rw-r--r--FS/FS/part_export.pm28
-rw-r--r--FS/MANIFEST1
-rwxr-xr-xbin/bind.export7
-rwxr-xr-xbin/bsdshell.export7
-rwxr-xr-xbin/sysvshell.export7
6 files changed, 33 insertions, 21 deletions
diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm
index 37cc6c9e8..4f5368e61 100644
--- a/FS/FS/domain_record.pm
+++ b/FS/FS/domain_record.pm
@@ -261,7 +261,7 @@ sub check {
or return "Illegal data for PTR record: ". $self->recdata;
$self->recdata($1);
} elsif ( $self->rectype eq 'CNAME' ) {
- $self->recdata =~ /^([a-z0-9\.\-]+)$/i
+ $self->recdata =~ /^([a-z0-9\.\-]+|\@)$/i
or return "Illegal data for CNAME record: ". $self->recdata;
$self->recdata($1);
} elsif ( $self->rectype eq '_mstr' ) {
@@ -313,7 +313,7 @@ sub svc_domain {
=head1 VERSION
-$Id: domain_record.pm,v 1.11 2002-06-23 19:16:45 ivan Exp $
+$Id: domain_record.pm,v 1.11.4.1 2003-03-20 03:42:51 ivan Exp $
=head1 BUGS
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
index d493bba01..debc737ec 100644
--- a/FS/FS/part_export.pm
+++ b/FS/FS/part_export.pm
@@ -604,7 +604,7 @@ tie my %shellcommands_withdomain_options, 'Tie::IxHash',
;
tie my %www_shellcommands_options, 'Tie::IxHash',
- 'user' => { lable=>'Remote username', default=>'root' },
+ 'user' => { label=>'Remote username', default=>'root' },
'useradd' => { label=>'Insert command',
default=>'mkdir /var/www/$zone; chown $username /var/www/$zone; ln -s /var/www/$zone $homedir/$zone',
},
@@ -616,6 +616,27 @@ tie my %www_shellcommands_options, 'Tie::IxHash',
},
;
+tie my %apache_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'httpd_conf' => { label=>'httpd.conf snippet location',
+ default=>'/etc/apache/httpd-freeside.conf', },
+ 'template' => {
+ label => 'Template',
+ type => 'textarea',
+ default => <<'END',
+<VirtualHost $domain> #generic
+#<VirtualHost ip.addr> #preferred, http://httpd.apache.org/docs/dns-caveats.html
+DocumentRoot /var/www/$zone
+ServerName $zone
+ServerAlias *.$zone
+#BandWidthModule On
+#LargeFileLimit 4096 12288
+</VirtualHost>
+
+END
+ },
+;
+
tie my %domain_shellcommands_options, 'Tie::IxHash',
'user' => { lable=>'Remote username', default=>'root' },
'useradd' => { label=>'Insert command',
@@ -896,6 +917,11 @@ tie my %ldap_options, 'Tie::IxHash',
'notes' => 'Run remote commands via SSH, for virtual web sites. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.',
},
+ 'apache' => {
+ 'desc' => 'Export an Apache httpd.conf file snippet.',
+ 'options' => \%apache_options,
+ 'notes' => 'Batch export of an httpd.conf snippet from a template. Typically used with something like <code>Include /etc/apache/httpd-freeside.conf</code> in httpd.conf. <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed. Run bin/apache.export to export the files.',
+ },
},
);
diff --git a/FS/MANIFEST b/FS/MANIFEST
index c41f02e12..df0ee0df6 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -62,6 +62,7 @@ FS/part_bill_event.pm
FS/export_svc.pm
FS/part_export.pm
FS/part_export_option.pm
+FS/part_export/apache.pm
FS/part_export/bind.pm
FS/part_export/bind_slave.pm
FS/part_export/bsdshell.pm
diff --git a/bin/bind.export b/bin/bind.export
index 943aefbb0..055782a20 100755
--- a/bin/bind.export
+++ b/bin/bind.export
@@ -46,12 +46,7 @@ foreach my $export ( @exports ) {
my $zonepath = $export->option('zonepath');
$zonepath =~ s/\/$//;
- #false laziness with freeside-sqlradius-reset and shell.export
- my @svc_domain =
- map { qsearchs('svc_domain', { 'svcnum' => $_->svcnum } ) }
- map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- $export->export_svc;
+ my @svc_domain = $export->svc_x;
foreach my $svc_domain ( @svc_domain ) {
my $domain = $svc_domain->domain;
diff --git a/bin/bsdshell.export b/bin/bsdshell.export
index 10c27671e..6e0d1037e 100755
--- a/bin/bsdshell.export
+++ b/bin/bsdshell.export
@@ -43,12 +43,7 @@ foreach my $export ( @bsd_exports ) {
chmod 0644, "$prefix/passwd";
chmod 0600, "$prefix/master.passwd";
- #false laziness with freeside-sqlradius-reset and bind.export
- my @svc_acct =
- map { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) }
- map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- $export->export_svc;
+ my @svc_acct = $export->svc_x;
next unless @svc_acct;
diff --git a/bin/sysvshell.export b/bin/sysvshell.export
index 859766103..c13912c3f 100755
--- a/bin/sysvshell.export
+++ b/bin/sysvshell.export
@@ -43,12 +43,7 @@ foreach my $export ( @sysv_exports ) {
chmod 0644, "$prefix/passwd";
chmod 0600, "$prefix/shadow";
- #false laziness with freeside-sqlradius-reset and bind.export
- my @svc_acct =
- map { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) }
- map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
- $export->export_svc;
+ my @svc_acct = $export->svc_x;
next unless @svc_acct;