Просмотр файла darkworld/adminka2/gm.php

Размер файла: 7.55Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
$ref=rand(100,10000000);

header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"GM-panel\">";
echo "<p align=\"left\">";

$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("../data/reg/$log.dat"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {

$u = explode(".",$login);

if($log=="$u[0].GM"){


switch($go) {

default:

echo"<small>&#x417;&#x434;&#x430;&#x440;&#x43E;&#x432;&#x430; GM!</small>";
echo"<small><br/><br/><a href=\"gm.php?log=$log&amp;pas=$pas&amp;go=profil\">&#x41F;&#x440;&#x43E;&#x444;&#x438;&#x43B;&#x44C; &#x438;&#x433;&#x440;&#x43E;&#x43A;&#x43E;&#x432;</a>";
echo"<br/><a href=\"backup.php?log=$log&amp;pas=$pas\">&#x421;&#x434;&#x435;&#x43B;&#x430;&#x442;&#x44C; BACKUP</a>";
echo"<br/><a href=\"priz.php?log=$log&amp;pas=$pas\">&#x41F;&#x43E;&#x434;&#x430;&#x440;&#x43A;&#x438;</a>";
echo"<br/><a href=\"chat.php?log=$log&amp;pas=$pas\">&#x427;&#x430;&#x442;</a>";
echo"<br/><a href=\"4istka.php?log=$log&amp;pas=$pas\">Удаление игроков с 0 лвл'ом</a>";
echo"<br/><a href=\"chatonoff.php?log=$log&amp;pas=$pas\">Чат on/off</a>";
echo"<br/><a href=\"alldelmsg.php?log=$log&amp;pas=$pas\">Чистка писем</a>";
echo"<br/><a href=\"new.php?log=$log&amp;pas=$pas\">Создать игрока</a>";
echo"<br/><a href=\"news.php?log=$log&amp;pas=$pas\">&#x41D;&#x43E;&#x432;&#x43E;&#x441;&#x442;&#x438;</a></small>";
break;

case 'profil':

echo "<small>&#x41B;&#x43E;&#x433;&#x438;&#x43D;:</small><br/>";
echo "<input name=\"loginn\" maxlength=\"10\" title=\"nick\"/><br/>";
echo "<small><anchor title=\"go\">OK<go href=\"gm.php?log=$log&amp;pas=$pas&amp;go=profiledit\" method=\"post\">";
echo "<postfield name=\"logi\" value=\"$(loginn)\"/>";
echo "</go></anchor></small><br/>";

break;

case 'profiledit':

$logi=$_POST['logi'];

$text = @file("../data/reg/$logi.dat"); 
$udata = explode(":||:",$text[0]);
$aden=trim($udata[8]);
$exp=trim($udata[19]);
$pol=trim($udata[2]);
$lvl=trim($udata[9]);
$sp=trim($udata[31]);
$lovk=trim($udata[3]);
$profa=trim($udata[33]);
$email=trim($udata[18]);
$met=trim($udata[4]);
$hp=trim($udata[16]);
$mp=trim($udata[29]);
$paty=trim($udata[25]);
$clan=trim($udata[23]);
$ignor=trim($udata[36]);
$klass=trim($udata[27]);
$rassa=trim($udata[26]);

echo "<small>&#x423;&#x440;&#x43E;&#x432;&#x435;&#x43D;&#x44C;:</small><br/>";
echo "<input name=\"lvl$ref\" maxlength=\"100\" value=\"$lvl\"/><br/>";
echo "<small>&#x414;&#x435;&#x43D;&#x44C;&#x433;&#x438;:</small><br/>";
echo "<input name=\"aden$ref\" maxlength=\"10\" value=\"$aden\"/><br/>";
echo "<small>&#x41E;&#x43F;&#x44B;&#x442;:</small><br/>";
echo "<input name=\"exp$ref\" maxlength=\"10\" value=\"$exp\"/><br/>";
echo "<small>SP:</small><br/>";
echo "<input name=\"sp$ref\" maxlength=\"100\" value=\"$sp\"/><br/>";
echo "<small>&#x41B;&#x43E;&#x432;&#x43A;&#x43E;&#x441;&#x442;&#x44C;:</small><br/>";
echo "<input name=\"lovk$ref\" maxlength=\"100\" value=\"$lovk\"/><br/>";
echo "<small>&#x41C;&#x435;&#x442;&#x43A;&#x43E;&#x441;&#x442;&#x44C;:</small><br/>";
echo "<input name=\"met$ref\" maxlength=\"100\" value=\"$met\"/><br/>";
echo "<small>HP:</small><br/>";
echo "<input name=\"hp$ref\" maxlength=\"100\" value=\"$hp\"/><br/>";
echo "<small>MP:</small><br/>";
echo "<input name=\"mp$ref\" maxlength=\"100\" value=\"$mp\"/><br/>";
echo "<small>Мыло:</small><br/>";
echo "<input name=\"email$ref\" maxlength=\"100\" value=\"$email\"/><br/>";
echo "<small>Профа:</small><br/>";
echo "<input name=\"profa$ref\" maxlength=\"100\" value=\"$profa\"/><br/>";
echo "<small>&#x41F;&#x430;&#x442;&#x438;:</small><br/>";
echo "<input name=\"paty$ref\" maxlength=\"100\" value=\"$paty\"/><br/>";
echo "<small>&#x41A;&#x43B;&#x430;&#x43D;:</small><br/>";
echo "<input name=\"clan$ref\" maxlength=\"100\" value=\"$clan\"/><br/>";
echo "<small>Пол (Ж,M(англ):</small><br/>";
echo "<input name=\"pol$ref\" maxlength=\"100\" value=\"$pol\"/><br/>";
echo "<small>Класс (wizard,fighert):</small><br/>";
echo "<input name=\"klass$ref\" maxlength=\"100\" value=\"$klass\"/><br/>";
echo "<small>Расса (elf,darkelf,gnom,human,orc):</small><br/>";
echo "<input name=\"rassa$ref\" maxlength=\"100\" value=\"$rassa\"/><br/>";

echo "<small><anchor title=\"go\">OK<go href=\"gm.php?log=$log&amp;pas=$pas&amp;go=profilsave\" method=\"post\">";
echo "<postfield name=\"lvl\" value=\"$(lvl$ref)\"/>";
echo "<postfield name=\"aden\" value=\"$(aden$ref)\"/>";
echo "<postfield name=\"exp\" value=\"$(exp$ref)\"/>";
echo "<postfield name=\"sp\" value=\"$(sp$ref)\"/>";
echo "<postfield name=\"login\" value=\"$logi\"/>";
echo "<postfield name=\"lovk\" value=\"$(lovk$ref)\"/>";
echo "<postfield name=\"met\" value=\"$(met$ref)\"/>";
echo "<postfield name=\"mp\" value=\"$(mp$ref)\"/>";
echo "<postfield name=\"hp\" value=\"$(hp$ref)\"/>";
echo "<postfield name=\"paty\" value=\"$(paty$ref)\"/>";
echo "<postfield name=\"clan\" value=\"$(clan$ref)\"/>";
echo "<postfield name=\"email\" value=\"$(email$ref)\"/>";
echo "<postfield name=\"profa\" value=\"$(profa$ref)\"/>";
echo "<postfield name=\"pol\" value=\"$(pol$ref)\"/>";
echo "<postfield name=\"klass\" value=\"$(klass$ref)\"/>";
echo "<postfield name=\"rassa\" value=\"$(rassa$ref)\"/>";
echo "</go></anchor></small><br/>";

break;

case 'profilsave':

$login=$_POST['login'];

$fal = @file("../data/reg/$login.dat"); 
$uda = explode(":||:",$fal[0]);

$uda[2]=$_POST['pol'];
$sp=$_POST['sp'];
$aden=$_POST['aden'];
$lvl=$_POST['lvl'];
$uda[19]=$_POST['exp'];
$uda[3]=$_POST['lovk'];
$uda[4]=$_POST['met'];
$uda[16]=$_POST['hp'];
$uda[29]=$_POST['mp'];
$uda[25]=$_POST['paty'];
$uda[23]=$_POST['clan'];
$uda[36]=$_POST['ignor'];
$uda[18]=$_POST['email'];
$uda[33]=$_POST['profa'];
$uda[27]=$_POST['klass'];
$uda[26]=$_POST['rassa'];

$t=$uda[0].':||:'.$uda[1].':||:'.$uda[2].':||:'.$uda[3].':||:'.$uda[4].':||:'.$uda[5].':||:'.$uda[6].':||:'.$uda[7].':||:'.$aden.':||:'.$lvl.':||:'.$uda[10].':||:'.$uda[11].':||:'.$uda[12].':||:'.$uda[13].':||:'.$uda[14].':||:'.$uda[15].':||:'.$uda[16].':||:'.$uda[17].':||:'.$uda[18].':||:'.$uda[19].':||:'.$uda[20].':||:'.$uda[21].':||:'.$uda[22].':||:'.$uda[23].':||:'.$uda[24].':||:'.$uda[25].':||:'.$uda[26].':||:'.$uda[27].':||:'.$uda[28].':||:'.$uda[29].':||:'.$uda[30].':||:'.$sp.':||:'.$uda[32].':||:'.$uda[33].':||:'.$uda[34].':||:'.$uda[35].':||:'.$uda[36].':||:'.$uda[37].':||:'.$uda[38].':||:'.$uda[39].':||:'.$uda[40].':||:';

$fp=fopen("../data/reg/$login.dat","w");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$t");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

echo"&#x41F;&#x440;&#x43E;&#x444;&#x438;&#x43B;&#x44C; &#x438;&#x437;&#x43C;&#x435;&#x43D;&#x435;&#x43D;!";

break;

}
}
}else{echo"<small>&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!</small>";}


echo "</p></card></wml>"; 

?>