summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2006-08-06 20:21:32 +0000
committerivan <ivan>2006-08-06 20:21:32 +0000
commit08dc9fe500cf44346e409fb8c75eda541300d64d (patch)
treef767e3eb2924407bbaaef015246ab6b0b9008bbe /httemplate/edit
parentad18fd616d98b80945b455ca170ba02089723873 (diff)
yow. fix up group handling
Diffstat (limited to 'httemplate/edit')
-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 = ();
+ [];
+ }
+ }
+ );
}