⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.cgi

📁 Unix下基于Web的管理工具
💻 CGI
字号:
#!/usr/local/bin/perl# index.cgi# Display commands available for executionrequire './custom-lib.pl';&header($text{'index_title'}, "", undef, 0, 1);print "<hr>\n";@cust = grep { &can_run_command($_) } &list_commands();@cust = sort { $a->{'id'} <=> $b->{'id'} } @cust;print "<table width=100%><tr><td valign=top>\n";$form = 0;for($i=0; $i<@cust; $i++) {	$c = $cust[$i];	@a = @{$c->{'args'}};	print "<form action=run.cgi>\n";	print "<input type=hidden name=idx value='$c->{'index'}'>\n";	print "<table border cellpadding=3><tr $cb><td>\n";	print "<input type=submit value='$c->{'desc'}'><br>\n";	print "<table>\n";	foreach $a (@a) {		print "<tr> <td><b>",$a->{'desc'},"</b></td> <td>\n";		$n = $a->{'name'};		if ($a->{'type'} == 0) {			print "<input name=$n size=30>\n";			}		elsif ($a->{'type'} == 1 || $a->{'type'} == 2) {			print "<input name=$n size=8> ",				&user_chooser_button($n, 0, $form);			}		elsif ($a->{'type'} == 3 || $a->{'type'} == 4) {			print "<input name=$n size=8> ",				&group_chooser_button($n, 0, $form);			}		elsif ($a->{'type'} == 5 || $a->{'type'} == 6) {			print "<input name=$n size=30> ",				&file_chooser_button($n, $a->{'type'}-5, $form);			}		elsif ($a->{'type'} == 7) {			print "<input type=radio name=$n value=1> Yes\n";			print "<input type=radio name=$n value=0 checked> No\n";			}		elsif ($a->{'type'} == 8) {			print "<input name=$n type=password size=30>\n";			}		print "</td> </tr>\n";		}	if ($access{'edit'}) {		print "<tr> <td colspan=2 align=right>",		      "<a href='edit_cmd.cgi?idx=$c->{'index'}'>",		      "$text{'index_edit'}</a></td> </tr>\n";		}	print "</table></td></tr></table></form>\n";	$form++;	if ($i == int((@cust-1)/2)) { print "</td><td valign=top>\n"; }	}print "</td></tr></table>\n";if (!@cust) {	print "<b>$text{'index_none'}</b> <p>\n";	}if ($access{'edit'}) {	print "<a href='edit_cmd.cgi?new=1'>$text{'index_create'}</a> <p>\n";	}print "<hr>\n";&footer("/", $text{'index'});

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -