?? login.cgi
字號:
#!/usr/bin/perl
#$path = "."; #這是unix下的配置
$path = &deenpath; #這是win nt iis下的所用的配置 k666軟件園 http://www.vv66.net
# 打開配置文件與公用模塊
do "$path/config.cgi";
do "$path/public.cgi";
&get_form;
&set_var;
if ($job eq "" ) { do "$path/loghtml.cgi" ; &login_html; } #第一種登錄頁面
if ($job eq "page2" ) { do "$path/loghtml.cgi" ; &login_html2; } #第二種登錄頁面
elsif ($job eq "chatgg") { do "$path/chatgg.cgi"; &chat_gg; }
elsif ($job eq "disp_line") { do "$path/write_online.cgi" ; do "$path/logline.cgi" ; &disp_line; }
elsif ($job eq "online") { do "$path/write_online.cgi" ; do "$path/logline.cgi" ; &disp_line2; }
elsif ($job eq "login") {
&checkempty($username,"沒有用戶名"); #檢查用戶名是否為空
&checkempty($usersex ,"沒有用戶性別") if ($usersexmust==1); # 檢查用戶性別是否為空
if (length($username) > 10) {&error("用戶名不能超過10個字符");}
do "$path/logpass.cgi" ; &chpass; #檢查用戶密碼
&checkbekill(); #檢查用戶是否是被踢出去的人
$exist = "no" ;
do "$path/write_online.cgi";
&write_online("line");
&write_online("online");
&write_online("kill","$username","$chktype") if ($chktype eq "2");
do "$path/write_message.cgi" ;
&write_message("login") if ($exist eq "no");
do "$path/build.cgi" ;
&return_whole; }
elsif ($job eq "logout") {
$linefile = "$linehead$username";
&error("您已經(jīng)脫機(jī),請重新登錄") if (not -e $linefile );
&checkbekill();
&check_password; #檢查用戶密碼是否正確
do "$path/logout.cgi" ;
$tem_userout = ""; #初始化退出提示
&write_exec if ( $chkpass == 3 ); #將用戶的經(jīng)驗值寫入
$exist ="no";
do "$path/write_online.cgi";
&write_online("outline");
do "$path/write_message.cgi" ;
&write_message("logout") if ($exist ne "no");
&return_logout; }
elsif ($job eq "savepoint") {
$linefile = "$linehead$username";
&error("您已經(jīng)脫機(jī),請重新登錄") if (not -e $linefile );
&checkbekill();
&check_password; #檢查用戶密碼是否正確
do "$path/logout.cgi" ;
&write_exec if ( $chkpass == 3 ) ; #將用戶的經(jīng)驗值寫入
&success("你當(dāng)前的經(jīng)驗 <font color=9933CC>$tem_exec</font>"); }
elsif ($job eq "settype") {
$linefile = "$linehead$username";
&error("您已經(jīng)脫機(jī),請重新登錄") if (not -e $linefile );
&check_password;
do "$path/build.cgi";
&return_type; }
elsif ($job eq "setfunc") {
$linefile = "$linehead$username";
&error("您已經(jīng)脫機(jī),請重新登錄") if (not -e $linefile );
&check_password;
do "$path/build.cgi" ;
&return_func; }
elsif ($job eq "setfresh") {
&check_password;
do "$path/build.cgi" ;
&setfresh; }
elsif ($job eq "div") { #分屏與合屏
&check_password;
$sflag = &get_var('sflag' ,'\n|‖');
do "$path/write_online.cgi";
&write_online("div");
print "<html><head></head><body></body></html>\n"; }
exit;
#############################################
#檢查用戶是否是被踢出去的人
#############################################
sub checkbekill {
@bekill=&readtxtfile($killfile,2);
$chkbekill = 0;
$chktype = 0;
$temuserip = &getip($userip);
foreach (@bekill) {
($mark,$bekill_host,$bekill_name,$bekill_level,$bekill_sex,$bekill_type,$bekill_ip,$kill_time,$killer,$markend)=split(/‖/,$_);
$killid = 0;
if (($mark eq "killdata") && ($markend eq "end")) {
if (($bekill_ip == 1)&&($bekill_name eq $username)) { $killid = 1; } #指定的用戶
if (($bekill_ip == 2)&&($bekill_host eq $userip)) { $killid = 1; } #指定的IP
if ($bekill_ip == 3) { #IP的前兩位
$killtemuserip = &getip($bekill_host);
$killid = 1 if ($temuserip eq $killtemuserip); }
if ($killid == 1 ) {
if ( ($secn - $kill_time - $kick_out_time * 60 ) < 0 ) {
$chkbekill = 1;
$chktype = $bekill_type;
last; }
}
}
}
if ( $chkbekill== 1 ) { do "$path/bekill.cgi"; &kill_htm($chktype); } #如果被踢
}
sub deenpath {
local $filename,$mypath;
$filename=__FILE__;
if ($filename=~/\\/) { $filename=~ s/\\/\//g;}
if ($filename) { $mypath=substr($filename,0,rindex($filename,"/")); }
else { $mypath=substr($ENV{'PATH_TRANSLATED'},0,rindex($ENV{'PATH_TRANSLATED'},"\\")); $mypath=~ s/\\/\//g; }
return $mypath; }
sub getip { #取前兩組IP數(shù)字
local $temip,$returnip,$position1,$position2;
$temip = $_[0];
$position1 = index ($temip, ".");
$returnip = substr ($temip, 0, $position1);
$position2 = index ($temip, ".",$position1);
$returnip .= substr ($temip, $position1,$position2);
return $returnip; }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -