preliminary ldap export
[freeside.git] / FS / FS / part_export.pm
index 67b3cad..79fe913 100644 (file)
@@ -274,8 +274,6 @@ sub check {
   ;
   return $error if $error;
 
-  warn $self->machine. "!!!\n";
-
   $self->machine =~ /^([\w\-\.]*)$/
     or return "Illegal machine: ". $self->machine;
   $self->machine($1);
@@ -554,6 +552,18 @@ tie my %shellcommands_options, 'Tie::IxHash',
                        type =>'textarea',
                        default=>'',
                      },
+  'suspend' => { label=>'Suspension command',
+                 default=>'',
+               },
+  'suspend_stdin' => { label=>'Suspension command STDIN',
+                       default=>'',
+                     },
+  'unsuspend' => { label=>'Unsuspension command',
+                   default=>'',
+                 },
+  'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
+                         default=>'',
+                       },
 ;
 
 tie my %shellcommands_withdomain_options, 'Tie::IxHash',
@@ -579,6 +589,18 @@ tie my %shellcommands_withdomain_options, 'Tie::IxHash',
                        type =>'textarea',
                        #default=>"$_password\n$_password\n",
                      },
+  'suspend' => { label=>'Suspension command',
+                 default=>'',
+               },
+  'suspend_stdin' => { label=>'Suspension command STDIN',
+                       default=>'',
+                     },
+  'unsuspend' => { label=>'Unsuspension command',
+                   default=>'',
+                 },
+  'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
+                         default=>'',
+                       },
 ;
 
 tie my %www_shellcommands_options, 'Tie::IxHash',
@@ -641,10 +663,13 @@ tie my %infostreet_options, 'Tie::IxHash',
 ;
 
 tie my %vpopmail_options, 'Tie::IxHash',
-  'machine' => { label=>'vpopmail machine', },
+  #'machine' => { label=>'vpopmail machine', },
   'dir'     => { label=>'directory', }, # ?more info? default?
   'uid'     => { label=>'vpopmail uid' },
   'gid'     => { label=>'vpopmail gid' },
+  'restart' => { label=> 'vpopmail restart command',
+                 default=> 'cd /home/vpopmail/domains; for domain in *; do /home/vpopmail/bin/vmkpasswd $domain; done; /var/qmail/bin/qmail-newu; killall -HUP qmail-send',
+               },
 ;
 
 tie my %bind_options, 'Tie::IxHash',
@@ -699,6 +724,32 @@ tie my %sqlmail_options, 'Tie::IxHash',
   'password' => { label=>'Database password' },
 ;
 
+tie my %ldap_options, 'Tie::IxHash',
+  'dn'         => { label=>'DN' },
+  'password'   => { label=>'Optional DN password' },
+  'attributes' => { label=>'Attributes',
+                    type=>'textarea',
+                    default=>join("\n",
+                      'uid $username',
+                      'mail $username\@$domain',
+                      'uidno $uid',
+                      'gidno $gid',
+                      'cn $first',
+                      'sn $last',
+                      'mailquota $quota',
+                      'vmail',
+                      'location',
+                      'mailtag',
+                      'mailhost',
+                      'mailmessagestore $dir',
+                      'userpassword $crypt_password',
+                      'hint',
+                      'answer $sec_phrase',
+                    ),
+                  },
+  'radius'     => { label=>'Export RADIUS attributes', type=>'checkbox', },
+;
+
 
 #export names cannot have dashes...
 %exports = (
@@ -741,6 +792,12 @@ tie my %sqlmail_options, 'Tie::IxHash',
       'notes' => 'Run remote commands via SSH.  username@domain (rather than just usernames) are considered unique (also see shellcommands).  You probably want this if the commands you are running will accept a domain as a parameter, and will allow the same username with different domains.  You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.',
     },
 
+    'ldap' => {
+      'desc' => 'Real-time export to LDAP',
+      'options' => \%ldap_options,
+      'notes' => 'Real-time export to arbitrary LDAP attributes.  Requires installation of <a href="http://search.cpan.org/search?dist=Net-LDAP">Net::LDAP</a> from CPAN.',
+    },
+
     'sqlradius' => {
       'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)',
       'options' => \%sqlradius_options,
@@ -778,7 +835,7 @@ tie my %sqlmail_options, 'Tie::IxHash',
     'vpopmail' => {
       'desc' => 'Real-time export to vpopmail text files',
       'options' => \%vpopmail_options,
-      'notes' => 'Real time export to <a href="http://inter7.com/vpopmail/">vpopmail</a> text files (...extended description from jeff?...)',
+      'notes' => 'Real time export to <a href="http://inter7.com/vpopmail/">vpopmail</a> text files.  <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed, and you will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a> to <b>vpopmail</b>@<i>export.host</i>.',
     },
 
   },
@@ -819,8 +876,6 @@ tie my %sqlmail_options, 'Tie::IxHash',
 
   },
 
-  'svc_acct_sm' => {},
-
   'svc_forward' => {
     'sqlmail' => {
       'desc' => 'Real-time export to SQL-backed mail server',
@@ -839,6 +894,9 @@ tie my %sqlmail_options, 'Tie::IxHash',
 
   },
 
+  'svc_broadband' => {
+  },
+
 );
 
 =back