X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fshellcommands.pm;h=2d5356f262760b3012d4a922ca7b409a8a4a83c3;hb=673b9a458d9138523026963df6fa3b4683e09bae;hp=4f201cf9ceae68c8ecbec1e266f1acae8c9a101d;hpb=07242e191cb2ad247fed8dacd392ef8bf47b5392;p=freeside.git diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index 4f201cf9c..2d5356f26 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -1,6 +1,6 @@ package FS::part_export::shellcommands; -use vars qw(@ISA %info @saltset); +use vars qw(@ISA %info); use Tie::IxHash; use String::ShellQuote; use FS::part_export; @@ -26,7 +26,7 @@ tie my %options, 'Tie::IxHash', default=>'', }, 'usermod' => { label=>'Modify command', - default=>'usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -p $new_crypt_password $old_username', + default=>'usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -g $new_gid -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; '. @@ -53,6 +53,10 @@ tie my %options, 'Tie::IxHash', 'unsuspend_stdin' => { label=>'Unsuspension command STDIN', default=>'', }, + 'crypt' => { label => 'Default password encryption', + type=>'select', options=>[qw(crypt md5)], + default => 'crypt', + }, ; %info = ( @@ -75,7 +79,7 @@ running will not accept a domain as a parameter. You will need to this.form.useradd_stdin.value = ""; this.form.userdel.value = "userdel -r $username"; this.form.userdel_stdin.value=""; - this.form.usermod.value = "usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -p $new_crypt_password $old_username"; + this.form.usermod.value = "usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -g $new_gid -p $new_crypt_password $old_username"; this.form.usermod_stdin.value = ""; this.form.suspend.value = "usermod -L $username"; this.form.suspend_stdin.value=""; @@ -84,10 +88,10 @@ running will not accept a domain as a parameter. You will need to '>
  • cust_svc->cust_pkg; if ( $cust_pkg ) { - $email = ( grep { $_ ne 'POST' } $cust_pkg->cust_main->invoicing_list )[0]; + $email = ( grep { $_ !~ /^(POST|FAX)$/ } $cust_pkg->cust_main->invoicing_list )[0]; } else { $email = ''; } @@ -229,16 +231,8 @@ sub _export_command { $quoted_password = shell_quote $_password; $domain = $svc_acct->domain; - #eventually should check a "password-encoding" field - if ( length($svc_acct->_password) == 13 - || $svc_acct->_password =~ /^\$(1|2a?)\$/ ) { - $crypt_password = shell_quote $svc_acct->_password; - } else { - $crypt_password = crypt( - $svc_acct->_password, - $saltset[int(rand(64))].$saltset[int(rand(64))] - ); - } + $crypt_password = + shell_quote( $svc_acct->crypt_password( $self->option('crypt') ) ); @radius_groups = $svc_acct->radius_groups; @@ -270,15 +264,8 @@ sub _export_replace { $old_domain = $old->domain; $new_domain = $new->domain; - #eventuall should check a "password-encoding" field - if ( length($new->_password) == 13 - || $new->_password =~ /^\$(1|2a?)\$/ ) { - $new_crypt_password = shell_quote $new->_password; - } else { - $new_crypt_password = - crypt( $new->_password, $saltset[int(rand(64))].$saltset[int(rand(64))] - ); - } + $new_crypt_password = + shell_quote( $new->crypt_password( $self->option('crypt') ) ); @old_radius_groups = $old->radius_groups; @new_radius_groups = $new->radius_groups;