summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/domain_sql.pm
blob: ff0d949f18d33bab669ab2d66ccb0451e48575f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package FS::part_export::domain_sql;
use base qw( FS::part_export::sql_Common );

use strict;
use vars qw(%info);
use Tie::IxHash;
use FS::part_export;

tie my %options, 'Tie::IxHash', %{__PACKAGE__->sql_options};

tie my %postfix_transport_map, 'Tie::IxHash', 
  'domain' => 'domain'
;
my $postfix_transport_map = 
  join('\n', map "$_ $postfix_transport_map{$_}",
                 keys %postfix_transport_map      );
tie my %postfix_transport_static, 'Tie::IxHash',
  'transport' => 'virtual:',
;
my $postfix_transport_static = 
  join('\n', map "$_ $postfix_transport_static{$_}",
                 keys %postfix_transport_static      );

%info  = (
  'svc'     => 'svc_domain',
  'desc'    => 'Real time export of domains to SQL databases '.
               '(postfix, others?)',
  'options' => \%options,
  'no_machine' => 1,
  'notes'   => <<END
Export domains (svc_domain records) to SQL databases.  Currently this is a
simple export with a default for Postfix, but it can be extended for other
uses.

<BR><BR>Use these buttons for useful presets:
<UL>
  <LI><INPUT TYPE="button" VALUE="postfix_transport" onClick='
    this.form.table.value = "transport";
    this.form.schema.value = "$postfix_transport_map";
    this.form.static.value = "$postfix_transport_static";
    this.form.primary_key.value = "domain";
  '>
</UL>
END
);

# inherit everything else from sql_Common

1;