File: edit_protocols.cgi

package info (click to toggle)
webmin-extra 1.180-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 12,324 kB
  • ctags: 1,200
  • sloc: perl: 39,117; makefile: 125
file content (39 lines) | stat: -rwxr-xr-x 1,386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/perl
# edit_protocols.cgi
# Edit a NIS protocols table entry

require './nis-lib.pl';
&ReadParse();
&ui_print_header(undef, $text{'protocols_title'}, "");

($t, $lnums, $protocol) = &table_edit_setup($in{'table'}, $in{'line'}, '\s+');
print "<form action=save_protocols.cgi method=post>\n";
print "<input type=hidden name=table value='$in{'table'}'>\n";
print "<input type=hidden name=line value='$in{'line'}'>\n";

print "<table border>\n";
print "<tr $tb> <td><b>$text{'protocols_header'}</b></td> </tr>\n";
print "<tr $cb> <td><table>\n";

print "<tr> <td><b>$text{'protocols_name'}</b></td>\n";
print "<td><input name=name size=15 value='$protocol->[0]'></td>\n";

print "<td><b>$text{'protocols_number'}</b></td>\n";
print "<td><input name=number size=6 value='$protocol->[1]'></td> </tr>\n";

$al = join(" ", @$protocol[2 .. @$protocol-1]);
print "<tr> <td><b>$text{'protocols_aliases'}</b></td>\n";
print "<td colspan=3><input name=aliases size=30 value='$al'></td> </tr>\n";

print "</table></td></tr></table>\n";
if (defined($in{'line'})) {
	print "<input type=submit value='$text{'save'}'>\n";
	print "<input type=submit name=delete value='$text{'delete'}'>\n";
	}
else {
	print "<input type=submit value='$text{'create'}'>\n";
	}
print "</form>\n";
&ui_print_footer("edit_tables.cgi?table=$in{'table'}", $text{'tables_return'},
	"", $text{'index_return'});