2 'name' => 'RADIUS Group',
3 'table' => 'radius_group',
6 'groupname' => 'RADIUS Group',
7 'description' => 'Description',
8 'attrnum' => 'Attribute',
9 'priority' => 'Priority',
11 'menubar' => \@menubar,
12 'edit_callback' => $edit_callback,
13 'error_callback' => $edit_callback,
15 { 'field' => 'groupname',
18 'colspan' => 6, # just to not interfere with radius_attr columns
20 { 'field' => 'description',
25 { 'field' => 'priority',
28 'colspan' => 6, # just to not interfere with radius_attr columns
32 'type' => 'radius_attr',
33 'o2m_table' => 'radius_attr',
34 'm2_label' => 'Attribute',
35 'm2_error_callback' => $m2_error_callback,
43 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
45 my @menubar = ('View all RADIUS Groups' => $p.'browse/radius_group.html');
47 my $edit_callback = sub {
48 my ($cgi, $object) = @_;
49 if ( $object->groupnum ) {
50 my $link = $p.'misc/delete-radius_group.html?'.$object->groupnum;
51 push @menubar, 'Delete this Group', $link;
55 my $m2_error_callback = sub { # reconstruct the list
56 my ($cgi, $object) = @_;
58 my @fields = qw(attrname attrtype op value);
61 next if !length($cgi->param($k.'_attrname'));
63 'groupnum' => $object->groupnum,
64 'attrnum' => scalar( $cgi->param($k) ),
65 map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields,
67 } grep /^attrnum\d+$/, ($cgi->param);