Changeset 2569
- Timestamp:
- 04/27/23 12:01:22 (12 months ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Nethost.pm
r2565 r2569 272 272 label => l('Support'), 273 273 }, 274 radiusParams => { multiple => 1 }, 274 275 vlan => { }, 275 276 } -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Netzone.pm
r2565 r2569 204 204 description => { }, 205 205 hostParams => { multiple => 1 }, 206 radiusParams => { iname => 'hostParams', ro => 1 }, 206 207 vlan => { }, 207 208 } -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm
r2568 r2569 931 931 my $output = ''; 932 932 933 my $zoneVLan = $outzone->get_attributes( 'vlan' );934 935 933 my @net; 936 934 if ($outzone->get_attributes('net')) { … … 1028 1026 } 1029 1027 1030 my @parameters = grep { $_ } $outzone->get_attributes('hostParams'); 1028 my %zRadius = (); 1029 foreach ( $outzone->get_attributes('hostParams') ) { 1030 /^\s*(\S+)(?:\s*(.*))$/; 1031 $zRadius{ $1 } = $2; 1032 } 1033 if ( my $zoneVLan = $outzone->get_attributes( 'vlan' ) ) { 1034 $zRadius{'Tunnel-Type'} ||= '= VLAN'; 1035 $zRadius{'Tunnel-Medium-Type'} ||= '= 6'; 1036 $zRadius{'Tunnel-Private-Group-ID'} ||= "= $zoneVLan"; 1037 } 1038 1031 1039 foreach my $nethost (sort keys %hosts) { 1032 1040 my $obj = $self->_base->get_object('nethost', $nethost); … … 1035 1043 $obj->get_attributes('noDynamic') and next; 1036 1044 1037 my $vlan = $obj->get_attributes( 'vlan' ) || $zoneVLan; 1045 my %hRadius = %zRadius; 1046 foreach ( $obj->get_attributes('radiusParams') ) { 1047 /^\s*(\S+)(?:\s*(.*))$/; 1048 $hRadius{ $1 } = $2; 1049 } 1050 if ( my $vlan = $obj->get_attributes( 'vlan' ) ) { 1051 $hRadius{'Tunnel-Type'} ||= '= VLAN'; 1052 $hRadius{'Tunnel-Medium-Type'} ||= '= 6'; 1053 $hRadius{'Tunnel-Private-Group-ID'} = "= $vlan"; 1054 } 1055 1056 my @parameters = map { "$_ " . $hRadius{ $_ } } grep { $hRadius{ $_ } } keys ( %hRadius ); 1038 1057 1039 1058 $output .= "# Host: $nethost\n"; … … 1046 1065 $fmac =~ s/://g; 1047 1066 $output .= sprintf("%s ClearText-Password := \"%s\"\n", lc($fmac), lc($fmac)); 1048 $output .= join (",\n", map { " $_" } @parameters) . "\n" if(@parameters); 1049 if ( $vlan ) { 1050 $output .= " Tunnel-Type = VLAN\n"; 1051 $output .= " Tunnel-Medium-Type = 6\n"; 1052 $output .= " Tunnel-Private-Group-ID = $vlan\n"; 1053 } 1067 $output .= join (",\n", map { " $_" } @parameters) if( @parameters ); 1068 $output .= "\n"; 1054 1069 } 1055 1070 $output .= "\n";
Note: See TracChangeset
for help on using the changeset viewer.