2 'name' => 'RADIUS Group',
3 'table' => 'radius_group',
6 'groupname' => 'RADIUS Group',
7 'description' => 'Description',
8 'attrnum' => 'Attribute',
9 'priority' => 'Priority',
10 'speed_down' => 'Download speed',
11 'speed_up' => 'Upload speed',
13 'menubar' => \@menubar,
14 'edit_callback' => $edit_callback,
15 'error_callback' => $edit_callback,
17 { 'field' => 'groupname',
20 'colspan' => 6, # just to not interfere with radius_attr columns
22 { 'field' => 'description',
27 { 'field' => 'priority',
30 'colspan' => 6, # just to not interfere with radius_attr columns
32 { 'field' => 'speed_down',
37 { 'field' => 'speed_up',
44 'type' => 'radius_attr',
45 'o2m_table' => 'radius_attr',
46 'm2_label' => 'Attribute',
47 'm2_error_callback' => $m2_error_callback,
55 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
57 my @menubar = ('View all RADIUS Groups' => $p.'browse/radius_group.html');
59 my $edit_callback = sub {
60 my ($cgi, $object) = @_;
61 if ( $object->groupnum ) {
62 my $link = $p.'misc/delete-radius_group.html?'.$object->groupnum;
63 push @menubar, 'Delete this Group', $link;
67 my $m2_error_callback = sub { # reconstruct the list
68 my ($cgi, $object) = @_;
70 my @fields = qw(attrname attrtype op value);
73 next if !length($cgi->param($k.'_attrname'));
75 'groupnum' => $object->groupnum,
76 'attrnum' => scalar( $cgi->param($k) ),
77 map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields,
79 } grep /^attrnum\d+$/, ($cgi->param);