📄 register.cgi
字号:
### Create a dummy file to foil snoopers, and to stop them gaining a list of the directory
open (FILE, ">members/index.html");
print FILE qq(
<HTML><HEAD>
<TITLE>401 Authorization Required</TITLE>
</HEAD><BODY>
<H1>Authorization Required</H1>
This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.<P>
<HR>
<ADDRESS>Apache/1.3.9 Server at $homeurl Port 80</ADDRESS>
</BODY></HTML>);
close (FILE);
### append boardstats.cgi
require "$ikondir" . "data/boardstats.cgi";
$filetomake = "$ikondir" . "data/boardstats.cgi";
$totalmembers++;
open(FILE, ">$filetomake");
flock(FILE, 2) if ($OS_USED eq "Unix");
print FILE "\$lastregisteredmember = \"$inmembername\"\;\n";
print FILE "\$totalmembers = \"$totalmembers\"\;\n";
print FILE "\$totalthreads = \"$totalthreads\"\;\n";
print FILE "\$totalposts = \"$totalposts\"\;\n";
print FILE "\n1\;";
close (FILE);
### Send the emails
if (($passwordverification eq "yes") && ($emailfunctions ne "off")) {
$passcookie = cookie(-name => "apasswordcookie",
-value => "",
-expires => "now");
$to = "$emailaddress";
$from = "$homename <$adminemail_out>";
$subject = "感谢您在$boardname中注册!";
$message .= "\n";
$message .= "$boardname\n";
$message .= "$boardurl/$forumsummaryprog\n\n\n";
$message .= "------------------------------------\n";
$message .= "您的用户名、密码如下。\n\n";
$message .= "用户名: $inmembername\n";
$message .= "新密码: $password\n\n\n";
$message .= "用户名、密码是区分大小写的\n\n";
$message .= "您随时可以使用用户资料修改您的密码\n";
$message .= "如果您改变了您的邮件地址,\n";
$message .= "将会有一个新的密码寄给您。\n\n";
$message .= "------------------------------------\n";
&sendmail($from, $from, $to, $SMTP_SERVER, $subject, $message);
} # end send password to member
if ($newusernotify eq "yes" && $emailfunctions ne "off") {
$to = "$adminemail_in";
$from = "$homename <$adminemail_out>";
$subject = "$boardname有新用户注册了!";
$message = "";
$message .= "\n";
$message .= "$boardname\n";
$message .= "$boardurl/$forumsummaryprog\n";
$message .= "-------------------------------------\n\n";
$message .= "新用户注册的信息如下。\n\n";
$message .= "用户名: $inmembername\n";
$message .= "密 码: $password\n";
$message .= "邮 件: $emailaddress\n";
$message .= "主 页: http://$inhomepage\n";
$message .= "IP地址: $ipaddress\n\n";
$message .= "------------------------------------\n";
&sendmail($from, $from, $to, $SMTP_SERVER, $subject, $message);
} # end routine
} # end routine
elsif ($action eq "agreed") {
if (($passwordverification eq "yes") && ($emailfunctions ne "off")) {
$requirepass = qq~
<tr>
<td bgcolor=$miscbackone colspan=2 align=center><font face="$font" color=$fontcolormisc><b>您的密码将通过邮件寄给您</td>
</tr>
~;
}
else {
$requirepass = qq~
<tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>密码:</b><br>请输入密码,区分大小写。<br>请不要使用任何类似 '*'、'|' 或 HTML 字符。</td>
<td bgcolor=$miscbackone><input type=password name="password"> * 此项必须填写</td>
</tr>
<tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>密码:</b><br>再输一遍,以便确定!</td>
<td bgcolor=$miscbackone><input type=password name="password2"> * 此项必须填写</td>
</tr>
~;
}
### Avatar stuff
if ($avatars eq "on") {
$dirtoopen = "$imagesdir" . "avatars";
opendir (DIR, "$dirtoopen") or die "不是正确的目录($dirtoopen),请论坛管理中心 \>\;变量结构中检查 \$imagesdir 目录!";
@dirdata = readdir(DIR);
closedir (DIR);
@images = grep(/gif/,@dirdata);
$totleavator=@images -1;
foreach (@images) {
$cleanavatar = $_;
$cleanavatar =~ s/.gif$//i;
# Skip, if it's an admin/moderator only avatar
if ($cleanavatar =~ /admin_/) { next; }
if ($cleanavatar eq "noavatar") {
$selecthtml .= qq~<option value="noavatar" selected>不要头像</option>\n~;
$currentface = "$cleanavatar";
}
else {
$selecthtml .= qq~<option value="$cleanavatar">$cleanavatar</option>\n~;
}
}
$avatarhtml = qq~
<script language="javascript">
function showimage()
{
//alert("$imagesurl/avatars/"+document.creator.useravatar.options[document.creator.useravatar.selectedIndex].value+".gif");
document.images.useravatars.src="$imagesurl/avatars/"+document.creator.useravatar.options[document.creator.useravatar.selectedIndex].value+".gif";
}
</script>
<tr>
<td bgcolor=$miscbackone valign=top><font face="$font" color=$fontcolormisc><b>个性图片:</b><br>您可以选择一个个性图片,当你发表时将显示在您的名字下方。<BR>如果你填写了下面的自定义头像部分,那么你的头像以自定义的为准。否则,请你留空自定义头像的所有栏目!<BR>
<br><br><b>关于自定义头像</b>:<br>你也可以在这里给出你自定义头像的 URL 地址,头像的高度和宽度(像素)。 如果不想要自定义头像,请将相应栏目栏目全部留空!<BR><BR>
<br><b>如果你不想要任何的头像,那么请首先在菜单上选“不要头像”,然后留空所有自定义头像的部分!</b><BR><br>
<td bgcolor=$miscbackone valign=top>总头像个数: $totleavator 个<BR>
<select name="useravatar" size=1 onChange="showimage()">
$selecthtml
</select>
<img src="$imagesurl/avatars/$currentface.gif" name="useravatars" width="32" height="32" border=0 hspace=15><br><br><br>
<br>图像位置: <input type="text" name="personalavatar" size="20" value=""> 输入完整的 URL 路径。<br>
<br>图像宽度: <input type="text" name="personalwidth" size="2" maxlength=2 value=""> 必须是 20 -- $maxposticonwidth 之间的一个整数。<br>
<br>图像高度: <input type="text" name="personalheight" size="2" maxlength=2 value=""> 必须是 20 -- $maxposticonheight 之间的一个整数。<br></td>
</td>
</tr>
~;
} # end avatar if
### Print the form
$output .= qq~
<form action="$boardurl/$thisprog" method=post name="creator">
<tr>
<td bgcolor=$miscbacktwo><font face="$font" color=$fontcolormisc><b>用户名:</b><br>注册用户名不能超过12个字符(6个汉字)</td>
<td bgcolor=$miscbacktwo><input type=text maxlength="12" name="inmembername"> * 此项必须填写</td>
</tr>
$requirepass
<tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>邮件地址:</b><br>请输入有效的邮件地址,这将保证您在论坛中的私人资料</td>
<td bgcolor=$miscbackone><input type=text name="emailaddress"> * 此项必须填写</td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>显示邮件地址</b><br>
您是否希望在您发表文章之后显示您的邮件?</td>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><input name=\"showemail\" type=\"radio\" value=\"yes\" checked> 是  \; <input name=\"showemail\" type=\"radio\" value=\"no\"> 否</font></td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>主页地址:</b><br>如果您有主页,请输入主页地址。此项可选</td>
<td bgcolor=$miscbackone><input type=text name="homepage" value="http://"></td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>OICQ 号:</b><br>如果您有 OICQ,请输入号码。此项可选</td>
<td bgcolor=$miscbackone><input type=text name="aolname"></td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>ICQ 号:</b><br>如果您有 ICQ,请输入号码。此项可选</td>
<td bgcolor=$miscbackone><input type=text name="icqnumber"></td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>来自:</b><br>请输入您所在的地方。此项可选</td>
<td bgcolor=$miscbackone><input type=text name="location" maxlength="14"> 不能超过14个字符(7个汉字)</td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>时差:</b><br>
服务器所在时区:$basetimes<br>如果您所在的位置和服务器有时差,请输入。<br>您看到所有的时间将按照您所在的地区时间显示。</td>
<td bgcolor=$miscbackone>
<select name="timedifference"><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> 小时
</td>
</tr><tr>
<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>签名:</b><br>请输入您的签名,不能超过 5 行。
<br><br>不能使用 HTML 标签<br>可以使用 <a href="javascript:openScript('misc.cgi?action=ikoncode',300,350)">ib2000 标签</a><BR>
<li>贴图标签: <b>$signpicstates</b><li>音乐标签: <b>$signsoundstates</b><li>文字大小: <b>$signfontsizestates</b>
</td>
<td bgcolor=$miscbackone><textarea name="signature" cols="60" rows="5"></textarea></td>
</tr>
$avatarhtml
<tr>
<td colspan=2 bgcolor=$miscbacktwo align=center><input type=submit value="提 交" name=submit></td>
<input type=hidden name=action value=addmember></form></tr></table></td></tr></table>
~;
#</tr><tr>
#<td bgcolor=$miscbackone><font face="$font" color=$fontcolormisc><b>简介:</b><br>您可以输入您的个人简介。此项可选</td>
#<td bgcolor=$miscbackone><textarea name="interests" cols="60" rows="5"></textarea></td>
} # end agree
else { # show register agree form
$filetoopen = "$ikondir" . "data/register.dat";
open(FILE,$filetoopen) or die "不能够找到 register.dat 文件,请确定它存在于 data 目录!";
@filedata = <FILE>; close(FILE);
foreach (@filedata) { $tempoutput .= $_; }
$output .= qq~
<tr>
<td bgcolor=$miscbacktwo align=center>
<form action="$thisprog" method="post">
<input name="action" type="hidden" value="agreed">
<font face="$font" color=$fontcolormisc>
<b>服务条款和声明</b>
</td>
</tr>
<td bgcolor=$miscbackone align=left><font face="$font" color=$fontcolormisc>
$tempoutput
</td>
</tr>
<tr>
<td bgcolor=$miscbacktwo align=center>
<center><input type="submit" value="我同意"></center>
</td></form></tr></table>
</td></tr></table>
~;
} # end elseform
print header(-cookie=>[$namecookie, $passcookie], -charset=>"gb2312");
&output(
-Title => $boardname,
-ToPrint => $output,
-Version => $versionnumber
);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -