X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export.pm;h=d15a8798693f663aeddb1636c779565721864328;hb=2c9b97801b3981efaf6c65118e3cc1a0368e649c;hp=20e3ab474e7176f4861b20c27ac0afb6f6f47cf1;hpb=cf6020a0c273d549d33f3e9999bd8b68d9b6d133;p=freeside.git
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
index 20e3ab474..d15a87986 100644
--- a/FS/FS/part_export.pm
+++ b/FS/FS/part_export.pm
@@ -526,12 +526,12 @@ tie my %shellcommands_options, 'Tie::IxHash',
#'machine' => { label=>'Remote machine' },
'user' => { label=>'Remote username', default=>'root' },
'useradd' => { label=>'Insert command',
- default=>'useradd -d $dir -m -s $shell -u $uid $username; passwd $username'
+ default=>'useradd -d $dir -m -s $shell -u $uid -p $crypt_password $username'
#default=>'cp -pr /etc/skel $dir; chown -R $uid.$gid $dir'
},
'useradd_stdin' => { label=>'Insert command STDIN',
type =>'textarea',
- default=>'$_password\n$_password\n',
+ default=>"",
},
'userdel' => { label=>'Delete command',
default=>'userdel $username',
@@ -542,18 +542,48 @@ tie my %shellcommands_options, 'Tie::IxHash',
default=>'',
},
'usermod' => { label=>'Modify command',
- default=>'usermod -d $new_dir -l $new_username -s $new_shell -u $new_uid $old_username; passwd $new_username',
+ default=>'usermod -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -p $new_crypt_password $old_username',
#default=>'[ -d $old_dir ] && mv $old_dir $new_dir || ( '.
# 'chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; '.
# 'find . -depth -print | cpio -pdm $new_dir; '.
# 'chmod u-t $new_dir; chown -R $uid.$gid $new_dir; '.
# 'rm -rf $old_dir'.
#')'
+ },
'usermod_stdin' => { label=>'Modify command STDIN',
type =>'textarea',
- default=>'$_password\n$_password\n',
+ default=>"",
},
+;
+
+tie my %shellcommands_withdomain_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ #default=>''
+ },
+ 'useradd_stdin' => { label=>'Insert command STDIN',
+ type =>'textarea',
+ #default=>"$_password\n$_password\n",
+ },
+ 'userdel' => { label=>'Delete command',
+ #default=>'',
+ },
+ 'userdel_stdin' => { label=>'Delete command STDIN',
+ type =>'textarea',
+ #default=>'',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'',
},
+ 'usermod_stdin' => { label=>'Modify command STDIN',
+ type =>'textarea',
+ #default=>"$_password\n$_password\n",
+ },
+;
+
+tie my %textradius_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'users' => { label=>'users file location', default=>'/etc/raddb/users' },
;
tie my %sqlradius_options, 'Tie::IxHash',
@@ -618,17 +648,17 @@ tie my %sqlmail_options, 'Tie::IxHash',
'svc_acct' => {
'sysvshell' => {
'desc' =>
- 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV)',
+ 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV).',
'options' => \%sysvshell_options,
'nodomain' => 'Y',
- 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN. Run shell.export, etc.',
+ 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN. Run bin/sysvshell.export to export the files.',
},
'bsdshell' => {
'desc' =>
- 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
+ 'Batch export of /etc/passwd and /etc/master.passwd files (BSD).',
'options' => \%bsdshell_options,
'nodomain' => 'Y',
- 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN. Run shell.export, etc.',
+ 'notes' => 'MD5 crypt requires installation of Crypt::PasswdMD5 from CPAN. Run bin/bsdshell.export to export the files.',
},
# 'nis' => {
# 'desc' =>
@@ -636,30 +666,36 @@ tie my %sqlmail_options, 'Tie::IxHash',
# 'options' => {},
# },
'textradius' => {
- 'desc' => 'Batch export of a text /etc/raddb/users file (Livingston, Cistron)',
- 'options' => {},
- 'notes' => 'unfinished...',
+ 'desc' => 'Real-time export to a text /etc/raddb/users file (Livingston, Cistron)',
+ 'options' => \%textradius_options,
+ 'notes' => 'This will edit a text RADIUS users file in place on a remote server. Requires installation of RADIUS::UserFile from CPAN. If using RADIUS::UserFile 1.01, make sure to apply this patch. Also make sure rsync is installed on the remote machine, and SSH is setup for unattended operation.',
},
'shellcommands' => {
'desc' => 'Real-time export via remote SSH (i.e. useradd, userdel, etc.)',
'options' => \%shellcommands_options,
'nodomain' => 'Y',
- 'notes' => 'shellcommandsnotes... (this one is the nodomain one)',
+ '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: