From: mark Date: Mon, 17 Aug 2009 23:08:47 +0000 (+0000) Subject: Add more fine-grained queue options X-Git-Tag: root_of_svc_elec_features~913 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=46c05dd754895d3d9511763998f9ef505c8d2bd7 Add more fine-grained queue options --- diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index cec9619aa..7baf2dabe 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -14,6 +14,9 @@ tie my %options, 'Tie::IxHash', default=>'useradd -c $finger -d $dir -m -s $shell -u $uid -p $crypt_password $username' #default=>'cp -pr /etc/skel $dir; chown -R $uid.$gid $dir' }, + 'useradd_no_queue' => { label=>'Run immediately', + type => 'checkbox', + }, 'useradd_stdin' => { label=>'Insert command STDIN', type =>'textarea', default=>'', @@ -22,6 +25,9 @@ tie my %options, 'Tie::IxHash', default=>'userdel -r $username', #default=>'rm -rf $dir', }, + 'userdel_no_queue' => { label=>'Run immediately', + type =>'checkbox', + }, 'userdel_stdin' => { label=>'Delete command STDIN', type =>'textarea', default=>'', @@ -35,6 +41,9 @@ tie my %options, 'Tie::IxHash', # 'rm -rf $old_dir'. #')' }, + 'usermod_no_queue' => { label=>'Run immediately', + type =>'checkbox', + }, 'usermod_stdin' => { label=>'Modify command STDIN', type =>'textarea', default=>'', @@ -48,12 +57,18 @@ tie my %options, 'Tie::IxHash', 'suspend' => { label=>'Suspension command', default=>'usermod -L $username', }, + 'suspend_no_queue' => { label=>'Run immediately', + type =>'checkbox', + }, 'suspend_stdin' => { label=>'Suspension command STDIN', default=>'', }, 'unsuspend' => { label=>'Unsuspension command', default=>'usermod -U $username', }, + 'unsuspend_no_queue' => { label=>'Run immediately', + type =>'checkbox', + }, 'unsuspend_stdin' => { label=>'Unsuspension command STDIN', default=>'', }, @@ -65,9 +80,9 @@ tie my %options, 'Tie::IxHash', 'Radius group mapping to reason (via template user)', type => 'textarea', }, - 'no_queue' => { label => 'Run command immediately', - type => 'checkbox', - }, +# 'no_queue' => { label => 'Run command immediately', +# type => 'checkbox', +# }, ; %info = ( @@ -312,7 +327,7 @@ sub _export_command { stdin_string => $stdin_string, ); - if($self->option('no_queue')) { + if($self->option($action . '_no_queue')) { # discard return value just like freeside-queued. eval { ssh_cmd(@ssh_cmd_args) }; $error = $@; @@ -397,7 +412,7 @@ sub _export_replace { stdin_string => $stdin_string, ); - if($self->option('no_queue')) { + if($self->option('usermod_no_queue')) { # discard return value just like freeside-queued. eval { ssh_cmd(@ssh_cmd_args) }; $error = $@; diff --git a/FS/FS/part_export/shellcommands_withdomain.pm b/FS/FS/part_export/shellcommands_withdomain.pm index 448f0b77b..916d328c2 100644 --- a/FS/FS/part_export/shellcommands_withdomain.pm +++ b/FS/FS/part_export/shellcommands_withdomain.pm @@ -15,6 +15,9 @@ tie my %options, 'Tie::IxHash', type =>'textarea', #default=>"$_password\n$_password\n", }, + 'useradd_no_queue' => { label => 'Run immediately', + type => 'checkbox', + }, 'userdel' => { label=>'Delete command', #default=>'', }, @@ -22,6 +25,9 @@ tie my %options, 'Tie::IxHash', type =>'textarea', #default=>'', }, + 'userdel_no_queue' => { label => 'Run immediately', + type => 'checkbox', + }, 'usermod' => { label=>'Modify command', default=>'', }, @@ -29,6 +35,9 @@ tie my %options, 'Tie::IxHash', type =>'textarea', #default=>"$_password\n$_password\n", }, + 'usermod_no_queue' => { label => 'Run immediately', + type => 'checkbox', + }, 'usermod_pwonly' => { label=>'Disallow username, domain, uid, dir and RADIUS group changes', type =>'checkbox', }, @@ -41,19 +50,22 @@ tie my %options, 'Tie::IxHash', 'suspend_stdin' => { label=>'Suspension command STDIN', default=>'', }, + 'suspend_no_queue' => { label => 'Run immediately', + type => 'checkbox', + }, 'unsuspend' => { label=>'Unsuspension command', default=>'', }, 'unsuspend_stdin' => { label=>'Unsuspension command STDIN', default=>'', }, + 'unsuspend_no_queue' => { label => 'Run immediately', + type => 'checkbox', + }, 'crypt' => { label => 'Default password encryption', type=>'select', options=>[qw(crypt md5)], default => 'crypt', }, - 'no_queue' => { label => 'Run command immediately', - type => 'checkbox', - }, ; %info = ( @@ -90,13 +102,14 @@ the same username with different domains. You will need to