Просмотр файла kick.php

Размер файла: 9.27Kb
<?
header("Cache-Control: no-cache");
header("Content-type:text/vnd.wap.wml");  
$ref=rand(10000,1000000);
require("inc.php");
$link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
                or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">Can not connect to MySQL</p>
</card>
</wml>");
     
     @mysql_select_db($MySQLDatabasename) or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">error select the database...</p>
</card>
</wml>");
         
        $result = @mysql_query ("Select * from mafusers where id='".$id."'");
         
         if (mysql_affected_rows() == 0) {
          echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "User was not found\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
                
$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "Your login failed\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);   
exit;
}       


if($row["level"] < 4)
{
          echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"error\">\n";
echo "<p align=\"center\">\n";
echo "У вас нет прав доступа!\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit;
} 
$us=$row["user"];  

   
        if(isset($nk)){ 
        $select = @mysql_query ("Select * from mafusers where id='".$nk."'");
        } else {
                         function rus_to_k($str){
                $str = str_replace("Р°","a",$str); 
                $str = str_replace("Р±","b",$str);
                $str = str_replace("РІ","v",$str);
                $str = str_replace("Рі","g",$str);
                $str = str_replace("Рґ","d",$str);
                $str = str_replace("Рµ","e",$str); 
                $str = str_replace("С‘","e",$str); 
                $str = str_replace("Р¶","j",$str);
                $str = str_replace("Р·","z",$str);
                $str = str_replace("Рё","i",$str);
                $str = str_replace("Р№","y",$str);
                $str = str_replace("Рє","k",$str);
                $str = str_replace("Р»","l",$str); 
                $str = str_replace("Рј","m",$str);
                $str = str_replace("РЅ","n",$str);
                $str = str_replace("Рѕ","o",$str);
                $str = str_replace("Рї","p",$str);
                $str = str_replace("СЂ","r",$str);
                $str = str_replace("СЃ","s",$str); 
                $str = str_replace("С‚","t",$str);
                $str = str_replace("Сѓ","u",$str);
                $str = str_replace("С„","f",$str);
                $str = str_replace("С…","h",$str);
                $str = str_replace("С‡","c",$str);
                $str = str_replace("С†","q",$str);//ч 
                $str = str_replace("С€","w",$str);
                $str = str_replace("С‰",">",$str);//щ
                $str = str_replace("СЊ","<",$str);//ъ
                $str = str_replace("С‹","x",$str);//ы
                $str = str_replace("СЉ",".",$str);//ь
                $str = str_replace("СЌ",":",$str);//э 
                $str = str_replace("СЋ",";",$str);//ю
                $str = str_replace("СЏ","}",$str);//я
                $str = str_replace("Рђ","a",$str);
                $str = str_replace("Р‘","b",$str);
                $str = str_replace("Р’","v",$str);
                $str = str_replace("Р“","g",$str); 
                $str = str_replace("Р”","d",$str);
                $str = str_replace("Р•","e",$str);
                $str = str_replace("РЃ","e",$str);
                $str = str_replace("Р–","j",$str);
                $str = str_replace("Р—","z",$str);
                $str = str_replace("Р?","i",$str); 
                $str = str_replace("Р™","y",$str);
                $str = str_replace("Рљ","k",$str);
                $str = str_replace("Р›","l",$str);
                $str = str_replace("Рњ","m",$str);
                $str = str_replace("Рќ","n",$str);
                $str = str_replace("Рћ","o",$str); 
                $str = str_replace("Рџ","p",$str);
                $str = str_replace("Р ","r",$str);
                $str = str_replace("РЎ","s",$str);
                $str = str_replace("Рў","t",$str);
                $str = str_replace("РЈ","u",$str);
                $str = str_replace("Р¤","f",$str);
                $str = str_replace("РҐ","h",$str);
                $str = str_replace("Р§","c",$str);
                $str = str_replace("Р¦","q",$str);
                $str = str_replace("РЁ","w",$str); 
                $str = str_replace("Р©",">",$str);
                $str = str_replace("Р¬","<",$str);
                $str = str_replace("Р«","x",$str);
                $str = str_replace("РЄ",".",$str);
                $str = str_replace("Р­",":",$str);
                $str = str_replace("Р®",";",$str);
                $str = str_replace("РЇ","}",$str);
                return $str;
                }
        
$nick=trim($nick);       
if($nick=="")$nick=0;          
    $latuser=strtolower($nick);
    $ruser = rus_to_k($nick);
    if($ruser==$nick){
   $select = mysql_query ("Select * from mafusers where latuser = '".$latuser."'"); 
    } else {
   $select = mysql_query ("select * from mafusers where ruser = '".$ruser."'");
    }
    }
if (mysql_affected_rows() == 0) {
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";

echo "<card id=\"error\" title=\"error\" ontimer=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\"><timer value=\"10\" />\n";

echo "<p align=\"center\">\n";
echo "Нет такого юзера\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit;
}
$inf = mysql_fetch_array ($select); 
$pid = $inf["id"];
$level = $inf["level"];
$pnik = $inf["user"];
if(!@$go)
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"vypnut\" title=\"Пнуть\" >\n";
echo "<p>";    
echo "РљРѕРіРѕ<br/>\n";
echo "<input name=\"nick$ref\" maxlength=\"15\" value=\"$pnik\" title=\"pnut\"/><br/>\n"; 
echo "На сколько (мин)<br/>\n";
echo "<input name=\"wtime$ref\" maxlength=\"2\" title=\"vremya\" format=\"*N\"/><br/>\n";
echo "За что:<br/>\n";
echo "<input name=\"whykik$ref\" maxlength=\"200\" title=\"whykik\"/><br/>\n";
echo "<anchor title=\"go\">Пнуть засранца<go href=\"kick.php?go=pni&amp;id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\" method=\"post\">\n";
echo "<postfield name=\"nick\" value=\"$(nick$ref)\"/>\n";  
echo "<postfield name=\"wtime\" value=\"$(wtime$ref)\"/>\n";  
echo "<postfield name=\"whykik\" value=\"$(whykik$ref)\"/>\n";
echo "</go></anchor><br/><br/>\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit; 
}

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";

echo "<card id=\"Ok\" title=\"Ok\" ontimer=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\"><timer value=\"10\" />\n";

echo "<p align=\"center\">\n";                                                
if($level<$row["level"]){
echo "$pnik успешно выпнут!!<br/>\n";
$wtime = $wtime * 60 + time();
mysql_query ("UPDATE mafusers SET kik = '".$wtime."', whokik = '".$us."', whykik = '".$whykik."' WHERE id = '".$pid."'");  
@$fi = fopen("pinlist.dat", "a+"); 
$dat = date ("(H:i)d F");
$lst = "$pnik was pushed out by $us $dat because: $whykik. His IP: $REMOTE_ADDR, his soft: $HTTP_USER_AGENT";
@fwrite($fi, "$lst\n");
@fflush($fi);
@fclose($fi);    
} else { 
if($level==4)$sts="VIPa";
if($level==5)$sts="Киллера";
if($level==6)$sts="Старшего модера";
if($level==7)$sts="РђРґРјРёРЅР°";
echo "С ума сошли $sts пинать!? $pnik вам это припомнит!\n";
}
mysql_close ($link);
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
?>