📄 register.cgi
字号:
#!/usr/bin/perl
#############################################################
# LeoBoard ver.5000 / LB5000 / 雷傲超级论坛 ver.5000
#
# 版权所有: 雷傲工作室(原蓝宝石软件工作室)
#
# 制作人 : 山鹰糊 (Shining Hu)
# 花无缺 (Ifairy Han)
#
# 主页地址: http://www.CGIer.com/ CGI 编程者之家
# http://www.LeoBoard.com/ 雷傲论坛支持主页
# http://www.leoBBS.com/ 本论坛直通车
#
#############################################################
BEGIN {
$LBPATH = '.';
my $pgm = $0;
$pgm =~s/\\/\//g;
$pgm =~s/^.*\/([^\/]+)$/$1/g;
unless (-e $LBPATH.'/'.$pgm) {
foreach ($0, $ENV{'SCRIPT_FILENAME'}, $ENV{'PATH_TRANSLATED'}) {
s!\\!/!g; s/^(.*)\/[^\/]+$/$1/g;
if (-e $_ . '/' .$pgm) { $LBPATH = $_; last; }
}
}
unshift (@INC, "$LBPATH");
}
use LBCGI;
$LBCGI::POST_MAX=1024*150;
$LBCGI::DISABLE_UPLOADS = 0;
$LBCGI::HEADERS_ONCE = 1;
require "data/boardinfo.cgi";
require "data/styles.cgi";
require "lbmail.lib.pl";
require "lb.lib.pl";
require "code.cgi";
$|++;
$thisprog = "register.cgi";
$query = new LBCGI;
&ipbanned; #封杀一些 ip
if ($COOKIE_USED eq 1) {$cookiepath ="";}
else {
$boardurltemp =$boardurl;
$boardurltemp =~ s/http\:\/\/(\S+?)\/(.*)/\/$2/;
$cookiepath = $boardurltemp;
$cookiepath =~ s/\/$//;
# $cookiepath =~ tr/A-Z/a-z/;
}
$addme=$query->param('addme');
$inforum = $query -> param('forum');
$inforum = &stripMETA("$inforum");
&error("打开文件&老大,别乱黑我的程序呀!") if (($inforum) && ($inforum !~ /^[0-9]+$/));
if ($arrowavaupload ne "on") { undef $addme; }
if ($regonoff == 1) {
$inmembername = $query->cookie("amembernamecookie");
$inpassword = $query->cookie("apasswordcookie");
$inmembername =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$inpassword =~ s/[\a\f\n\e\0\r\t\|\@\;\#\{\}\$]//isg;
unless ($inmembername eq "" || $inmembername eq "客人") { &getmember("$inmembername"); &error("普通错误&此用户根本不存在!") if ($userregistered eq "no"); &error("普通错误&密码与用户名不相符,请重新登录!") if ($inpassword ne $password); $regonoff = 0 if ($membercode eq "ad"); }
}
for ('inmembername','password','password2','emailaddress','showemail','homepage','oicqnumber','icqnumber','newlocation',
'interests','signature','timedifference','useravatar','action','personalavatar','personalwidth','personalheight',
'sex','year','month','day','userflag','userxz','usersx') {
next unless defined $_;
next if $_ eq 'SEND_MAIL';
$tp = $query->param($_);
$tp = &unHTML("$tp");
${$_} = $tp;
}
if ($query -> param('getpassq')=~/\|/ || $query -> param('getpassa')=~/\|/) {
&error("密码提示问题和答案&密码提示问题和答案中,不允许有非法字符,请更换提问和答案!");
}
$userquestion = $query -> param('getpassq')."|".$query -> param('getpassa');
$userquestion = "" if ($passwordverification eq "yes" && $emailfunctions ne "off");
$helpurl = &helpfiles("用户注册");
$helpurl = qq~$helpurl<img src=$imagesurl/images/help_b.gif border=0></a>~;
if ($arrawsignpic eq "on") { $signpicstates = "允许"; } else { $signpicstates = "禁止"; }
if ($arrawsignflash eq "on") { $signflashstates = "允许"; } else { $signflashstates = "禁止"; }
if ($arrawsignfontsize eq "on") { $signfontsizestates = "允许";} else { $signfontsizestates = "禁止";}
if ($arrawsignsound eq "on") { $signsoundstates = "允许"; } else { $signsoundstates = "禁止"; }
my $password1 = $password;
&title;
$password = $password1;
if ($boardlogo =~ /\.swf$/i) {$forumgraphic = qq~<PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><embed src=$imagesurl/myimages/$boardlogo quality=high width=$boardlogow height=$boardlogoh pluginspage="http:\/\/www.macromedia.com\/shockwave\/download\/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application\/x-shockwave-flash"><\/embed>~}
else {$forumgraphic = qq~<img src=$imagesurl/myimages/$boardlogo>~};
$output .= qq~<p>
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center><tr>
<td width=30% rowspan=2 valign=top>$forumgraphic</td>
<td valign=top><font color=$fontcolormisc>
<img src=$imagesurl/images/closedfold.gif> <a href="leoboard.cgi">$boardname</a><br>
<img src=$imagesurl/images/bar.gif><img src=$imagesurl/images/openfold.gif> 用户注册
</td></tr><tr><td valign=bottom align=right> $helpurl</td></tr></table>
<p><table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
~;
if ($regonoff eq 1) {
$output .= qq~<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>对不起,论坛暂时不允许注册新用户</b>
</td></tr><td bgcolor=$miscbackone align=center><font color=$fontcolormisc size=3><BR><BR>~;
if ($noregwhynot ne "") { $noregwhynot=&HTML($noregwhynot); $noregwhynot =~ s/\n/<BR>/isg;$output.=qq~$noregwhynot~; }
else { $output.=qq~由于一些特殊的原因,本论坛暂时不接受用户注册!~; }
$output.=qq~<BR><BR><BR></td></tr></table></td></tr></table>~;
}
elsif ($action eq "addmember") {
$membercode = "me";
$membertitle = "Member";
$numberofposts = "0|0";
$joineddate = time;
$lastgone = $joineddate;
$jhmp = "无门无派";
$lastpostdate = "没有发表过";
$emailaddress = lc($emailaddress);
$ipaddress = $ENV{'REMOTE_ADDR'};
my $trueipaddress = $ENV{'HTTP_X_FORWARDED_FOR'};
$trueipaddress = $ipaddress if (($trueipaddress eq "")||($trueipaddress eq "unknown"));
my $trueipaddress1 = $ENV{'HTTP_CLIENT_IP'};
$trueipaddress = $trueipaddress1 if (($trueipaddress1 ne "")&&($trueipaddress1 ne "unknown"));
$ipaddress = $trueipaddress;
$year =~ s/\D//g;
if (($year eq "")||($month eq "")||($day eq "")) { $year = "";$month = "";$day = "";}
$born = "$year/$month/$day";
if ($born ne "//") { #开始自动判断星座
if ($year-1900 < 0) {$usersx = "";} # 无效年份
else { $usersx = "sx".(($year-1900) % 12 + 1); }
if ($month eq "01") {
if (($day >= 1)&&($day <=19)) { $userxz = "z10"; }
else { $userxz = "z11"; }
}
elsif ($month eq "02") {
if (($day >= 1)&&($day <=18)) { $userxz = "z11"; }
else { $userxz = "z12"; }
}
elsif ($month eq "03") {
if (($day >= 1)&&($day <=20)) { $userxz = "z12"; }
else { $userxz = "z1"; }
}
elsif ($month eq "04") {
if (($day >= 1)&&($day <=19)) { $userxz = "z1"; }
else { $userxz = "z2"; }
}
elsif ($month eq "05") {
if (($day >= 1)&&($day <=20)) { $userxz = "z2"; }
else { $userxz = "z3"; }
}
elsif ($month eq "06") {
if (($day >= 1)&&($day <=21)) { $userxz = "z3"; }
else { $userxz = "z4"; }
}
elsif ($month eq "07") {
if (($day >= 1)&&($day <=22)) { $userxz = "z4"; }
else { $userxz = "z5"; }
}
elsif ($month eq "08") {
if (($day >= 1)&&($day <=22)) { $userxz = "z5"; }
else { $userxz = "z6"; }
}
elsif ($month eq "09") {
if (($day >= 1)&&($day <=22)) { $userxz = "z6"; }
else { $userxz = "z7"; }
}
elsif ($month eq "10") {
if (($day >= 1)&&($day <=23)) { $userxz = "z7"; }
else { $userxz = "z8"; }
}
elsif ($month eq "11") {
if (($day >= 1)&&($day <=21)) { $userxz = "z8"; }
else { $userxz = "z9"; }
}
elsif ($month eq "12") {
if (($day >= 1)&&($day <=21)) { $userxz = "z9"; }
else { $userxz = "z10"; }
}
}
if ($oneaccountperemail eq "yes") {
my $foundemail = "no";
my $foundname = "";
open (MEMFILE, "${lbdir}data/lbmember1.cgi");
my @allmembers = <MEMFILE>;
close (MEMFILE);
foreach (@allmembers) {
chomp $_;
my ($user, $mail) = split(/\t/,$_);
if (lc($emailaddress) eq lc($mail)){
$foundemail = "yes";
$foundname = $user;
last;
}
}
if ($foundemail eq "yes") {
&error("用户注册&对不起,这输入的 Email 已经被注册用户:<u>$foundname</u> 使用了");
}
}
&error("用户注册&对不起,您输入的用户名有问题,请不要在用户名中包含\@\#\$\%\^\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?\[\]这类字符!") if ($inmembername =~ /[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?\[\]]/);
if($inmembername =~ /_/) { &error("用户注册&请不要在用户名中使用下划线!"); }
$inmembername =~ s/\ \;//ig;
$inmembername =~ s/ / /g;
$inmembername =~ s/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -