2 'name' => 'RADIUS Group',
3 'table' => 'radius_group',
6 'groupname' => 'RADIUS Group',
7 'description' => 'Description',
8 'attrnum' => 'Attribute',
9 'priority' => 'Priority',
11 'viewall_dir' => 'browse',
12 'menubar' => \@menubar,
13 'edit_callback' => $edit_callback,
14 'error_callback' => $edit_callback,
16 { 'field' => 'groupname',
19 'colspan' => 6, # just to not interfere with radius_attr columns
21 { 'field' => 'description',
26 { 'field' => 'priority',
29 'colspan' => 6, # just to not interfere with radius_attr columns
33 'type' => 'radius_attr',
34 'o2m_table' => 'radius_attr',
35 'm2_label' => 'Attribute',
36 'm2_error_callback' => $m2_error_callback,
44 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
46 my @menubar = ('View all RADIUS Groups' => $p.'browse/radius_group.html');
48 my $edit_callback = sub {
49 my ($cgi, $object) = @_;
50 if ( $object->groupnum ) {
51 my $link = $p.'misc/delete-radius_group.html?'.$object->groupnum;
52 push @menubar, 'Delete this Group', $link;
56 my $m2_error_callback = sub { # reconstruct the list
57 my ($cgi, $object) = @_;
59 my @fields = qw(attrname attrtype op value);
62 next if !length($cgi->param($k.'_attrname'));
64 'groupnum' => $object->groupnum,
65 'attrnum' => scalar( $cgi->param($k) ),
66 map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields,
68 } grep /^attrnum\d+$/, ($cgi->param);