<?php ignore_user_abort(True); require_once "../Config/_sqlconf.php"; //$srcfile = 'http://ftp.mountyhall.com/ftp/Public_Trolls.txt'; //$dstfile = 'ftp/Public_Trolls.txt'; //if (!copy($srcfile, $dstfile)) echo "La copie $file du fichier a échoué...\n"; //** Public_Diplomatie.txt ** //Id ; Nom ; Race ; Niveau ; Nb de Kills ; Nb de Morts ; Id Guilde ; Nb de Mouches #----------------------------------------------------------------------------------- $mysql = _sqlconnect(); # -------------- Ouverture DB $query = "SELECT Value as troll_update from MZ_Cron where Field='troll_update'"; //echo "$query<BR>"; $result = @MySQL_QUERY($query); if (@MySQL_NUM_ROWS($result) != 1) { die(-1); } $troll_update = mysql_result($result, 0, "troll_update"); $today = date("Y-m-d"); //============================================================================== if ($troll_update != $today) { // télécharger le nouveau fichier if ($_FOPEN_EXTERNAL) { // si pas d'accès externe, on suppose le fichier copié dans repertoire ftp par script externe $fds = @fopen("http://ftp.mountyhall.com/Public_Trolls.txt", "r"); } else { $fds = @fopen("ftp/Public_Trolls.txt", "r"); } if ($fds) { $query = "UPDATE MZ_Cron set Value='0' WHERE Field='troll_step'";
//============================================================================== $_SESSION['login']=""; // on ferme la session courante si elle était ouverte If (!isset($ZZ_TID)) { Die("Erreur accès à ZoryaZilla: Mauvais identifiant Troll!"); } If (!isset($ZZ_PWD)) { Die("Erreur accès à ZoryaZilla: Mauvais password"); } $TiD=$ZZ_TID; if ($action=="Autologout") { print("Password de <i><b>$TiD</b></i> effacé de Firefox!!"); print("<FORM name=FormDlgBox><INPUT TYPE=hidden Name=ZZSession Value=\"\"></FORM>"); die(); } $mysql=_sqlconnect(); # -------------- Ouverture DB if ((strlen($ZZ_PWD)<30) && (strlen($ZZ_PWD)>0)) $ZZ_PWD=md5("$ZZ_PWD"); $query = "SELECT TiD FROM `MZ_User` where (TiD=$TiD) and (Pwd='$ZZ_PWD')"; #echo "$query<BR>"; $result = MySQL_QUERY($query); $nData = @MySQL_NUM_ROWS($result); if ($nData>0) { #autologon ZZ interface $_SESSION['login']=$TiD; } else $TiD=0; $query = "SELECT Troll FROM `MZ_Trolls` where (TiD=$TiD)"; #echo "$query<BR>"; $result = MySQL_QUERY($query); $nData = @MySQL_NUM_ROWS($result); if ($nData>0) { #autologon ZZ interface
function _sqllogTiD($TiD, $Comment) { global $SQL_SI_TiDViewList; $mysql=_sqlconnect(); # -------------- Ouverture DB $TimeStamp=date("Y-m-d H:i:s"); $DateStamp=date("Y-m-d"); if (array_key_exists ("HTTP_CLIENT_IP", $_SERVER) && $_SERVER["HTTP_CLIENT_IP"]!="") $ipaddr=mysql_real_escape_string($_SERVER["HTTP_CLIENT_IP"]); // en cas de proxy. else if ($_SERVER["HTTP_X_FORWARDED_FOR"]!="") $ipaddr=mysql_real_escape_string($_SERVER["HTTP_X_FORWARDED_FOR"]); // en cas de proxy. else $ipaddr=mysql_real_escape_string($_SERVER["REMOTE_ADDR"]); $arr_tid=explode(",", $SQL_SI_TiDViewList); for ($i=1; $i<sizeof($arr_tid); $i++) { $query = "REPLACE INTO `MZ_Log` values(".$arr_tid[$i].", '$DateStamp', '$TimeStamp', $TiD, '$ipaddr', '$Comment')"; //echo "$query<br>"; $result = @MySQL_QUERY($query); } _sqlclose(); # -------------- Fermeture DB }