3 # Create, update or delete an alias
5 require './nis-lib.pl';
8 ($t, $lnums, $alias) = &table_edit_setup($in{'table'}, $in{'line'}, '[\s:]+');
10 # Just delete the alias
11 &table_delete($t, $lnums);
14 # Validate inputs and save the alias
15 &error_setup($text{'aliases_err'});
16 $in{'from'} =~ /^[^:@ ]+$/ || &error($text{'aliases_efrom'});
17 @to = split(/\s+/, $in{'to'});
18 @to || &error($text{'aliases_eto'});
19 @alias = ( $in{'from'}, join(",", @to) );
20 if ($in{'line'} eq '') {
21 &table_add($t, ":", \@alias);
24 &table_update($t, $lnums, ":", \@alias);
27 &apply_table_changes() if (!$config{'manual_build'});
28 &redirect("edit_tables.cgi?table=$in{'table'}");