diff options
author | ivan <ivan> | 2006-08-06 20:21:32 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-06 20:21:32 +0000 |
commit | 08dc9fe500cf44346e409fb8c75eda541300d64d (patch) | |
tree | f767e3eb2924407bbaaef015246ab6b0b9008bbe /httemplate/edit/svc_acct.cgi | |
parent | ad18fd616d98b80945b455ca170ba02089723873 (diff) |
yow. fix up group handling
Diffstat (limited to 'httemplate/edit/svc_acct.cgi')
-rwxr-xr-x | httemplate/edit/svc_acct.cgi | 19 |
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 = (); + []; + } + } + ); } |