summaryrefslogtreecommitdiff
path: root/httemplate/edit/svc_acct.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/svc_acct.cgi')
-rwxr-xr-xhttemplate/edit/svc_acct.cgi19
1 files changed, 14 insertions, 5 deletions
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 8d50aeda0..14d6759dc 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -70,11 +70,20 @@ unless ( $svcnum || $cgi->param('error') ) { #adding
$svc_acct->set_default_and_fixed( {
#false laziness w/svc-acct::_fieldhandlers
- 'usergroup' => sub { return $_[0] if ref($_[0]) eq 'ARRAY';
- @groups = split(/\s*,\s*/, shift );
- \@groups;
- },
- } );
+ 'usergroup' => sub {
+ my( $self, $groups ) = @_;
+ if ( ref($groups) eq 'ARRAY' ) {
+ @groups = @$groups;
+ $groups;
+ } elsif ( length($groups) ) {
+ @groups = split(/\s*,\s*/, $groups);
+ [ @groups ];
+ } else {
+ @groups = ();
+ [];
+ }
+ }
+ );
}