summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-11-21 14:26:01 +0000
committerivan <ivan>2005-11-21 14:26:01 +0000
commit30ceabb9d40844452fae8e7c5535fd6a6738b0cd (patch)
tree9fd70b9232a74dc38a82b515628085b8a1286053 /FS
parentbbf01f2a628d15c0ca557cf68235f25d6d233ee7 (diff)
add usermod_nousername flag to just prohibit username changes
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_export/shellcommands.pm14
-rw-r--r--FS/FS/part_export/shellcommands_withdomain.pm3
2 files changed, 13 insertions, 4 deletions
diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm
index 73f6ede6e..ca04e3869 100644
--- a/FS/FS/part_export/shellcommands.pm
+++ b/FS/FS/part_export/shellcommands.pm
@@ -41,6 +41,9 @@ tie my %options, 'Tie::IxHash',
'usermod_pwonly' => { label=>'Disallow username, domain, uid, gid, dir and RADIUS group changes',
type =>'checkbox',
},
+ 'usermod_nousername' => { label=>'Disallow just username changes',
+ type =>'checkbox',
+ },
'suspend' => { label=>'Suspension command',
default=>'usermod -L $username',
},
@@ -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";
}
@@ -291,9 +296,10 @@ sub _export_replace {
join("\n", sort @new_radius_groups) ) {
$error ||= "can't change RADIUS groups";
}
- return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
- if $error;
}
+ return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
+ if $error;
+
$self->shellcommands_queue( $new->svcnum,
user => $self->option('user')||'root',
host => $self->machine,
diff --git a/FS/FS/part_export/shellcommands_withdomain.pm b/FS/FS/part_export/shellcommands_withdomain.pm
index 9bee75f65..7c5d9045f 100644
--- a/FS/FS/part_export/shellcommands_withdomain.pm
+++ b/FS/FS/part_export/shellcommands_withdomain.pm
@@ -32,6 +32,9 @@ tie my %options, 'Tie::IxHash',
'usermod_pwonly' => { label=>'Disallow username, domain, uid, dir and RADIUS group changes',
type =>'checkbox',
},
+ 'usermod_nousername' => { label=>'Disallow just username changes',
+ type =>'checkbox',
+ },
'suspend' => { label=>'Suspension command',
default=>'',
},