📄 dosignup.pl
字号:
################################################################################ DoSignUp.pl ################################################################################# UltraBoard Ver. 1.61 by UltraScripts.com ## Scripts written by Jacky W.W. Yung, WebMaster@UltraScripts.com ## Available from http://www.UltraScripts.com/UltraBoard/ ## --------------------------------------------------------------------------- ## PROGRAM NAME : UltraBoard ## VERSION : 1.61 ## LAST MODIFIED : 30/06/1999 ## =========================================================================== ## COPYRIGHT NOTICE : ## ## Copyright (c) 1999 Jacky Yung. All Rights Reserved. ## ## This program is free software; you can change or modify it as you see fit. ## However, modified versions cannot be sold or distributed. You cannot alter ## the copyright and "powered by" notices throughout the scripts. These ## notices must be clearly visible to the end users. ## ## WARRANTY DISCLAIMER: ## ## THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ## ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR ## FITNESS FOR A PARTICULAR PURPOSE. ################################################################################################################################################################ DoSignUp ################################################################################sub DoSignUp { if (!$AllowRegister) { print "Location: UltraBoard.$Ext\n\n"; } &ShowError("不能建立用户","雁过尚且留声,何况人乎!") if (!$in{'REG_UserName'}); if (!$VerifyReg) { &ShowError("不能建立用户","您必须输入密码。") if (!$in{'REG_Password'}); &ShowError("不能建立用户","您必须输入验证密码。") if (!$in{'REG_VerfiyPassword'}); &ShowError("不能建立用户","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if ($in{'REG_Password'}!~/^[A-Za-z0-9]+$/); &ShowError("不能建立用户","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if (length($in{'REG_Password'})>26); &ShowError("不能建立用户","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if (length($in{'REG_Password'})<6); &ShowError("不能建立用户","您两次输入的密码不相同。") if ($in{'REG_Password'} ne $in{'REG_VerfiyPassword'}); }else{ $in{'REG_Password'}=&RandomPassword(); } &ShowError("不能建立用户","您必须输入绰名。") if (!$in{'REG_NickName'}); &ShowError("不能建立用户","您必须输入电子邮件地址。,不能使用(-)。") if (!$in{'REG_Email'}); &ShowError("不能建立用户","用户名必须使用<font COLOR=red>英文字母或数字</font>,最多<font COLOR=red>26个</font>,大小写敏感,不能使用空格。") if ($in{'REG_UserName'}=~/\W/); &ShowError("不能建立用户","用户名必须使用<font COLOR=red>英文字母或数字</font>,最多<font COLOR=red>26个</font>,大小写敏感,不能使用空格。") if (length($in{'REG_UserName'})>26); &ShowError("不能建立用户","用户名必须使用<font COLOR=red>英文字母或数字</font>,最多<font COLOR=red>26个</font>,大小写敏感,不能使用空格。") if (length($in{'REG_UserName'})<2); &ShowError("不能建立用户","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'REG_NickName'})>20); &ShowError("不能建立用户","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'REG_NickName'})<4); &ShowError("不能建立用户","电子邮件地址格式不正确,不能使用(-)。") if ($in{'REG_Email'}=~/[\!\#\$\%\^\&\*\(\)\{\}\;\:\'\`]/); &ShowError("不能建立用户","电子邮件地址格式不正确,不能使用(-)。") if ($in{'REG_Email'}!~/.*\@.*\..*/); &ShowError("不能建立用户","主页地址格式有错误。") if (($in{'REG_HomePage'}!~/^http:\/\/.*/)&&($in{'REG_HomePage'})); &ShowError("不能建立用户","您的年龄只能输入数字。") if (($in{'REG_Age'}=~/\D/)&&($in{'REG_Age'})); &ShowError("不能建立用户","您的ICQ号码只能输入数字。") if (($in{'REG_ICQ'}=~/\D/)&&($in{'REG_ICQ'})); &ShowError("不能建立用户","您的江湖履历不能多于 $CommentLength 个字符。") if (length($in{'REG_Comments'})>$CommentLength); &ShowError("不能建立用户","您的江湖履历不能多于 $SignaturesLength 个字符。") if (length($in{'REG_Signature'})>$SignaturesLength); $in{'REG_UserName'}=lc($in{'REG_UserName'}); &ShowError("不能建立用户","用户名已经存在。") if (-e "$MembersPath/$in{'REG_UserName'}.info");###################################################################################################################################################### if ($CheckEmail) { open(DB,"$MembersPath/Members.email")||&CGIError("Couldn't open/read the Members.email file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,1) if ($FLock); @MembersEmail=<DB>; close(DB); for (my($i)=0;$i<=$#MembersEmail;$i++) { chomp($MembersEmail[$i]); if ($MembersEmail[$i] =~/^$in{'REG_Email'}$/i) { &ShowError("不能建立用户","您的电子邮件已经使用过一次。"); } } } open(DB,"$MembersPath/Members.nickname")||&CGIError("Couldn't open/read the Members.nickname file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,1) if ($FLock); @REG_NickName=<DB>; close(DB); for (my($i)=0;$i<=$#REG_NickName;$i++) { chomp($REG_NickName[$i]); if ($REG_NickName[$i] =~/^$in{'REG_NickName'}$/i) { &ShowError("不能建立用户","您选择的绰名已经被他人使用了!"); } } open(DB,">>$MembersPath/Members.nickname")||&CGIError("Couldn't write the Members.nickname file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB $in{'REG_NickName'}."\n"; flock(DB,8) if ($FLock); close(DB); open(DB,">>$MembersPath/Members.email")||&CGIError("Couldn't write the Members.email file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB $in{'REG_Email'}."\n"; flock(DB,8) if ($FLock); close(DB);############################################################################### open(DB,"$MembersPath/Members.total")||&CGIError("Couldn't open/read the Members.total file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,1) if ($FLock); $TotalMembers=<DB>; close(DB); open(DB,">$MembersPath/Members.total")||&CGIError("Couldn't create/write the Members.total file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB ++$TotalMembers; flock(DB,8) if ($FLock); close(DB);############################################################################### open(DB,">>$MembersPath/$DefaultGroup.grp")||&CGIError("Couldn't write the $DefaultGroup.grp file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB $in{'REG_UserName'}."\n"; flock(DB,8) if ($FLock); close(DB);############################################################################### $RegTime=time; if ($ViewRegister) { $Status="Disactivate"; if ($VerifyReg eq "") { $NewPassword=Crypt::crypt($in{'REG_Password'},substr($in{'REG_UserName'}, 0, 2)); } }else{ $Status="Activate"; $NewPassword=Crypt::crypt($in{'REG_Password'},substr($in{'REG_UserName'}, 0, 2)); } if (($ENV{'REMOTE_HOST'})&&($TrackIP=~/Host/)) { $IP=$ENV{'REMOTE_HOST'}; }elsif ($TrackIP=~/IP/){ $IP=$ENV{'REMOTE_ADDR'};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -