This commit was generated by cvs2svn to compensate for changes in r4888,
[freeside.git] / FS / FS / part_export / shellcommands.pm
index 73f6ede..e488a52 100644 (file)
@@ -38,9 +38,12 @@ tie my %options, 'Tie::IxHash',
                        type =>'textarea',
                        default=>'',
                      },
-  'usermod_pwonly' => { label=>'Disallow username, domain, uid, gid, dir and RADIUS group changes',
+  'usermod_pwonly' => { label=>'Disallow username, domain, uid, gid, and dir changes', #and RADIUS group changes',
                         type =>'checkbox',
                       },
+  'usermod_nousername' => { label=>'Disallow just username changes',
+                            type =>'checkbox',
+                          },
   'suspend' => { label=>'Suspension command',
                  default=>'usermod -L $username',
                },
@@ -254,7 +257,7 @@ sub _export_replace {
     ${"old_$_"} = $old->getfield($_) foreach $old->fields;
     ${"new_$_"} = $new->getfield($_) foreach $new->fields;
   }
-  $new_finger =~ /^(.*)\s+(\S+)$/ or $finger =~ /^((.*))$/;
+  $new_finger =~ /^(.*)\s+(\S+)$/ or $new_finger =~ /^((.*))$/;
   ($new_first, $new_last ) = ( $1, $2 );
   $new_first = shell_quote $new_first;
   $new_last = shell_quote $new_last;
@@ -270,11 +273,13 @@ sub _export_replace {
   @old_radius_groups = $old->radius_groups;
   @new_radius_groups = $new->radius_groups;
 
-  if ( $self->option('usermod_pwonly') ) {
-    my $error = '';
+  my $error = '';
+  if ( $self->option('usermod_pwonly') || $self->option('usermod_nousername') ){
     if ( $old_username ne $new_username ) {
       $error ||= "can't change username";
     }
+  }
+  if ( $self->option('usermod_pwonly') ) {
     if ( $old_domain ne $new_domain ) {
       $error ||= "can't change domain";
     }
@@ -287,13 +292,14 @@ sub _export_replace {
     if ( $old_dir ne $new_dir ) {
       $error ||= "can't change dir";
     }
-    if ( join("\n", sort @old_radius_groups) ne
-         join("\n", sort @new_radius_groups)    ) {
-      $error ||= "can't change RADIUS groups";
-    }
-    return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
-      if $error;
+    #if ( join("\n", sort @old_radius_groups) ne
+    #     join("\n", sort @new_radius_groups)    ) {
+    #  $error ||= "can't change RADIUS groups";
+    #}
   }
+  return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
+    if $error;
+
   $self->shellcommands_queue( $new->svcnum,
     user         => $self->option('user')||'root',
     host         => $self->machine,