files_index.cgi

来自「Unix下基于Web的管理工具」· CGI 代码 · 共 48 行

CGI
48
字号
#!/usr/local/bin/perl# files_index.cgi# Display a menu of icons for per-files optionsrequire './apache-lib.pl';&ReadParse();$access{'global'} || &error($text{'htaccess_ecannot'});&allowed_auth_file($in{'file'}) ||	&error($text{'htindex_ecannot'});$conf = &get_htaccess_config($in{'file'});$d = $conf->[$in{'idx'}];&header($text{'htfile_title'}, "");print "<center><font size=+2>",&text('htfile_header', &dir_name($d),	"<tt>$in{'file'}</tt>"),"</font></center><br>\n";print "<hr>\n";print "<h3>$text{'htfile_title'}</h3>\n";$sw_icon = { "icon" => "images/show.gif",	     "name" => $text{'htfile_show'},	     "link" => "show_files.cgi?file=$in{'file'}&idx=$in{'idx'}" };&config_icons("directory", "edit_files.cgi?file=$in{'file'}&idx=$in{'idx'}&",	      $sw_icon);print "<hr>\n";print "<form action=change_files.cgi>\n";print "<input type=hidden name=file value=$in{'file'}>\n";print "<input type=hidden name=idx value=$in{'idx'}>\n";print "<table border>\n";print "<tr $tb> <td><b>$text{'htfile_apply'}</b></td> </tr>\n";print "<tr $cb> <td><table>\n";print "<tr> <td><b>$text{'htindex_regexp'}</b></td>\n";$regex = $d->{'words'}->[0] eq "~" || $d->{'name'} =~ /Match/i;printf "<td colspan=3><input type=radio name=regexp value=0 %s> %s\n",	$regex ? "" : "checked", $text{'htindex_exact'};printf "<input type=radio name=regexp value=1 %s> %s</td> </tr>\n",	$regex ? "checked" : "", $text{'htindex_re'};print "<tr> <td><b>$text{'htindex_path'}</b></td>\n";printf "<td><input name=path size=40 value=\"%s\"></td>\n",	$d->{'words'}->[0] eq "~" ? $d->{'words'}->[1] : $d->{'words'}->[0];print "<td colspan=2 align=right>",      "<input type=submit value='$text{'save'}'>&nbsp;",      "<input type=submit value='$text{'delete'}' name=delete></td> </tr>\n";print "</table></td></tr></table></form>\n";print "<hr>\n";&footer("htaccess_index.cgi?file=$in{'file'}", $text{'htindex_return'});

⌨️ 快捷键说明

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