📄 domodifyaccount.pl
字号:
################################################################################ DoModifyAccount.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. ################################################################################################################################################################ DoModifyAccount ################################################################################sub DoModifyAccount { if (($Group eq "Guest")||(!$Group)) { print "Location: UltraBoard.$Ext?Action=SignIn&Ref=ModifyAccount&Idle=$in{'Idle'}&Sort=$in{'Sort'}&Order=$in{'Order'}&Page=$in{'Page'}\n\n"; exit; } #&ShowError("ACCOUNT CREATION ERROR","You forgot to fill the \"New Password\" field.") if (!$in{'MOD_NewPassword'}); #&ShowError("ACCOUNT CREATION ERROR","You forgot to fill the \"Verfiy New Password\" field.") if (!$in{'MOD_VerfiyNewPassword'}); if ($in{'MOD_NewPassword'} ne "") { &ShowError("用户信息错误","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if ($in{'MOD_NewPassword'}!~/^[A-Za-z0-9]+$/); &ShowError("用户信息错误","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if (length($in{'MOD_NewPassword'})>26); &ShowError("用户信息错误","密码必须使用<font COLOR=red>英文字母或数字</font>,最少<font COLOR=red>6个</font>,最多<font COLOR=red>26个</font>,大小写敏感。") if (length($in{'MOD_NewPassword'})<6); } &ShowError("用户信息错误","您两次输入的密码不相同。") if ($in{'MOD_NewPassword'} ne $in{'MOD_VerfiyNewPassword'}); &ShowError("用户信息错误","您必须输入别名。") if (!$in{'MOD_NickName'}); &ShowError("用户信息错误","您必须输入电子邮件地址。,不能使用(-)。") if (!$in{'MOD_Email'}); &ShowError("用户信息错误","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'MOD_NickName'})>20); &ShowError("用户信息错误","别名最少4个字符(2个汉字),最多20个字符(10个汉字)。") if (length($in{'MOD_NickName'})<4); &ShowError("用户信息错误","电子邮件地址格式不正确,不能使用(-)。") if ($in{'MOD_Email'}=~/[\!\#\$\%\^\&\*\(\)\{\}\;\:\'\`]/); &ShowError("用户信息错误","电子邮件地址格式不正确,不能使用(-)。") if ($in{'MOD_Email'}!~/.*\@.*\..*/); &ShowError("用户信息错误","主页地址格式有错误。") if (($in{'MOD_HomePage'}!~/^http:\/\/.*/)&&($in{'MOD_HomePage'})); &ShowError("用户信息错误","您的年龄只能输入数字。") if (($in{'MOD_Age'}=~/\D/)&&($in{'MOD_Age'})); &ShowError("用户信息错误","您的ICQ号码只能输入数字。") if (($in{'MOD_ICQ'}=~/\D/)&&($in{'MOD_ICQ'})); &ShowError("用户信息错误","您的简介不能多于 $CommentLength 个字符。") if (length($in{'MOD_Comments'})>$CommentLength); &ShowError("用户信息错误","您的简介不能多于 $SignaturesLength 个字符。") if (length($in{'MOD_Signature'})>$SignaturesLength); $UserName=lc($UserName);############################################################################## if ($in{'OldNickName'} ne $in{'MOD_NickName'}) { open(DB,"$MembersPath/Members.nickname")||&CGIError("Couldn't open/read the Members.nickname file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,1) if ($FLock); @NickName=<DB>; close(DB); @NickNamelList=(); for (my($j)=0;$j<=$#NickName;$j++) { chomp($NickName[$j]); if ($NickName[$j] !~/^$in{'OldNickName'}$/i) { if ($NickName[$j] =~/^$in{'MOD_NickName'}$/i) { &ShowError("不能建立用户","您选择的别名已经使用过。"); } push (@NickNamelList,$NickName[$j]); } } push (@NickNamelList,$in{'MOD_NickName'}); $NickNameDATA=join("\n",@NickNamelList); open(DB,">$MembersPath/Members.nickname")||&CGIError("Couldn't create/write the Members.nickname file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB $NickNameDATA."\n"; flock(DB,8) if ($FLock); close(DB); }############################################################################################################################################################## if ($in{'OldEmail'} ne $in{'MOD_Email'}) { 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); @EmailList=(); for (my($i)=0;$i<=$#MembersEmail;$i++) { chomp($MembersEmail[$i]); if ($MembersEmail[$i] !~/^$in{'OldEmail'}$/i) { if (($MembersEmail[$i] =~/^$in{'MOD_Email'}$/i)&&($CheckEmail)) { &ShowError("用户信息错误","您的电子邮件已经使用过一次。"); } push (@EmailList,$MembersEmail[$i]); } } push (@EmailList,$in{'MOD_Email'}); $EmailDATA=join("\n",@EmailList); open(DB,">$MembersPath/Members.email")||&CGIError("Couldn't create/write the Members.email file<br>\nPath: $MembersPath<br>\nReason : $!"); flock(DB,2) if ($FLock); print DB $EmailDATA."\n"; flock(DB,8) if ($FLock); close(DB); }############################################################################### if ($in{'MOD_NewPassword'} ne "") { $NewPassword=$in{'MOD_NewPassword'}; $EPassword=Crypt::crypt($NewPassword,substr($UserName, 0, 2)); }else{ $NewPassword=$Password; $EPassword=$MemberData[2]; } if (($ENV{'REMOTE_HOST'})&&($TrackIP=~/Host/)) { $IP=$ENV{'REMOTE_HOST'}; }elsif ($TrackIP=~/IP/){ $IP=$ENV{'REMOTE_ADDR'}; } if($MemberData[22] eq "") { $MemberData[22]=$in{'REG_Gender'}; } &SaveMemberData($UserName, $UserName, $in{'MOD_NickName'}, $EPassword, $MemberData[3], $in{'MOD_Email'}, $MemberData[5], $MemberData[6], $MemberData[7], $in{'MOD_HomePage'}, &RemoveCensorWords($in{'MOD_Location'}), $in{'MOD_Age'}, &RemoveCensorWords($in{'MOD_Occupation'}), &RemoveCensorWords($in{'MOD_Interests'}), $in{'MOD_ICQ'}, &RemoveCensorWords($in{'MOD_Comments'}), &RemoveCensorWords($in{'MOD_Signature'}), $MemberData[16], $in{'MOD_ShowEmail'}, $MemberData[18], $MemberData[19], $IP, $MemberData[21], $MemberData[22], $MemberData[23], $MemberData[24], $MemberData[25] );############################################################################### if ($in{'MOD_Idle'} ne "default") { $in{'Idle'}=$in{'MOD_Idle'}; $in{'Sort'}=$in{'MOD_Sort'}; $in{'Order'}=$in{'MOD_Order'}; } if (($in{'MOD_Remember'})&&($in{'MOD_Idle'} eq "default")) { print &CookiesHeader(time+31536000,"UserName",$UserName,"Password",$NewPassword,"Idle","","Order","","Sort",""); }elsif (($in{'MOD_Remember'})&&($in{'MOD_Idle'} ne "default")) { print &CookiesHeader(time+31536000,"UserName",$UserName,"Password",$NewPassword,"Idle",$in{'MOD_Idle'},"Order",$in{'MOD_Order'},"Sort",$in{'MOD_Sort'}); }elsif ($in{'MOD_Remember'}) { print &CookiesHeader(time+31536000,"UserName",$UserName,"Password",$NewPassword); }elsif ($in{'MOD_Idle'} eq "default") { print &CookiesHeader(time+31536000,"Idle","","Order","","Sort",""); }elsif ($in{'MOD_Idle'} ne "default") { print &CookiesHeader(time+31536000,"Idle",$in{'MOD_Idle'},"Order",$in{'MOD_Order'},"Sort",$in{'MOD_Sort'}); } &ShowThank( "编辑个人信息", "您的个人信息修改成功 !", "3", "UltraBoard.$Ext?Action=$in{'Ref'}&Category=$in{'Category'}&Board=$in{'Board'}&Post=$in{'Post'}&ID=$in{'ID'}&Idle=$in{'Idle'}&Sort=$in{'Sort'}&Order=$in{'Order'}&Page=$in{'Page'}&Session=$SessionID" ); exit;}###############################################################################1;# End of DoModifyAccount Function###############################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -