📄 install.cgi
字号:
<font face="宋体" color="#0000FF">
<b>以管理员身份注册您自己</b></font>
<br><br>
<font face="宋体" color="#000000">
您将以管理员身份注册自己,这样就可以正确访问管理中心界面</font>
<br><br>
<form action="$thisprog" method="post">
<input type="hidden" name="action" value="final_step">
<font face="宋体" color="#000000">
输入您的管理员名称:<br>
<input type="text" name="membername">
<br><br>
请输入管理员密码:<br>
<input type="password" name="password_one">
<br><br>
请重输管理员密码:<br>
<input type="password" name="password_two">
<br><br>
<input type="submit" value="提 交 这 个 信 息">
</form>
<hr noshade color="#000000">
<br>
<b>请仔细检查所有信息,并请紧记您的名称、密码。</b>
<br><br>);
} # end step 3
elsif ($action eq "final_step") {
$namecookie = cookie(-name => "adminname",
-value => "$membername");
$passcookie = cookie(-name => "adminpass",
-value => "$password_one");
print header(-cookie=>[$namecookie, $passcookie],-charset=>"gb2312"); print start_html(-title=>"ib2000 安装向导 -- CGI 编程者之家", -bgcolor=>"#EEEEEE", -style=>{-code=>$stylesheet});
print qq(
<font size="5" face="宋体" color="#000000">
<h1>ib2000 安装向导</b></font></h1><font face="宋体" color="#000000">
汉化改进:<a href="mailto:webmaster\@cgier.com">山鹰糊</a><BR>
汉化版权:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
<hr noshade color="#000000">
<br>
<font face="宋体" color="#000000">
<b>欢迎使用 ib2000 安装向导!</b>
<br><br>
<b>最后一步:</b><br>
ib2000 安装向导现在建立您的管理员账号。
<br>
<hr noshade color="#000000">
<br>
);
eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1");
require "data/boardinfo.cgi";
};
if ($@) {
print header(-charset=>"gb2312"); print start_html(-title=>"ib2000 Error!");
print "不能够找到文件:$@\n如果您使用的是 Windows 类操作系统,请在每一个程序中更改 require 的设置,填入绝对路径!";
print end_html; exit;
}
$currenttime = time;
$blanks = "yes" if (!$membername);
$blanks = "yes" if (!$password_one);
$blanks = "yes" if (!$password_two);
if ($blanks) { print qq(<br><br><font color="#FF0000">请填写完所有选项,使用后退返回上一步。); print end_html; exit; }
if ($password_one ne $password_two) { print qq(<br><br><font color="#FF0000">输入的两次密码不同,请返回上一步重新输入。); print end_html; exit; }
$memberfilename = $membername;
$memberfilename =~ y/ /_/;
$membersdir = "$ikondir" . "members";
$filetomake = "$ikondir" . "members/$memberfilename.cgi";
open (ADMIN, ">$filetomake") or die "不能够打开文件 $filetomake,请检查路径!";
print ADMIN "$membername|$password_one|坛主|ad|0|$adminemail_in|no|保密||||||$currenttime||";
close (ADMIN);
if (-e $filetomake) {
print qq(
<font face="宋体" color="#000000">
<b>恭喜,您的 ib2000 已经成功安装好了!</b>
<br><br>
现在,您可以<a href="admincenter.cgi?action=remove">进入管理中心</a>设置您的论坛。<br>从安全角度考虑,本自动安装程序将会被自动删除,以免您的论坛受到不安全的威胁!<br>);
}
else {
print qq(
<font face="宋体" color="#FF0000">
<b>错误!不能够建立 admin 文件!</b>
<br><br>
请检查 members 目录是否正确: $membersdir );
}
$filetomake = "$ikondir" . "data/boardstats.cgi";
open(FILE, ">$filetomake");
# flock(FILE, 2);
print FILE "\$lastregisteredmember = \"$membername\"\;\n";
print FILE "\$totalmembers = \"1\"\;\n";
print FILE "\$totalthreads = \"0\"\;\n";
print FILE "\$totalposts = \"0\"\;\n";
print FILE "\n1\;";
close (FILE);
print qq(
<br><br>
<hr noshade color="#000000">
<font face="宋体" color="#0000FF">
感谢你使用 ib2000!</font>
<br><br>
<font face="宋体" color="#000000">
我们希望安装向导对您安装本论坛是有帮助的。<br>
如果您还有其他问题,请参观 <a href="http://www.cgier.com/"><b>CGI 编程者之家</b></a> 的论坛,本站提供 ib2000 的完全技术支持!
<br><br>
);
} # end final step
else {
eval '$home = (getpwuid($<))[7];';
if (!-e "C:/") { $pwd = `pwd`; chop $pwd; }
if (!eval 'use Cwd;') { eval '$cwd = cwd();'; } else { $cwd = ""; }
$prog = $0;
if ($prog =~ m|install\.(\w+)|) { $prog = "install.$1"; $cgi_extension = $1; }
$b4 = $`;
$b4 =~ s/\/$//;
$b4 =~ s/\\$//;
$document_root = $ENV{'DOCUMENT_ROOT'};
$document_root =~ s/\/$//;
$document_root =~ s/\\$//;
$filename = $ENV{'SCRIPT_FILENAME'};
$filename =~ s/\/$prog//;
$filename =~ s/\\$prog//;
$path = $ENV{'PATH_TRANSLATED'};
$path =~ s/\/$//;
$path =~ s/\\$//;
&check($pwd); &check($b4); &check($home); &check($document_root); &check($filename); &check($path); &check($cwd);
opendir(CURDIR, "..");
while ($q = readdir(CURDIR)) { push (@founddir, $q); }
closedir(CURDIR);
$true_path =~ s%\\%/%g;
$true_path =~ s%//%/%g;
if ($true_path =~ m|(.*)/(.+)|) {
$base = $1;
$cgi = $2;
} else {
$base = $true_path;
$cgi = "cgi-bin";
}
$poss_html_dir = "public_html htdocs";
$unsure_html_dir = "htdoc html www wwwdoc wwwdocs wwwroot httpd doc docs";
@poss = split(/\s/, $poss_html_dir);
@founddir = grep(!/\./, @founddir);
$checker = 0;
foreach $test_dir (@poss) {
if (grep(/^$test_dir$/, @founddir)) {
$html_dir = "$base/$test_dir/ib2000";
$checker = 1;
last;
}
}
if ($checker == 0) {
@poss = split(/\s/, $unsure_html_dir);
foreach $test_dir (@poss) {
if (grep(/^$test_dir$/, @founddir)) {
if (-e "$base/$test_dir/index.html" || -e "$base/$test_dir/index.htm" || -e "$base/$test_dir/index.php" || -e "$base/$test_dir/index.php3") {
$html_dir = "$base/$test_dir/ib2000";
if (-e "$base/$test_dir/index.html" || -e "$base/$test_dir/index.htm" || -e "$base/$test_dir/index.php" || -e "$base/$test_dir/index.php3") {
$checker = 2;
$test_dir_me = $test_dir;
last;
} else {
$checker = 1;
last;
}
} else {
if (-e "$base/$test_dir/index.html" || -e "$base/$test_dir/index.htm" || -e "$base/$test_dir/index.php" || -e "$base/$test_dir/index.php3") {
$html_dir = "$base/$test_dir/ib2000";
$checker = 2;
$test_dir_me = $test_dir;
last;
} else {
$checker = 1;
last;
}
}
}
}
}
if ($html_dir eq "") {$html_dir = "$base"; }
$script_dir = "$true_path";
$test_ss = "";
if ($ENV{'SCRIPT_URI'} ne "") {
$test_ss = $ENV{'SCRIPT_URI'};
} elsif ($ENV{'SCRIPT_URL'} ne "") {
$test_ss = $ENV{'SCRIPT_URL'};
} elsif ($ENV{'REQUEST_URI'}) {
$test_ss = $ENV{'REQUEST_URI'};
} elsif ($ENV{'SCRIPT_NAME'} ne "") {
$test_ss = $ENV{'SCRIPT_NAME'};
}
if ($test_ss ne "") {
if ($test_ss =~ m|^http://([^/]+)|) { $test_ss = $'; }
if ($test_ss =~ m|/$prog|) { $test_ss = $`; }
if ($test_ss ne "") { $script_url = "http://$ENV{'HTTP_HOST'}$test_ss"; }
} else {
$script_url = "http://$ENV{'HTTP_HOST'}/$cgi";
}
if ($script_url =~ m|^http://([^/]+)/~([^/]+)/|) { $uinfo = "~" . $2 . "/"; }
$html_url = "http://$ENV{'HTTP_HOST'}/$uinfo" . "ib2000";
# $html_dir =~ s%/%\\%g if $html_dir =~ m|^(\w+):|;
# $script_dir =~ s%/%\\%g if $script_dir =~ m|^(\w+):|;
$bdcgi = "$base/$cgi";
$html_dir =~ s%\\\\%\\%g;
$script_dir =~ s%\\\\%\\%g;
$bdcgi =~ s%\\\\%\\%g;
if (-e "C:/" || $^O eq "MSWin32") { $OS_USED = 'NT'; }
$adminemail_in = "incoming\@yourdomain.com";
$adminemail_out = "outgoing\@yourdomain.com";
$timezone_choice = "<select name=\"timezone\"><option value=\"-23\">- 23<option value=\"-22\">- 22<option value=\"-21\">- 21<option value=\"-20\">- 20<option value=\"-19\">- 19<option value=\"-18\">- 18<option value=\"-17\">- 17<option value=\"-16\">- 16<option value=\"-15\">- 15<option value=\"-14\">- 14<option value=\"-13\">- 13<option value=\"-12\">- 12<option value=\"-11\">- 11<option value=\"-10\">- 10<option value=\"-9\">- 9<option value=\"-8\">- 8<option value=\"-7\">- 7<option value=\"-6\">- 6<option value=\"-5\">- 5<option value=\"-4\">- 4<option value=\"-3\">- 3<option value=\"-2\">- 2<option value=\"-1\">- 1<option value=\"0\" selected>0<option value=\"1\">+ 1<option value=\"2\">+ 2<option value=\"3\">+ 3<option value=\"4\">+ 4<option value=\"5\">+ 5<option value=\"6\">+ 6<option value=\"7\">+ 7<option value=\"8\">+ 8<option value=\"9\">+ 9<option value=\"10\">+ 10<option value=\"11\">+ 11<option value=\"12\">+ 12<option value=\"13\">+ 13<option value=\"14\">+ 14<option value=\"15\">+ 15<option value=\"16\">+ 16<option value=\"17\">+ 17<option value=\"18\">+ 18<option value=\"19\">+ 19<option value=\"20\">+ 20<option value=\"21\">+ 21<option value=\"22\">+ 22<option value=\"23\">+ 23</select>";
$time_is_now = localtime;
$website_url = "http://$ENV{'HTTP_HOST'}";
$mailprogram = &mailprogram; #自动测试 Sendmail 路径
print qq~
<form action="$thisprog" method="post">
<input type="hidden" name="action" value="step_two">
<font size="5" face="宋体" color="#000000">
<h1>ib2000 安装向导</b></font></h1><font face="宋体" color="#000000">
汉化改进:<a href="mailto:webmaster\@cgier.com">山鹰糊</a><BR>
汉化版权:<a href="http://www.cgier.com/">CGI 编程者之家</a></font>
<hr noshade color="#000000">
<br>
<font face="宋体" color="#000000">
<b>欢迎使用 ib2000 安装向导!</b>
<br><br>
<b>第一步:</b> 在递交表单前,请仔细查看整个下面的内容指示,并检查自动提供的数据是否正确!<br>
当你递交表单后,本安装向导会检测所有你输入的数据,如果数据输入错误,将会有详细的提示!<br><br>
<b>在执行本程序下一步之前,请确定你已经把本程序完整上传,并已经将所有文件的属性设置正确了!</b><br><br>
下面的所有设置数据都可以在 ib2000 的管理中心中重新设置。为了安全起见,本程序在成功完成设置任务后,将会自毁。
如果你希望重新利用本程序来设置的话,请重新上传运行本程序。</font><br>
<hr noshade color="#000000">
<br>
<font face="宋体" color="#000000">
<b>请选择运行本程序的操作系统平台</b><br>
如果你是 Windows 系列的主机,请千万不要选成 Unix,否则会有意想不到的错误发生!<BR>
<br>
<select name="OS_USED">
<option value="NT" selected>Windows 系列
<option value="Unix">Unix 系列
</select>
<br>
<br>
<hr noshade color="#000000">
<br>
<font face="宋体" color="#000000">
<b>文件路径设置</b><br><br>
下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<font color="#FF0000"><br>
请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</font><br><br>
<font color="#FF0000">如果你使用的是 Windows 系列操作系统,请双写反斜杠(比如: c:\\\\path\\\\to\\\\ib2000\\\\),或者使用除号来代替反斜杠(比如:c:/path/to/ib2000/)!
<br><br><font color="#000000"><b>设置时请务必在路径的最后加上除号 '/'。</b>
<br><br>
<font face="宋体" color="#0000FF">
<b>设置 *.cgi 脚本的安装路径。</b></font><br>
<font face="宋体" color="#000000">
在这里设置的是安装“路径”,不是 URL,所以它肯定<B>不是</B> 'http://' 开头的。<br>
这个位置包含了所有 ib2000 中的 *.cgi 文件。
要注意,下列目录<b>必须</b>已经建立,而且里面的文件也已经上传。
<ul>
<li>data
<li>members
<li>messages
<li>help
</ul>
<input type="text" size="70" name="ikondir" value="$script_dir/">
<br><br><br>
<font face="宋体" color="#0000FF">
<b>设置 image 图像文件的安装路径。</b></font><br><br>
<font face="宋体" color="#000000">
在这里设置的是安装“路径”,不是 URL,所以它肯定<B>不是</B> 'http://' 开头的。<br>
这个位置包含了所有 ib2000 中的图像文件。
要注意,下列目录<b>必须</b>已经建立,而且里面的文件也已经上传。
<ul>
<li>images
<li>emoticons
<li>avatars
<li>btg
<li>emot
</ul>
<b>请注意,<B>不要</B>在路径的最后加 '/images/' !</b><BR><BR>
<input type="text" size="70" name="imagesdir" value="$html_dir/">
<br><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -