?? cjyh.cgi
字號:
#!/usr/bin/perl
#------------------------------------------------------#
# 本程序為Yuzi工作室提供 #
# Yuzi論壇3000(BBS3000)v4.00 #
#------------------------------------------------------#
$cgipa="."; # CGI程序文件的絕對路徑
######################
## 以下部分不需修改 ##
######################
require "$cgipa/setup.cgi";
&GetCookies;
$cgiurl ="cjyh.cgi";
$list="$filepath/data/list.cgi";
$listpage = 20;
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value=~tr/+/ /;
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value=~s/\.\.//g;
$value=~s/\t//g;
if($FORM{$name}){$FORM{$name}=$FORM{$name}.",".$value;}else{$FORM{$name}=$value;}
}
$username=$FORM{'username'};
$menu=$FORM{'menu'};
$title=$FORM{'title'};
$selname=$FORM{'selname'};
$mail=$FORM{'mail'};
$sort=$FORM{'sort'};
$page=$FORM{'page'};
$money=$FORM{'money'};
$charm=$FORM{'charm'};
if (-e "$cgipa/install.cgi"){unlink("$cgipa/install.cgi");}
if($menu eq "mail"){&mail;exit;}
############
if(($admname eq $Cookies{admname})&&($delpsd ne $Cookies{delpsd})){
($kkk)=split(/\)/,$ENV{'HTTP_USER_AGENT'});
($bzd,$ie,$win,$me)=split(/;/,$kkk);
if($me eq " Win 9x 4.90"){$win="Windows Me"}
elsif($win eq " Windows NT 5.0"){$win="Windows 2000"}
elsif($win eq " Windows NT 5.1"){$win="Windows XP"};
$loginname=$Cookies{username};
if ($Cookies{username} eq ""){$loginname="訪客";}
open(TITLES,"$filepath/data/log");
@hastitles=<TITLES>;
close(TITLES);
open(TITLES,">$filepath/data/log");
print TITLES "$thistime\t$loginname\t$Cookies{delpsd}\t$from\t$win$ie\t<font color=red>登陸失敗</font>\n";
for($i=0;$i<=18;$i++){$m=@hastitles[$i];print TITLES "$m";}
close(TITLES);
}
############
if(($admname ne $Cookies{admname})||($delpsd ne $Cookies{delpsd})){
&csshtml;
print <<EOF;
<meta HTTP-EQUIV=REFRESH CONTENT=$FORM{'REFRESH'};URL=cjyh.cgi><sCRIPT>
document.cookie="admname="+"$FORM{'adm'}";
document.cookie="delpsd="+"$FORM{'psd'}";
</SCRIPT><center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
社區管理</font></b></td></tr></table><form action=$cgiurl METHOD=POST><table border="0">
<tr><td width="40%" align=center>社區區長名字:</td><td width="60%"><input size=20 name=adm></td>
</tr><tr><td width="40%" align=center>社區區長密碼:</td><td width="60%"><input size=20 name=psd type=password></td>
</tr><tr><td width="40%" align=center></td><td width="60%"><input type="submit" value="登 陸"></td>
</tr></table><input type=hidden name=REFRESH value="1"></form></center></div><br>
<table width=80% align=center><tr><td><b><font color=#555555>注意:<br><br>
只有社區區長才能登陸社區管理中心。
未經過授權的嘗試登陸行為將會被記錄在案!</font></b>
</td></tr></table>
EOF
exit;
}
elsif($menu eq "kills"){&kills;exit;}
elsif($menu eq "listusers"){&listusers;exit;}
elsif($menu eq "chgusers"){&chgusers;exit;}
elsif($menu eq "del3"){&del3;exit;}
elsif($menu eq "ckyh"){&ckyh;exit;}
elsif($menu eq "ckbz"){&ckbz;exit;}
elsif($menu eq "bbslb"){&bbslb;exit;}
elsif($menu eq "qlid"){&qlid;exit;}
elsif($menu eq "club"){&club;exit;}
elsif($menu eq "money"){&money;exit;}
elsif($menu eq "clubok"){&clubok;exit;}
elsif($menu eq "lucida"){&lucida;exit;}
elsif($menu eq "lucidaok"){&lucidaok;exit;}
elsif($menu eq "rank"){&rank;exit;}
elsif($menu eq "rankok"){&rankok;exit;}
elsif($menu eq "setup"){&setup;exit;}
elsif($menu eq "setupok"){&setupok;exit;}
elsif($menu eq "cleanname"){&cleanname;exit;}
elsif($menu eq "all"){&all;exit;}
elsif($menu eq "fix"){&fix;exit;}
elsif($menu eq "log"){&log;exit;}
elsif($menu eq "editcss"){&editcss;exit;}
elsif($menu eq "cssok"){&cssok;exit;}
elsif($menu eq "link"){&link;exit;}
elsif($menu eq "upmember"){&upmember;exit;}
elsif($menu eq "upfile"){&upfile;exit;}
elsif($menu eq "upfileok"){&upfileok;exit;}
elsif($menu eq "linkok"){&linkok;exit;}
elsif($menu eq "linkdel"){&linkdel;exit;}
elsif($menu eq "bak"){&bak;exit;}
elsif($menu eq "unbak"){&unbak;exit;}
elsif($menu eq "bakok"){do "$cgipa/sub/tar.cgi";exit;}
elsif($menu eq "unbakok"){do "$cgipa/sub/untar.cgi";exit;}
elsif($menu eq "ratinglog"){&ratinglog;exit;}
elsif($menu eq "rating"){&rating;exit;}
else{
&csshtml;
$program_use_time=times;
print <<EOF;
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
身份驗證:通過!</font></b></td></tr></table><br><table border=0 width=60%><tr><td>Perl 版本:</td>
<td><font color=red>$]</font></td></tr><tr><td>服務器域名:</td><td><font color=red>$ENV{'HTTP_HOST'}</font></td></tr>
EOF
if($ENV{'SERVER_ADDR'}){print"<tr><td>服務器IP地址:</td><td><font color=red>$ENV{'SERVER_ADDR'}</font></td></tr>";}
print <<EOF;
<tr><td>服務器操作系統:</td><td><font color=red>$^O</font></td></tr>
EOF
if($ENV{'COMPUTERNAME'}){print"<tr><td>服務器計算機名稱:</td><td><font color=red>$ENV{'COMPUTERNAME'}</font></td></tr>";}
print <<EOF;
<tr><td>服務器HTTP軟件名稱:</td><td><font color=red>$ENV{'SERVER_Software'}</font></td></tr>
<tr><td>服務器現在時間:</td><td>$year年$mon月$mday日 $hour:$min:$sec</td></tr>
EOF
if($program_use_time < 1){print"<tr><td>運行消耗時間:</td><td><font color=red>$program_use_time</font> ms</td>";}
($kkk)=split(/\)/,$ENV{'HTTP_USER_AGENT'});
($bzd,$ie,$win,$me)=split(/;/,$kkk);
if($me eq " Win 9x 4.90"){$win="Windows Me"}
elsif($win eq " Windows NT 5.0"){$win="Windows 2000"}
elsif($win eq " Windows NT 5.1"){$win="Windows XP"};
$loginname=$Cookies{username};
if ($Cookies{username} eq ""){$loginname="訪客";}
open(TITLES,"$filepath/data/log");
@hastitles=<TITLES>;
close(TITLES);
open(TITLES,">$filepath/data/log");
print TITLES "$thistime\t$loginname\t不顯示\t$from\t$win$ie\t登陸成功\n";
for($i=0;$i<=18;$i++){$m=@hastitles[$i];print TITLES "$m";}
close(TITLES);
exit;
}
#########
sub listusers{
&csshtml;
print <<EOF;
<SCRIPT>
function up_reset(){
if (confirm("此功能較耗系統資源,建議在系統較空閑時使用!")){
return true;
}
return false;
}
</SCRIPT>
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
注冊用戶管理</font></b></td></tr></table><form action=$cgiurl METHOD="POST">
請鍵入用戶的名稱:<input type=text name="username" size=12><input type=hidden name="type" value="one">
<input type=hidden name="menu" value="ckyh"><input type=submit value="確定"></form>
<form action=$cgiurl METHOD=POST><input type=hidden name=menu value=del3>
批量刪除 <INPUT name=day size=3 maxLength=3 value=100> 天沒有發表過貼子的用戶資料
<input type=submit value='確定'></form>
<a href=?menu=upmember onclick="return up_reset()">點擊更新用戶排行榜</a>
EOF
exit;
}
##########
sub chgusers{
open(NUMBER,"$filepath/data/ip");
$ip=<NUMBER>;
close(NUMBER);
($ip1,$ip2,$ip3,$ip4)=split(/\./,$ENV{'REMOTE_ADDR'});
$rfrom="$ip1.$ip2.*.*";
if($ip ne $rfrom){&errorview("對不起,您的IP地址不是 $ip 請重新上傳install.cgi文件,再運行install.cgi,系統才會自動設置IP地址");}
unlink("$filepath/yhzl/$selname.cgi");
unlink("$filepath/guest/1$selname.cgi");
unlink("$filepath/guest/2$selname.cgi");
unlink("$filepath/favorites/$selname.cgi");
unlink("$filepath/favorites/2$selname.cgi");
unlink("$filepath/favorites/3$selname.cgi");
unlink("$filepath/bank/$selname.cgi");
unlink("$filepath/friend/$selname.cgi");
unlink("$filepath/postlog/$selname.cgi");
unlink("$ImgDir/img/$selname.jpg");
unlink("$ImgDir/portrait/$selname.gif");
unlink("$filepath/article/$selname.cgi");
&csshtml;
print <<EOF;
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
已 經 成 功 刪 除 用 戶 $selname 的 所 有 資 料 !</font></b></td></tr></table><br>[ <a href="javascript:history.back()">返 回 </a>]
EOF
exit;
}
sub upmember{
open(TMP,">$filepath/data/fixtop");
close(TMP);
opendir (MEMBERDIR2, "$filepath/yhzl");
@lines = readdir(MEMBERDIR2);
closedir (MEMBERDIR2);
foreach $username1 (@lines){
$i++;
open(PSD,"$filepath/yhzl/$username1");
$lines=<PSD>;
close(PSD);
($rpassword,$rname,$rmail,$rhome,$rlast,$rqm,$rsex,$rwork,$rcity,$rlove,$rfy,$rhf)=split(/\t/,$lines);
$tol=$rfy+$rhf;
@string[$i]="$tol\t$username1\n";
}
@string=(reverse sort{$a<=>$b}@string);
open(PSD,">$filepath/data/usertop");
foreach(@string[0..19]){
$_=~s/\n//isg;
print PSD "$_\n";
}
close(PSD);
chmod(0666,"$filepath/data/usertop");
unlink("$filepath/data/fixtop");
&csshtml;
print <<EOF;
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
已經成功更新了用戶排行榜!</font></b></td></tr></table><br>[ <a href="javascript:history.back()">返 回 </a>]
EOF
exit;
}
##########
sub kills{
open(NUMBER,"$filepath/data/ip");
$ip=<NUMBER>;
close(NUMBER);
($ip1,$ip2,$ip3,$ip4)=split(/\./,$ENV{'REMOTE_ADDR'});
$rfrom="$ip1.$ip2.*.*";
if($ip ne $rfrom){&errorview("對不起,您的IP地址不是 $ip 請重新上傳install.cgi文件,再運行install.cgi,系統才會自動設置IP地址");}
open (GUEST,"$filepath/data/list.cgi");
@lines=<GUEST>;
close(GUEST);
open (GUEST,">$filepath/data/list.cgi");
foreach $usersays (@lines) {
chomp($usersays);
($index)=split(/\t/,$usersays);
if($selname ne $index){
print GUEST "$usersays\n";
}}
close(GUEST);
opendir (MEMBERDIR2, "$filepath/list/$selname");
@members2 = readdir(MEMBERDIR2);
closedir (MEMBERDIR2);
foreach $m (@members2){
unlink("$filepath/list/$selname/$m");
}
rmdir("$filepath/list/$selname");
unlink("$filepath/list/$selname.cgi");
&csshtml;
print <<EOF;
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
已 經 成 功 刪 除 此 論 壇 的 所 有 數 據 !</font></b></td></tr></table><br>[ <a href="javascript:history.back()">返 回 </a>]
EOF
exit;
}
sub fix{
chmod(0777,"$filepath/list/$selname/");
open(MEMBERDIR2,">$filepath/list/$selname/bbs");
close(MEMBERDIR2);
chmod(0666,"$filepath/list/$selname/bbs");
&csshtml;
print <<EOF;
<center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
已 經 成 功 修 復 此 論 壇 的 索 引 文 件 !</font></b></td></tr></table><br>[ <a href="javascript:history.back()">返 回 </a>]
EOF
exit;
}
##########
sub ckyh{
if ( -e "$filepath/yhzl/$username.cgi"){
open(PSD,"$filepath/yhzl/$username.cgi");
$line=<PSD>;
close(PSD);
($rdpassword,$username1,$mail1,$home1,$lasttime1,$qm1,$sex1,$work1,$city1,$love1,$rfy,$rhf,$tu,$jiao,$iewin,$QQ,$photo,$levelname,$level)=split(/\t/,$line);
$fy1=$rfy+0;
$hf1=$rhf+0;
$tol=$fy1+$hf1;
open(NUMBER,"$filepath/guest/2$username.cgi");
$NUMBER=<NUMBER>;
close(NUMBER);
($lys,$oldlys,$money,$charm)=split(/\t/,$NUMBER);
if($sex1 eq ""){$sex1="(不告訴您)"};
if($city1 eq ""){$city1="(不告訴您)"};
if($love1 eq ""){$love1="(不告訴您)"};
if($work1 eq ""){$work1="(不告訴您)"};
if(($home1 eq "http://")||($home1 eq "")){$home1="(不告訴您)"};
if($mail1 eq ""){$mail1="(不告訴您)"};
if($jiao eq ""){$jiao="這家伙很懶,什么都沒有留下。"};
$fy1=$rfy+0;
$hf1=$rhf+0;
$tol=$fy1+$hf1;
if (-e "$ImgDir/img/$username.jpg") {$ttt="$ImgurlDir/$photo.jpg"}else{$ttt="$imagurl/photo.gif"}
&csshtml;
print <<EOF;
<SCRIPT>
function del_reset(){
if (confirm("您確定要刪除該用戶的資料嗎?")){
return true;
}
return false;
}
</SCRIPT><center><table border=0 width=100% cellpadding=6><tr><td width=100% bgcolor=$bgcolor1 align=center><b><font color=FF6633>
用 戶 $username 的 資 料 !</font></b></td></tr></table><table border="0" width="100%">
<tr><td width="100%" colspan="2" align="center"><form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=menu value=chgusers><input type=submit onclick="return del_reset()" value=刪除此用戶的所有資料></form>
</td></tr></table><TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=90%>
<tr><TD height=36><TABLE border=0 cellPadding=0 cellSpacing=1 width=100%><TBODY><TR bgColor=eceef2>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -