X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export.pm;h=c9ae41fc1db067003d8090f57bd3e01ed3779681;hp=15b207e03b1fb06c71304786b4c2ff5d9a45f84e;hb=e6f6f496883b8e8be42f4d92f01b61dbc2c590be;hpb=8bc1ee56aea60731d98efd0e2399b202e9969187 diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 15b207e03..c9ae41fc1 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -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); @@ -531,10 +529,10 @@ tie my %shellcommands_options, 'Tie::IxHash', }, 'useradd_stdin' => { label=>'Insert command STDIN', type =>'textarea', - default=>"", + default=>'', }, 'userdel' => { label=>'Delete command', - default=>'userdel $username', + default=>'userdel -r $username', #default=>'rm -rf $dir', }, 'userdel_stdin' => { label=>'Delete command STDIN', @@ -552,7 +550,7 @@ tie my %shellcommands_options, 'Tie::IxHash', }, 'usermod_stdin' => { label=>'Modify command STDIN', type =>'textarea', - default=>"", + default=>'', }, ; @@ -581,6 +579,32 @@ tie my %shellcommands_withdomain_options, 'Tie::IxHash', }, ; +tie my %www_shellcommands_options, 'Tie::IxHash', + 'user' => { lable=>'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', + }, + 'userdel' => { label=>'Delete command', + default=>'[ -n "$zone" ] && rm -rf /var/www/$zone; rm $homedir/$zone', + }, + 'usermod' => { label=>'Modify command', + default=>'[ -n "$old_zone" ] && rm $old_homedir/$old_zone; [ "$old_zone" != "$new_zone" -a -n "$new_zone" ] && mv /var/www/$old_zone /var/www/$new_zone; [ "$old_username" != "$new_username" ] && chown -R $new_username /var/www/$new_zone; ln -s /var/www/$new_zone $new_homedir/$new_zone', + }, +; + +tie my %domain_shellcommands_options, 'Tie::IxHash', + 'user' => { lable=>'Remote username', default=>'root' }, + 'useradd' => { label=>'Insert command', + default=>'', + }, + 'userdel' => { label=>'Delete command', + default=>'', + }, + 'usermod' => { label=>'Modify command', + default=>'', + }, +; + tie my %textradius_options, 'Tie::IxHash', 'user' => { label=>'Remote username', default=>'root' }, 'users' => { label=>'users file location', default=>'/etc/raddb/users' }, @@ -615,10 +639,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', @@ -706,7 +733,7 @@ tie my %sqlmail_options, 'Tie::IxHash', 'desc' => 'Real-time export via remote SSH (i.e. useradd, userdel, etc.)', 'options' => \%shellcommands_options, 'nodomain' => 'Y', - 'notes' => 'Run remote commands via SSH. Usernames are considered unique (also see shellcommands_withdomain). You probably want this if the commands you are running will not accept a domain as a parameter. You will need to setup SSH for unattended operation.

Use these buttons for some useful presets:', + 'notes' => 'Run remote commands via SSH. Usernames are considered unique (also see shellcommands_withdomain). You probably want this if the commands you are running will not accept a domain as a parameter. You will need to setup SSH for unattended operation.

Use these buttons for some useful presets:', }, 'shellcommands_withdomain' => { @@ -752,7 +779,7 @@ tie my %sqlmail_options, 'Tie::IxHash', 'vpopmail' => { 'desc' => 'Real-time export to vpopmail text files', 'options' => \%vpopmail_options, - 'notes' => 'Real time export to vpopmail text files (...extended description from jeff?...)', + 'notes' => 'Real time export to vpopmail text files. File::Rsync must be installed, and you will need to setup SSH for unattended operation to vpopmail@export.host.', }, }, @@ -784,10 +811,14 @@ tie my %sqlmail_options, 'Tie::IxHash', 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested. (...extended description from pc-intouch?...)', }, + 'domain_shellcommands' => { + 'desc' => 'Run remote commands via SSH, for domains.', + 'options' => \%domain_shellcommands_options, + 'notes' => 'Run remote commands via SSH, for domains. You will need to setup SSH for unattended operation.', + }, - }, - 'svc_acct_sm' => {}, + }, 'svc_forward' => { 'sqlmail' => { @@ -800,13 +831,16 @@ tie my %sqlmail_options, 'Tie::IxHash', 'svc_www' => { 'www_shellcommands' => { - 'desc' => 'www_shellcommands', - 'options' => {}, # \%www_shellcommands_options, - 'notes' => 'unfinished...', + 'desc' => 'Run remote commands via SSH, for virtual web sites.', + 'options' => \%www_shellcommands_options, + 'notes' => 'Run remote commands via SSH, for virtual web sites. You will need to setup SSH for unattended operation.', }, }, + 'svc_broadband' => { + }, + ); =back