3 # Create, update or delete a network
5 require './nis-lib.pl';
8 ($t, $lnums, $network) = &table_edit_setup($in{'table'}, $in{'line'}, '\s+');
10 # Just delete the network
11 &table_delete($t, $lnums);
14 # Validate inputs and save the network
15 &error_setup($text{'networks_err'});
16 &check_ipaddress($in{'ip'}) || &error($text{'networks_eip'});
17 $in{'name'} =~ /^[A-Za-z0-9\.\-]+$/ || &error($text{'networks_ename'});
18 @network = ( $in{'name'}, $in{'ip'}, split(/\s+/, $in{'aliases'}) );
19 if ($in{'line'} eq '') {
20 &table_add($t, "\t", \@network);
23 &table_update($t, $lnums, "\t", \@network);
26 &apply_table_changes() if (!$config{'manual_build'});
27 &redirect("edit_tables.cgi?table=$in{'table'}");