Version 1.9a

This commit is contained in:
nemunaire 2008-09-20 12:00:00 +02:00
commit d028822d0b
437 changed files with 27543 additions and 81793 deletions

View file

@ -1 +1 @@
../onyx/
C:/Program Files/xampp/var/HB_new/onyx/

View file

@ -24,7 +24,7 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
$chapeau->connexion();
//Passage des valeurs générales au template
$template->assign('version', VERSION);
$titre = "Administration";
$template->assign('page','admin');
$chapeau->unique_query("SELECT * FROM $table_user WHERE race = 'covenant'");
@ -49,23 +49,25 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
if (!isset($_GET['p'])) $_GET['p'] = '';
if ($sess->values['auth_level'] >= 5) {
switch($_GET['p']){
case 'djoueurs': include(_FCORE."hb_game/jeu/admin/supprimer_joueur.php"); break;
case 'bandeau': include(_FCORE."hb_game/jeu/admin/bandeau.php"); break;
case 'version': include(_FCORE."hb_game/jeu/admin/version.php"); break;
case 'djoueurs': include(_FCORE."../game/jeu/admin/supprimer_joueur.php"); break;
case 'bandeau': include(_FCORE."../game/jeu/admin/bandeau.php"); break;
case 'demarrage': include(_FCORE."../game/jeu/admin/demarrage.php"); break;
case 'version': include(_FCORE."../game/jeu/admin/version.php"); break;
case 'inscription': include(_FCORE."../game/jeu/admin/inscription.php"); break;
}
}
if (empty($pagea)) {
switch($_GET['p']){
case 'courrier': include(_FCORE."hb_game/jeu/admin/mail.php"); break;
case 'vip': include(_FCORE."hb_game/jeu/admin/ip.php"); break;
case 'vflotte': include(_FCORE."hb_game/jeu/admin/flottes.php"); break;
case 'vplanetes': include(_FCORE."hb_game/jeu/admin/planete.php"); break;
case 'vjoueurs': include(_FCORE."hb_game/jeu/admin/joueur.php"); break;
case 'valliances': include(_FCORE."hb_game/jeu/admin/alliance.php"); break;
case 'vrapports': include(_FCORE."hb_game/jeu/admin/rapport.php"); break;
case 'sjoueurs': include(_FCORE."hb_game/jeu/admin/sanction_joueur.php"); break;
case 'cjoueurs': include(_FCORE."hb_game/jeu/admin/prendre_controle.php"); break;
default: $pagea = 'vp';;
case 'courrier': include(_FCORE."../game/jeu/admin/mail.php"); break;
case 'vip': include(_FCORE."../game/jeu/admin/ip.php"); break;
case 'vflotte': include(_FCORE."../game/jeu/admin/flottes.php"); break;
case 'vplanetes': include(_FCORE."../game/jeu/admin/planete.php"); break;
case 'vjoueurs': include(_FCORE."../game/jeu/admin/joueur.php"); break;
case 'valliances': include(_FCORE."../game/jeu/admin/alliance.php"); break;
case 'vrapports': include(_FCORE."../game/jeu/admin/rapport.php"); break;
case 'sjoueurs': include(_FCORE."../game/jeu/admin/sanction_joueur.php"); break;
case 'cjoueurs': include(_FCORE."../game/jeu/admin/prendre_controle.php"); break;
default: include(_FCORE."../game/jeu/admin/accueil.php"); break;
}
}

View file

@ -8,53 +8,76 @@ require_once(_FCORE."common.php");
if (isset($sess) && isset($sess->values['connected']) && $sess->values['connected'] && !empty($sess->values['id']) && isset($sess->values['auth_level']) && !empty($sess->values['idPlan'])) {
$json = new Services_JSON();
$nbtrajet = 2;
if (empty($config['flottes']) && $sess->values['auth_level'] == 0) {
$datas = array(
'root' => array(
'destination' => '<input class="dest" type="text" id="amas" name="amas" maxlength="2" value="'.gpc('galaxie', 'post').'" />:<input class="dest" type="text" id="ss" name="ss" maxlength="2" value="'.gpc('ss', 'post').'" />:<input class="dest" type="text" id="plan" name="pos" maxlength="2" value="'.gpc('pos', 'post').'" />',
'temps' => '-',
'deblok' => '<span style="color: #FF0000;"><b>Les flottes sont désactivés pour le moment.</b></span>',
'conso' => '-',
'tactique' => ''
'tactique' => '',
'places' => ''
)
);
header("X-JSON: ".$json->encode($datas));
exit;
}
$destin = gpc('fav_dest', 'post');
$chapeau = new bdd();
$chapeau->connexion();
$idPlan = $sess->values['idPlan'];
$queryPlanete = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
if (!empty($destin)) {
$chapeau->escape($destin);
$queryPlaneteRapid = $chapeau->unique_query("SELECT nom_planete, galaxie, ss, position FROM $table_planete WHERE id = $destin;");
if ($queryPlaneteRapid) $destinRapid = '['.$queryPlaneteRapid['galaxie'].':'.$queryPlaneteRapid['ss'].':'.$queryPlaneteRapid['position'].']<input type="hidden" id="amas" name="amas" maxlength="2" value="'.$queryPlaneteRapid['galaxie'].'" /><input type="hidden" id="ss" name="ss" maxlength="2" value="'.$queryPlaneteRapid['ss'].'" /><input type="hidden" id="plan" name="pos" maxlength="2" value="'.$queryPlaneteRapid['position'].'" />';
}
if (!isset($destinRapid)) $destinRapid = '<input class="dest" type="text" id="amas" name="amas" maxlength="2" value="'.gpc('galaxie', 'post').'" />:<input class="dest" type="text" id="ss" name="ss" maxlength="2" value="'.gpc('ss', 'post').'" />:<input class="dest" type="text" id="plan" name="pos" maxlength="2" value="'.gpc('pos', 'post').'" />';
$start_galaxie = $queryPlanete['galaxie'];
$start_ss = $queryPlanete['ss'];
$start_position = $queryPlanete['position'];
$met = gpc('met', 'post');
$cri = gpc('cri', 'post');
$hyd = gpc('hyd', 'post');
if (!empty($sess->values['flcontenu']) && $met+$cri+$hyd >= 0 && $met >= 0 && $cri >= 0 && $hyd >= 0) $places = $sess->values['flcontenu'] - ($met+$cri+$hyd);
else $places = 'inconnu';
if (empty($sess->values['fltime']) || $sess->values['fltime'] + 600 < time() || empty($sess->values['flnbvais']) || empty($sess->values['flvitesse']) && isset($sess->values['auth_level']))
$datas = array(
'root' => array(
'destination' => $destinRapid,
'temps' => '-',
'deblok' => '<b>Une erreur est survenue lors de la création de la flotte. Veuillez recommencer</b>',
'conso' => '-',
'tactique' => ''
'tactique' => '',
'places' => separerNombres($places)
)
);
elseif (empty($_POST['nom']) || preg_replace('@[^a-zA-Z0-9_ ]@i', '', $_POST['nom']) != $_POST['nom'])
$datas = array(
'root' => array(
'destination' => $destinRapid,
'temps' => '-',
'deblok' => '<b>Nom de la flotte incorrect !</b>',
'conso' => '-',
'tactique' => ''
'tactique' => '',
'places' => separerNombres($places)
)
);
elseif ($_POST['galaxie'] > MAX_AMAS || $_POST['ss'] > MAX_SYSTEME || $_POST['pos'] > MAX_PLANETE || $_POST['galaxie'] < 0 || $_POST['ss'] < 1 || $_POST['pos'] < 1 || ($_POST['galaxie'] < 1 && $sess->values['auth_level'] < 6))
$datas = array(
'root' => array(
'destination' => $destinRapid,
'temps' => '<span style="color: #FF0000;"><b>Lieu inaccessible</b></span>',
'deblok' => '<b>Corrigez la destination !</b>',
'conso' => '-',
'tactique' => ''
'tactique' => '',
'places' => separerNombres($places)
)
);
else {
@ -62,9 +85,10 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
$temps = vais_tempsDeplacement($start_galaxie,$start_ss,$start_position,$_POST['galaxie'],$_POST['ss'],$_POST['pos'],$sess->values['flvitesse'],$_POST['vitesse'],$sess->values['flpreparation'],$sess->values['flchauffe']);
if ($temps <= 0) $temps = 454;
$conso = vais_conso($temps, $sess->values['flnbvais'])*$_POST['vitesse']/45;
$places -= ceil($conso*$nbtrajet);
$tactique = '';
if ($_POST['mission'] == '1') {
$tactique = ' utiliser la tactique : <select name="tactique">';
$tactique = '<label for="selecttactique">Tactique d\'attaque :</label><select id="selecttactique" name="tactique">';
//On récupère le niveau actuel de la technologie Commandement militaire
$id_user = $sess->values['id'];
$table = $config['db_prefix'].'user';
@ -75,10 +99,12 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
if ($lvltechno < 1) { //Si on a pas le niveau, on ne peux pas envoyer la flotte
$datas = array(
'root' => array(
'destination' => $destinRapid,
'temps' => affTemp(floor($temps)),
'deblok' => '<b>Vous ne pouvez pas attaquer sans un minimum de connaissances militaires !</b>',
'conso' => separerNombres(ceil($conso*$nbtrajet)),
'tactique' => ''
'tactique' => '',
'places' => separerNombres($places)
)
);
header("X-JSON: ".$json->encode($datas));
@ -90,17 +116,19 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
else $tactique .= '<option value="'.$i.'">'.txtTactique($i).'</option>';
}
}
$tactique .= '</select>';
$tactique .= '</select><br />';
}
$cds = sha1('flotte'.$conso.'ß10'.time().'|HB;'.rand(10,99).$temps);
$sess->values['flcds'] = $cds;
$sess->put();
$datas = array(
'root' => array(
'destination' => $destinRapid,
'temps' => affTemp(floor($temps)),
'deblok' => '<input type="hidden" name="cds" value="'.$cds.'" /><input type="submit" value="GO" class="submit" />',
'conso' => separerNombres(ceil($conso*2)),
'tactique' => $tactique
'tactique' => $tactique,
'places' => separerNombres($places)
)
);
}

77
htdocs/captcha/index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -1,355 +0,0 @@
<?php
if(!defined('INDEX')) define('INDEX', 1);
print 'Début de la génération du classement ; il est : '.date('d/m/Y H:i:s');
set_time_limit(0);
ignore_user_abort(true);
$onyx = @file_get_contents('./../.onyx') or die("Configuration introuvable.");
define("_FCORE",'../'.trim($onyx));
require_once(_FCORE."kernel.php");
require_once(_FCORE."hb_game/tables.php");
require_once(_FCORE."hb_game/vars.php");
$bdd = new bdd();
/*
//Classement Joueurs
$bdd->connexion();
$bdd->query("TRUNCATE TABLE $table_classement;");
$users = $bdd->query("SELECT * FROM $table_user;");
$bdd->deconnexion();
$cnt = $bdd->num_rows;
for($i = 0; $i < $cnt; $i++){
$id_user = $users[$i]['id'];
$queryUser = $users[$i];
$pointsbat = 0;
$pointsterr = 0;
$pointsvais = 0;
$bdd->connexion();
$planetes = $bdd->query("SELECT * FROM $table_planete WHERE id_user = $id_user;");
$bdd->deconnexion();
$cntp = $bdd->num_rows;
for($j = 0; $j < $cntp; $j++){
$queryPlanete = $planetes[$j];
$nbbat = count($batimentVAR);
for($k = 0; $k < $nbbat; $k++){
if ($queryPlanete[$batimentVAR[$k]] == 0) continue;
else {
$n = $queryPlanete[$batimentVAR[$k]];
eval($batimentCALC[$k][0]);
eval($batimentCALC[$k][1]);
eval($batimentCALC[$k][2]);
$pointsbat += $a + $b + $c;
}
}
$nbterr = count($nomterrnVAR);
for($k = 0; $k < $nbterr; $k++){
if ($queryPlanete[$nomterrnVAR[$k]] == 0) continue;
else {
$n = $queryPlanete[$nomterrnVAR[$k]];
$pointsterr += $nomterrnCALC[$k][0] + $nomterrnCALC[$k][1] + $nomterrnCALC[$k][2];
}
}
$nbvais = count($nomvaisnVAR);
for($k = 0; $k < $nbvais; $k++){
if ($queryPlanete[$nomvaisnVAR[$k]] == 0) continue;
else {
$n = $queryPlanete[$nomvaisnVAR[$k]];
$pointsvais += $nomvaisnCALC[$k][0] + $nomvaisnCALC[$k][1] + $nomvaisnCALC[$k][2];
}
}
}
$nbtech = count($technoloVAR);
$pointstech = 0;
for($k = 0; $k < $nbtech; $k++){
if ($queryUser[$technoloVAR[$k]] == 0) continue;
else {
$n = $queryUser[$technoloVAR[$k]];
eval($technoloCALC[$k][0]);
eval($technoloCALC[$k][1]);
eval($technoloCALC[$k][2]);
$pointstech += $a + $b + $c;
}
}
$pointstech /= 1000;
$pointsvais /= 1000;
$pointsterr /= 1000;
$pointsbat /= 1000;
$points = $pointsbat + $pointsterr + $pointsvais + $pointstech;
$bdd->connexion();
$bdd->query("UPDATE $table_user SET points = $points, batiments = $pointsbat, recherches = $pointstech, flotte = $pointsvais, terrestre = $pointsterr WHERE id = $id_user;");
if ($queryUser['auth_level'] < 2 && $queryUser['mv'] < 2) $bdd->query("INSERT INTO $table_classement (id_user, points, flottes, terrestres, recherches, batiments) VALUES ($id_user, $points, $pointsvais, $pointsterr, $pointstech, $pointsbat);");
$bdd->deconnexion();
}
$bdd->connexion();
$classement = $bdd->query("SELECT U.id, U.auth_level FROM $table_classement C INNER JOIN $table_user U ON C.id_user = U.id ORDER BY C.points DESC;");
$cnt = $bdd->num_rows;
$p = 0;
for($i = 0; $i < $cnt; $i++){
if ($classement[$i]['auth_level'] < 2) {
$p++;
$bdd->query("UPDATE $table_user SET place_points = $p WHERE id = ".$classement[$i]['id']);
}
else $bdd->query("UPDATE $table_user SET place_points = 0 WHERE id = ".$classement[$i]['id']);
}
$bdd->deconnexion();
*/
print '<br />Fin de la génération du classement joueur ; il est : '.date('d/m/Y H:i:s');
//Classement Alliances
$bdd->connexion();
$bdd->query("TRUNCATE TABLE $table_classement_alliances;");
$alliances = $bdd->query("SELECT U.id_alliance, SUM(U.id) AS nombre, SUM(U.points)/SUM(U.id) AS points, SUM(U.batiments)/SUM(U.id) AS batiments, SUM(U.recherches)/SUM(U.id) AS recherches, SUM(U.flotte)/SUM(U.id) AS flotte, SUM(U.terrestre)/SUM(U.id) AS terrestre FROM $table_user U GROUP BY U.id_alliance;");
$cnt = $bdd->num_rows;
for($i = 0; $i < $cnt; $i++){
if ($alliances[$i]['id_alliance'] != 0) $bdd->query("INSERT INTO $table_classement_alliances (id_alliance, nbr_membres, points, batiments, recherches, flottes, terrestres) VALUES (".$alliances[$i]['id_alliance'].", ".$alliances[$i]['nombre'].", ".$alliances[$i]['points'].", ".$alliances[$i]['batiments'].", ".$alliances[$i]['recherches'].", ".$alliances[$i]['flotte'].", ".$alliances[$i]['terrestre'].");");
}
$bdd->deconnexion();
print '<br />Fin de la génération du classement ; il est : '.date('d/m/Y H:i:s');
exit;
//Script by Keiran
print 'Il est : '.date('d/m/Y H:i:s');
set_time_limit(0);
ignore_user_abort(true);
$onyx = @file_get_contents('./../.onyx') or die("Configuration introuvable.");
define("_FCORE",'../'.trim($onyx));
require(_FCORE."common.php");
include(_FCORE."hb_game/classement/fonctions.php");
$chapeau = new bdd();
$chapeau->connexion();
$chapeau->db();
##################################################
#MAJ classement Joueurs
##################################################
mysql_query("TRUNCATE TABLE `classement`");
$sql_1 = mysql_query("SELECT * FROM `user`");
while($recup_id = mysql_fetch_array($sql_1)) {
$id = $recup_id['id'];
$PSEUDO_USER = $recup_id['pseudo'];
$race = $recup_id['race'];
$planete = mysql_query("SELECT * FROM `planete` WHERE `id_user` = " . $id)or die( mysql_error() );
while ($donnees_planete = mysql_fetch_array($planete)) {
// partie pts batiements ressources
$POINTS_BATIMENTS += batiment1($donnees_planete['mine_m'] ) + batiment2( $donnees_planete['mine_c'] ) + batiment3( $donnees_planete['mine_h'] ) + batiment4( $donnees_planete['centrale_s'] ) + batiment5( $donnees_planete['centrale_f'] ) + batiment6( $donnees_planete['radar'] ) + batiment7( $donnees_planete['labo'] ) + batiment8( $donnees_planete['chantier_terrestre'] ) + batiment9( $donnees_planete['chantier_spatial'] ) /* + batiment10( $donnees_planete['caserne'] )*/ + batiment11( $donnees_planete['silo'] ) + batiment11( $donnees_planete['centre_info'] );
// partie pts def ressources
$metal_d += 500 * $donnees_planete['def_1'];
$cristal_d += 200 * $donnees_planete['def_1'];
$metal_d += 4000 * $donnees_planete['def_2'];
$cristal_d += 2000 * $donnees_planete['def_2'];
$metal_d += 4500 * $donnees_planete['def_3'];
$cristal_d += 800 * $donnees_planete['def_3'];
$hydrogene_d += 600 * $donnees_planete['def_3'];
$metal_d += 12000 * $donnees_planete['def_4'];
$cristal_d += 10000 * $donnees_planete['def_4'];
$hydrogene_d += 1000 * $donnees_planete['def_4'];
$metal_d += 15000 * $donnees_planete['def_5'];
$cristal_d += 9500 * $donnees_planete['def_5'];
$hydrogene_d += 1500 * $donnees_planete['def_5'];
// partie pts vaiseaux
$POINTS_VAISSEAUX += $donnees_planete['vaisseau_1'] + $donnees_planete['vaisseau_2'] + $donnees_planete['vaisseau_3'] + $donnees_planete['vaisseau_4'] + $donnees_planete['vaisseau_5'] + $donnees_planete['vaisseau_6'] + $donnees_planete['vaisseau_7'] + $donnees_planete['vaisseau_8'] + $donnees_planete['vaisseau_9'] + $donnees_planete['vaisseau_10'] + $donnees_planete['vaisseau_11']+ $donnees_planete['vaisseau_12'];
// partie pts vaiseaux ressources
// 'cargos de classe Parabola', 1
$metal += ( $donnees_planete['vaisseau_1'] * 1000 );
$cristal += ( $donnees_planete['vaisseau_1'] * 800 );
// 'cargos de classe Laden', 2
$metal += ( $donnees_planete['vaisseau_2'] * 4000 );
$cristal += ( $donnees_planete['vaisseau_2'] * 3000 );
// 'vaisseau(X) de colonisation de classe Odyssey', 3
$metal += ( $donnees_planete['vaisseau_3'] * 9000 );
$cristal += ( $donnees_planete['vaisseau_3'] * 9000 );
$hydrogene += ( $donnees_planete['vaisseau_3'] * 1000 );
// 'drone(s) d\'espionnage de classe Clarion', 4
$metal += ( $donnees_planete['vaisseau_4'] * 1000) ;
$cristal += ( $donnees_planete['vaisseau_4'] * 1200 );
$hydrogene += ( $donnees_planete['vaisseau_4'] * 100 );
// 'recycleur(s) de classe Minotaur', 5
//SELECT * FROM `user` WHERE 1$metal += ( $donnees_planete['vaisseau_5'] * 15000 );
$cristal += ( $donnees_planete['vaisseau_5'] * 9000 );
$hydrogene += ( $donnees_planete['vaisseau_5'] * 1000 );
// 'C709 Longsword Interceptor', 6
$metal += ( $donnees_planete['vaisseau_6'] * 1700 );
$cristal += ( $donnees_planete['vaisseau_6'] * 1220 );
// 'Fr&eacute;gates', 7
$metal += ( $donnees_planete['vaisseau_7'] * 5800 );
$cristal += ( $donnees_planete['vaisseau_7'] * 1400 );
// 'croiseur(s) de classe Halcyon', 8
$metal += ( $donnees_planete['vaisseau_8'] * 20000 );
$cristal += ( $donnees_planete['vaisseau_8'] * 16000 );
$hydrogene += ( $donnees_planete['vaisseau_8'] * 1600 );
// 'croiseur(s) de classe Marathon', 9
$metal += ( $donnees_planete['vaisseau_9'] * 26000 );
$cristal += ( $donnees_planete['vaisseau_9'] * 16400 );
$hydrogene += ( $donnees_planete['vaisseau_9'] * 1600 );
// 'porte vaisseaux', 10
$metal += ( $donnees_planete['vaisseau_10'] * 60000 );
$cristal += ( $donnees_planete['vaisseau_10'] * 40000 );
$hydrogene += ( $nb_vaisseaux['vaisseau_10'] * 3000 );
$METAL_VAISSEAUX = $metal;
$CRISTAL_VAISSEAUX = $cristal;
$HYDROGENE_VAISSEAUX = $hydrogene;
$RESSOURCES_VAISSEAUX = $METAL_VAISSEAUX + $CRISTAL_VAISSEAUX + $HYDROGENE_VAISSEAUX;
} // boucle planetes -->
// partie pts techno
$techno_db = mysql_query("SELECT `informatique`, `detection`, `armement`, `energie_t`, `reacteur`, `reacteur_f`, `reacteur_ff`, `medecine`, `tactique`, `spartan`, `blindage` FROM `user` WHERE `id` = ".$id)or die(mysql_error());
while ($techno = mysql_fetch_array($techno_db)) {
$POINTS_TECHNO = $techno['informatique'] + $techno['detection'] + $techno['armement'] + $techno['energie_t'] + $techno['reacteur'] + $techno['reacteur_f'] + $techno['reacteur_ff'] + $techno['medecine'] + $techno['tactique'] + $techno['spartan'] + $techno['blindage'];
// partie pts techno ressources
$RESSOURCES_TECHNO = techno1( $techno['informatique'] ) + techno2( $techno['detection'] ) + techno3( $techno['armement'] ) + techno4( $techno['energie_t'] ) + techno5( $techno['reacteur'] ) + techno6( $techno['reacteur_f'] ) + techno7( $techno['reacteur_ff'] ) + techno8( $techno['medecine'] ) + techno9( $techno['tactique'] ) + techno10( $techno['spartan'] ) + techno11( $techno['blindage'] );
}
$PT_RESSOURCES = ( $RESSOURCES_VAISSEAUX + $RESSOURCES_TECHNO + $POINTS_BATIMENTS ) / 1000;
$POINTS_BATIMENTS = $POINTS_BATIMENTS / 1000;
// points flottes terrestres recherches batiments
if ($recup_id['auth_level'] < 2 && $recup_id['mv'] < 2) mysql_query("INSERT INTO `classement` VALUES (NULL, '$PSEUDO_USER', '$race', '$PT_RESSOURCES', '$POINTS_VAISSEAUX', '0', '$POINTS_TECHNO', '$POINTS_BATIMENTS')") or die (mysql_error());
mysql_query("UPDATE `user` SET `flotte` = '" . $POINTS_VAISSEAUX . "', `recherches` = '" . $POINTS_TECHNO . "', `batiments` = '" . $POINTS_BATIMENTS . "', `points` = '" . $PT_RESSOURCES . "' WHERE `pseudo` = '" . $PSEUDO_USER . "'") or die (mysql_error());
$metal = 0;
$cristal = 0;
$hydrogene = 0;
$POINTS_VAISSEAUX = 0;
$POINTS_TECHNO = 0;
$PT_RESSOURCES = 0;
$METAL_VAISSEAUX = 0;
$CRISTAL_VAISSEAUX = 0;
$HYDROGENE_VAISSEAUX = 0;
$RESSOURCES_VAISSEAUX = 0;
$POINTS_BATIMENTS = 0;
}
$sql_2 = mysql_query("SELECT * FROM `classement` ORDER BY `classement`.`points` DESC");
$i=0;
while($resultat = mysql_fetch_array($sql_2)) {
$nomuser = $resultat['pseudo'];
$reqd = mysql_query("SELECT `auth_level` FROM `user` WHERE `pseudo` = '$nomuser'");
$resultatd = mysql_fetch_array($reqd);
if ($resultatd['auth_level'] < 2) {
$i++;
mysql_query("UPDATE `user` SET `place_points` = '$i' WHERE `pseudo` = '$nomuser'");
}
else mysql_query("UPDATE `user` SET `place_points` = '0' WHERE `pseudo` = '$nomuser'");
}
##################################################
#MAJ classement Ally
##################################################
mysql_query("TRUNCATE TABLE `classement_alliances`");
//recuperation de l'id et du tag de l'ally
$sql_1 = mysql_query("SELECT t1.id_alliance ,t2.tag
FROM `user` AS t1
INNER JOIN `alliances` AS t2 ON t1.id_alliance = t2.id
GROUP BY t1.id_alliance
");
while($recup_id = mysql_fetch_array($sql_1))
{
$id_ally = $recup_id['id_alliance'];
$tag_ally = $recup_id['tag'];
// recuperation du nombre de membre dans l'ally
$nb_members = mysql_query(" SELECT COUNT( * )
FROM `user` AS t1
WHERE t1.id_alliance = $id_ally
");
$nb_members= mysql_fetch_row($nb_members);
// recuperation de la somme des points de l'ally
$nb_points = mysql_query("SELECT SUM( classement.points )
FROM classement, user
WHERE user.id_alliance = $id_ally
AND user.pseudo = classement.pseudo
");
$nb_points= mysql_fetch_row($nb_points);
$nb_points_by_members = ceil($nb_points/$nb_members);
// recuperation de la somme des points flottes de l'ally
$nb_points_flottes = mysql_query("SELECT SUM( classement.flottes )
FROM classement, user
WHERE user.id_alliance = $id_ally
AND user.pseudo = classement.pseudo
");
$nb_points_flottes= mysql_fetch_row($nb_points_flottes);
$nb_points_flottes_by_members = ceil($nb_points_flottes/$nb_members);
// recuperation de la somme des points terrestres de l'ally
$nb_points_terrestres = mysql_query("SELECT SUM( classement.terrestres )
FROM classement, user
WHERE user.id_alliance = $id_ally
AND user.pseudo = classement.pseudo
");
$nb_points_terrestres= mysql_fetch_row($nb_points_terrestres);
$nb_points_terrestres_by_members = ceil($nb_points_terrestres/$nb_members);
// recuperation de la somme des points recherches de l'ally
$nb_points_recherches = mysql_query("SELECT SUM( classement.recherches )
FROM classement, user
WHERE user.id_alliance = $id_ally
AND user.pseudo = classement.pseudo
");
$nb_points_recherches= mysql_fetch_row($nb_points_recherches);
$nb_points_recherches_by_members = ceil($nb_points_recherches/$nb_members);
// recuperation de la somme des points batiments de l'ally
$nb_points_batiments = mysql_query("SELECT SUM( classement.batiments )
FROM classement, user
WHERE user.id_alliance = $id_ally
AND user.pseudo = classement.pseudo
");
$nb_points_batiments= mysql_fetch_row($nb_points_batiments);
$nb_points_batiments_by_members = ceil($nb_points_batiments/$nb_members);
mysql_query("INSERT INTO `classement_alliances` VALUES (NULL, '$tag_ally', '$nb_members[0]', '$nb_points[0]','$nb_points_by_members', '$nb_points_flottes[0]','$nb_points_flottes_by_members', '$nb_points_terrestres[0]', '$nb_points_terrestres_by_members', '$nb_points_recherches[0]', '$nb_points_recherches_by_members', '$nb_points_batiments[0]', '$nb_points_batiments_by_members')");
}
$chapeau->deconnexion();
print '<br />Il est : '.date('d/m/Y H:i:s');
?>

View file

@ -1,15 +0,0 @@
<?php
if(!defined('INDEX')) define('INDEX', 1);
set_time_limit(0);
require('../includes/common.php');
$chapeau = new bdd();
$chapeau->connexion();
$chapeau->db();
$chapeau->query("OPTIMIZE TABLE `alliances` , `alliances_attente` , `alliances_chat` , `alliances_creation` , `alliances_grade` , `banni` , `bug` , `classement` , `flottes` , `flottes_combats` , `historique` , `infoshead` , `mail` , `planete` , `registre_identification` , `securite_identification` , `sessions` , `user` , `user_inscriptions` , `version`;
TRUNCATE TABLE `registre_identification`;");
$chapeau->deconnexion();
?>

View file

@ -1,689 +0,0 @@
<?
function showHeaderPage()
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>WebcronSave V1.41</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/>
<meta http-equiv="expires" content="0">
<style type="text/css">
<!--
body { background: #FFFFFF; }
#topnav {
background-color: #003399;
padding: 1px;
}
#topnav li {
display : inline;
width: 100%;
background-color: #FFFFFF;
margin: 1 0px 1 0px;
}
#topnav a {
color: #003399;
}
#topnav a {
color: #003399;
}
.message {
color: black;
font_weight:bold;
}
.error {
color: red;
font_weight:bold;
}
//-->
</style>
</head>
<body>
<?
}
// recup chaine de get, post ou cookie avec ou sans stripslashes selon magic_quotes_gpc
function RecupChaine($chaine) {
if (get_magic_quotes_gpc()==1) return stripslashes($chaine); // il y avait magic
return $chaine; // il n'y avait pas magic
}
function showMessage($message,$class)
{
?>
<div class="<?=$class?>">
<?=$message?>
</div>
<?
}
function moimeme($paramget='') {
global $_CONFIG;
$ret=rtrim($_SERVER['PHP_SELF'],'/');
$ret .=$paramget;
if ($_CONFIG['IDENTIF'] != 'basic') {
$ret .= empty($paramget)?'?':'&';
$ret .= 'login='.urlencode($_CONFIG['LOGIN_HTTP']);
$ret .= '&pass='.urlencode($_CONFIG['PASS_HTTP']);
}
return '"'.$ret.'"';
}
function showFormConfig()
{
global $_CONFIG;
?>
<H1>CONFIGURATION</H1>
<B>ATTENTION !</B><BR />
Les mots de passe de base de données et d'administration doivent être saisis lors de la première configuration.
Lors des autres accès à l'administration, laissez-les en blanc, sauf si vous désirez les changer.<BR>
Nous conseillons le mode d'identification 'basic', mais il se peut qu'il ne fonctionne pas sur certains systèmes.
Utilisez alors le mode 'par URL'.<br>
<B>Si vous êtes obligé d'utiliser le mode 'par URL' et que d'autres personnes utilisent votre machine, videz l'historique de
votre browser sinon d'autres personnes pourront retrouver vos login et mot de passe.</B>
<BR><BR>
<B>Utilisation de Webcronsave avec webcron.org :</B><br>
<UL>
<LI>identification basic : créez une tâche quotidienne avec l'url :<BR>
<i>http://monsite.com/webcronsave.php?action=savewebcron</i><BR>
et mettez le login et le mot de passe d'administration dans les login et mot de passe de la création/édition d'une tâche.
<LI>identification par URL : créez une tâche quotidienne avec l'url :<BR>
<i>http://monsite.com/webcronsave.php?action=savewebcron&login=monlogin&pass=monpass</i><BR>
mais laissez vides les login et mot de passe de la création/édition d'une tâche.
</UL>
<form action=<?=moimeme()?> method="POST">
<input type="hidden" name="action" value="saveconfig">
<TABLE border=1 cellpadding="3" align="center">
<tr bgcolor="#FFFFCC"><td colspan="2" align = "center" ><b>BASE DE DONNEES</b></td></tr>
<TR bgcolor="#FFFFCC">
<td align="right">Nom du serveur :</td>
<td><input type="text" name="SERVER" value="<?=$_CONFIG['SERVER']?>"></td>
</tr>
<tr bgcolor="#FFFFCC">
<td align="right">Login utilisateur :</td>
<td><input type="text" name="USER" value="<?=$_CONFIG['USER']?>"></td>
</tr>
<tr bgcolor="#FFFFCC">
<td align="right">Nouveau mot de passe utilisateur :</td>
<td><input type="text" name="PASS"></td>
</tr>
<tr bgcolor="#FFFFCC">
<td align="right">Nom de la base de données :</td>
<td><input type="text" name="BASE" value="<?=$_CONFIG['BASE']?>"></td>
</tr>
<tr bgcolor="#CCCCFF"><td colspan="2" align = "center"><b>ADMINISTRATION</b></td></tr>
<tr bgcolor="#CCCCFF">
<td align="right">Email en cas de problème :</td>
<td><input type="text" name="EMAIL" value="<?=$_CONFIG['EMAIL']?>"></td>
</tr>
<tr bgcolor="#CCCCFF">
<td align="right">Login d'accès à l'admin :</td>
<td><input type="text" name="LOGIN_HTTP" value="<?=$_CONFIG['LOGIN_HTTP']?>"></td>
</tr>
<tr bgcolor="#CCCCFF">
<td align="right">Nouveau mot de passe d'accès à l'admin :</td>
<td><input type="text" name="PASS_HTTP"></td>
</tr>
<tr bgcolor="#CCCCFF">
<td align="right">Mode d'identification :</td>
<td>
basic : <input type="radio" name="IDENTIF" value="basic"<? echo $_CONFIG['IDENTIF']!='basic'?'':'CHECKED'?>>
par URL : <input type="radio" name="IDENTIF" value="url"<? echo $_CONFIG['IDENTIF']=='basic'?'':'CHECKED'?>>
</td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="2" align="center"><b>LISTE DES SAUVEGARDES A FAIRE</b</td>
</tr>
<tr bgcolor="#CCFFFF">
<td align="right"> sauvegarde du 1er du mois : </td>
<td><input type="radio" name="MONTH" value="1" <?=($_CONFIG['MONTH']==1)?"CHECKED":""?>> Oui <input type="radio" name="MONTH" value="0" <?=($_CONFIG['MONTH']==0)?"CHECKED":""?>> Non </td>
</tr>
<tr bgcolor="#CCFFFF">
<td align="right">sauvegarde du dimanche : </td>
<td><input type="radio" name="WEEK" value="1" <?=($_CONFIG['WEEK']==1)?"CHECKED":""?>> Oui <input type="radio" name="WEEK" value="0" <?=($_CONFIG['WEEK']==0)?"CHECKED":""?>> Non </td>
</tr>
<tr bgcolor="#CCFFFF">
<td align="right">sauvegarde de la veille : </td>
<td><input type="radio" name="YESTERDAY" value="1" <?=($_CONFIG['YESTERDAY']==1)?"CHECKED":""?>> Oui <input type="radio" name="YESTERDAY" value="0" <?=($_CONFIG['YESTERDAY']==0)?"CHECKED":""?>> Non </td>
</tr>
<tr bgcolor="#CCFFFF">
<td align="right">sauvegarde du jour : </td>
<td><input type="radio" name="TODAY" value="1" <?=($_CONFIG['TODAY']==1)?"CHECKED":""?>> Oui <input type="radio" name="TODAY" value="0" <?=($_CONFIG['TODAY']==0)?"CHECKED":""?>> Non </td>
</tr>
<? if (isset($_CONFIG["BASE"]) && isset($_CONFIG["SERVER"]) && isset($_CONFIG["USER"]) && isset($_CONFIG["PASS"])) {
if (checkMysql())
{
$list=listTable();
?>
<tr bgcolor="#CCCCFF">
<td colspan="2" align="center"><b>LISTE DES TABLES A SAUVEGARDER</b</td>
</tr>
<?
foreach($list as $table)
{
if (!isset($_CONFIG['TABLE_'.$table['nom']])) $_CONFIG['TABLE_'.$table['nom']]=1;
?>
<tr bgcolor="#CCFFFF">
<td align="right">table <b><?=$table['nom']?></b></td>
<td><input type="radio" name="TABLE_<?=$table['nom']?>" value="1" <?=($_CONFIG['TABLE_'.$table['nom']]==1)?"CHECKED":""?>> Oui <input type="radio" name="TABLE_<?=$table['nom']?>" value="0" <?=($_CONFIG['TABLE_'.$table['nom']]==0)?"CHECKED":""?>> Non </td>
</tr>
<?
}
?>
<? } else {?>
<tr bgcolor="#CCCCFF">
<td colspan="2" align="center"><b>TOUTES LES TABLES SONT SAUVEGARDEES</b</td>
</tr>
<? } } else { ?>
<tr bgcolor="#CCCCFF">
<td colspan="2" align="center"><b>TOUTES LES TABLES SONT SAUVEGARDEES</b</td>
</tr>
<? } ?>
<TR>
<td colspan="2" align="center"><input type="submit" name="submit" value="Valider"></td>
</tr>
</table>
</form>
<?
}
function showFooterPage()
{
?>
</body>
</html>
<?
}
function showMenu()
{
?>
<ul id="topnav">
<li>&nbsp;<a href=<?=moimeme('?action=config')?>>Configuration</a>&nbsp;</li>
<li>&nbsp;<a href=<?=moimeme('?action=save')?>>Sauvegarde Manuelle</a>&nbsp;</li>
<li>&nbsp;<a href=<?=moimeme('?action=restore')?>>Restauration</a>&nbsp;</li>
<li>&nbsp;<a href="http://www.webcron.org">Webcron</a>&nbsp;</li>
</ul>
<?
}
function showIdentifPage()
{
global $_CONFIG;
?>
<H1>IDENTIFICATION</H1>
<FORM align="center" method="GET" action="<?=$_SERVER['PHP_SELF']?>">
<TABLE border=1 cellpadding="3" align="center">
<tr bgcolor="#CCCCFF">
<td align="right">Login d'accès à l'admin :</td>
<td><input type="text" name="login" value="<?=$_CONFIG['LOGIN_HTTP']?>"></td>
</tr>
<tr bgcolor="#CCCCFF">
<td align="right">Mot de passe d'accès à l'admin :</td>
<td><input type="text" name="pass"></td>
</tr>
<TR>
<td colspan="2" align="center"><input type="submit" name="submit" value="Valider"></td>
</tr>
</TABLE>
</FORM>
<?
}
function checkMysql()
{
global $_CONFIG;
include('./webcronsave/config.php');
if (!$my=mysql_connect($_CONFIG['SERVER'],$_CONFIG['USER'],$_CONFIG['PASS']))
return false;
else
{
if (!mysql_select_db($_CONFIG['BASE']))
return false;
}
return true;
}
function saveData()
{
global $_CONFIG;
checkMysql();
$fname=date('Y-m-d')."_".$_CONFIG['BASE'];
$list=listTable();
if (!function_exists('gzopen'))
$fp=fopen('./webcronsave/'.$fname.'.sql','w');
else
$fp=gzopen('./webcronsave/'.$fname.'.gz','w');
if ($fp)
{
foreach($list as $table)
{
if (isset($_CONFIG['TABLE_'.$table['nom']]))
{
if ($_CONFIG['TABLE_'.$table['nom']]=='1')
{
dumpTable($fp,$table);
}
}
else dumpTable($fp,$table);
}
return true;
}
else
return false;
}
function restoreFile($file)
{
showMessage('Restauration en cours','message');
checkMysql();
list($name,$ext)=explode('.',$file);
if ($ext=='gz')
$pref='gz';
else
$pref='f';
$open=$pref.'open';
$gets=$pref.'gets';
$eof=$pref.'eof';
$close=$pref.'close';
$fp=$open($dir='./webcronsave/'.$file,'r');
if ($fp)
{
$buffer='';
$inChamp=false;
while (!$eof($fp)) {
$s=$gets($fp, 4096);
$old='';
for($i=0;$i<strlen($s);$i++)
{
$current=$s[$i];
if ($current=="'" && $old!='\\')
$inChamp=!$inChamp;
if ($current==';' && $inChamp==false)
{
$query=$buffer;
if (!mysql_query($query))
{
showMessage('Problème de requete <b>'.htmlentities($query).'</b> Mysql '.mysql_error(),'error');
return false;
}
$buffer='';
}
else
{
$buffer.=$current;
}
$old=$current;
}
}
$close($fp);
return true;
}
else return false;
}
function dumpTable($fp,$table)
{
global $_CONFIG;
$nomtable=$table['nom'];
if (!function_exists('gzopen'))
$fwrite='fwrite';
else
$fwrite='gzwrite';
$fwrite($fp,'#sauvegarde base mysql '.$_CONFIG['BASE']."\n\n");
$fwrite($fp,"DROP TABLE IF EXISTS `$nomtable`;\n\n");
$sql='SET SQL_QUOTE_SHOW_CREATE=1';
$res=mysql_query($sql); // pas fatal
$sql="SHOW CREATE TABLE `$nomtable`";
$res=mysql_query($sql) or die ('Erreur Mysql '.mysql_error().'<br>');
while($res && $row=mysql_fetch_row($res))
{
if (is_numeric($table['autoinc'])) $row[1] .= ' AUTO_INCREMENT='.$table['autoinc'];
$fwrite($fp,$row[1].";\n");
}
$fwrite($fp,"\n\n");
$res = mysql_query("SELECT * FROM `$nomtable`") or die ('Erreur Mysql '.mysql_error().'<br>');
while ($row = mysql_fetch_assoc($res)){
$strFieldsNames = '';
$strFieldsValues = '';
foreach ($row as $field_name => $field_value){
if ($strFieldsNames) $strFieldsNames .= ', ';
$strFieldsNames .= "`$field_name`";
if($strFieldsValues) $strFieldsValues .= ', ';
$strFieldsValues .= "'" . addslashes($field_value) . "'";
}
$fwrite($fp,"INSERT INTO `$nomtable` ($strFieldsNames) values($strFieldsValues);\n");
}
$fwrite($fp,"\n\n");
}
function listTable()
{
global $_CONFIG;
$list_table=array();
$list_autoinc =array();
$res=mysql_query('SHOW TABLE STATUS') or die ('Erreur Mysql '.mysql_error().'<br>');
// $tmpfile=tempnam(ini_get("session.save_path"),"webcronsave_");
if (!$res)
{
echo 'Erreur Mysql '.mysql_error().'<br>';
die;
}
else
{
while($row=mysql_fetch_array($res))
{
$list_table[]=array('nom'=>$row['Name'],'autoinc'=>$row['Auto_increment']);
}
}
return $list_table;
}
function saveConfig($data)
{
global $_CONFIG;
// on vérifie si config correcte
if (empty($data['PASS'])) {
if (empty($_CONFIG['PASS'])) {
showMessage ('Le mot de passe de la base de données est vide.','error');
showMessage ('Ceci n\'est acceptable que si vous faites un essai en local','error');
$_CONFIG['PASS']='';
}
$data['PASS']=$_CONFIG['PASS']; // prise en compte nouveau mot de passe bdd
}
if (empty($data['PASS_HTTP'])) {
if (empty($_CONFIG['PASS_HTTP'])) {
return 'le mot de passe admin ne doit pas être vide'; // mot de passe admin vide interdit
}
$data['PASS_HTTP']=$_CONFIG['PASS_HTTP']; // prise en compte nouveau mot de passe admin
}
if (empty($data['USER'])) {
showMessage ('Le nom d\'utilisateur de la base de données est vide.','error');
showMessage ('Ceci n\'est acceptable que si vous faites un essai en local','error');
}
if (empty($data['LOGIN_HTTP'])) {
return 'le nom d\'utilisateur admin ne doit pas être vide';
}
if($fd = fopen('./webcronsave/config.php','w'))
{
fputs($fd,"<?php\n");
foreach($data as $key => $val)
{
fputs($fd,"\$_CONFIG[\"$key\"]=".var_export(recupchaine($val),true).";\n");
$_CONFIG[$key]=$val;
}
fputs($fd,'?','>');
fclose($fd);
//je crée un htaccess pour ne pas que les gens viennent chercher les fichiers en direct
if($fd = @fopen('./webcronsave/.htaccess','w'))
{
$str="order deny,allow\ndeny from all\n";
fputs($fd,$str);
fclose($fd);
}
return '';
}
else
return 'Problème de droits : impossible de sauvegarder le fichier de config';
}
function getFileSize($size) {
$units = array(' B', ' KB', ' MB', ' GB', ' TB');
for ($i = 0; $size > 1024; $i++) { $size /= 1024; }
return round($size, 2).$units[$i];
}
function fileData($file)
{
global $_CONFIG;
$dir='./webcronsave/';
list($name,$ext)=explode('.',$file);
list($date,$db)=explode('_',$name);
list($year,$month,$day)=explode('-',$date);
if ($ext=='gz') $ext_f='Fichier compressé (algorithme GZIP)';
else $ext_f='Fichier non compressé';
return 'sauvegarde du '.$day.'/'.$month.'/'.$year.' '.getFileSize(filesize($dir.$file)).' '.$ext_f;
}
function checkFile()
{
global $_CONFIG;
if (!function_exists('gzopen'))
$ext='.sql';
else
$ext='.gz';
//sauvegarde du jour
if ($_CONFIG['TODAY']=='1') $names[date('Y-m-d').'_'.$_CONFIG['BASE'].$ext]=date('Y-m-d').'_'.$_CONFIG['BASE'].$ext;
//sauvegarde de la veille
if ($_CONFIG['YESTERDAY']=='1') $names[date('Y-m-d',time()-86400).'_'.$_CONFIG['BASE'].$ext]=date('Y-m-d',time()-86400).'_'.$_CONFIG['BASE'].$ext;
//sauvegarde du debut du mois
if ($_CONFIG['MONTH']=='1') $names[date('Y-m-01').'_'.$_CONFIG['BASE'].$ext]=date('Y-m-01').'_'.$_CONFIG['BASE'].$ext;
//sauvegarde du dimanche
if ($_CONFIG['WEEK']=='1') $names[date('Y-m-d',time()-date('w')*86400).'_'.$_CONFIG['BASE'].$ext]=date('Y-m-d',time()-date("w")*86400)."_".$_CONFIG['BASE'].$ext;
//var_dump($names);
$list_f=listFileSave();
foreach($list_f as $file)
{
if (!in_array($file,$names)) unlink('./webcronsave/'.$file);
}
}
function listFileSave()
{
$dir='./webcronsave/';
$list_f=array();
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (!in_array($file,array('.','..','config.php','.htaccess')))
{
$list_f[]=$file;
}
}
closedir($dh);
}
}
return $list_f;
}
function listeSave()
{
global $_CONFIG;
$list_f=listFileSave();
echo '<ul id="list_archive">';
foreach($list_f as $val)
{
echo '<li>&nbsp;<a href='.moimeme('?action=dorestore&file='.urlencode($val)).'>Restaurer</a>&nbsp;'.fileData($val).'</li>';
}
echo '</ul>';
}
function readConfig()
{
global $_CONFIG;
$rsrc=@opendir( './webcronsave');
if ($rsrc===false) return false;
closedir ($rsrc);
if (file_exists('./webcronsave/config.php'))
include_once('./webcronsave/config.php');
if (!isset($_CONFIG['TODAY'])) $_CONFIG['TODAY']=0;
if (!isset($_CONFIG['YESTERDAY'])) $_CONFIG['YESTERDAY']=0;
if (!isset($_CONFIG['MONTH'])) $_CONFIG['MONTH']=1;
if (!isset($_CONFIG['WEEK'])) $_CONFIG['WEEK']=0;
if (!isset($_CONFIG['SERVER'])) $_CONFIG['SERVER']='localhost';
if (!isset($_CONFIG['USER'])) $_CONFIG['USER']='';
if (!isset($_CONFIG['PASS'])) $_CONFIG['PASS']='';
if (!isset($_CONFIG['BASE'])) $_CONFIG['BASE']='';
if (!isset($_CONFIG['EMAIL'])) $_CONFIG['EMAIL']='';
if (!isset($_CONFIG['LOGIN_HTTP'])) $_CONFIG['LOGIN_HTTP']='';
if (!isset($_CONFIG['PASS_HTTP'])) $_CONFIG['PASS_HTTP']='';
if (!isset($_CONFIG['IDENTIF'])) $_CONFIG['IDENTIF']='basic';
return true;
} // function readConfig()
function AfficherListe() {
echo 'sauvegarde(s) disponible(s) :<BR>';
$lst= ListFileSave();
for ($k= 0; $k < count($lst); $k++) {
echo htmlentities($lst[$k]),'<BR>';
}
} //function AfficherListe()
//GESTION DE LA PAGE
if (isset($_POST['action']) && strlen($_POST['action'])>0) $action=recupchaine($_POST['action']);
else if (isset($_GET['action']) && strlen($_GET['action'])>0) $action=recupchaine($_GET['action']);
//par défaut l'action est la configuration
else $action='config';
if (!readConfig())
{
$action='error';
$errorMessage='Veuillez créer le repertoire \'webcronsave\' pour sauvegarder votre config et vos sauvegardes.';
}
else
{
if (!empty($_CONFIG['LOGIN_HTTP']) && !empty($_CONFIG['PASS_HTTP']))
{
if ($_CONFIG['IDENTIF']!='basic') {
if (empty($_GET['login']) || empty($_GET['pass'])) // identification non fournie
$action='demandermdp';
else if ((recupchaine($_GET['login']) != $_CONFIG['LOGIN_HTTP']) ||
(recupchaine($_GET['pass']) != $_CONFIG['PASS_HTTP']) ) // identif incorrecte
$action='demandermdp';
} // fin identif par url
else { // identif par basic
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="WebCronSave"');
header('HTTP/1.0 401 Unauthorized');
exit;
} else {
if ($_SERVER['PHP_AUTH_USER']!=$_CONFIG['LOGIN_HTTP'] || $_SERVER['PHP_AUTH_PW']!=$_CONFIG['PASS_HTTP'])
{
header('WWW-Authenticate: Basic realm="WebCronSave"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
}
} // fin identif par basic
}
}
checkFile();
//traitement spécifique
switch($action)
{
//webcron sauvegarde automatique
case 'savewebcron':
if (!saveData()) {
mail($_CONFIG['EMAIL'],'Problème avec votre sauvegarde','Veuillez vérifier votre configuration : http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\n");
echo 'pb sauvegarde';
} else {
checkFile();
AfficherListe();
}
break;
//Affichage de la config
case 'config':
showHeaderPage();
showMenu();
showFormConfig();
break;
//sauvegarde de la config
case 'saveconfig':
showHeaderPage();
$diag=saveConfig($_POST);
showMenu();
if ($diag!='')
{
showMessage($diag,'error');
}
else
{
showMessage('La configuration a été sauvegardée',"message");
showMessage('Vérification de la connexion de la base de données','message');
if (!checkMysql()) showMessage('Problème de connexion Mysql '.mysql_error(),'error');
else showMessage('La connexion est bien configurée !','message');
}
break;
//Affichage d'une erreur
case 'error':
showHeaderPage();
showMenu();
showMessage($errorMessage,'error');
showFooterPage();
break;
//Gestion de la sauvegarde manuel
case 'save':
showHeaderPage();
showMenu();
if (saveData())
{
showMessage('La sauvegarde a été effectuée avec succès','message');
}
else
showMessage('Problème de création de fichier','error');
showFooterPage();
break;
//gestion de la restauration
case 'restore':
showHeaderPage();
showMenu();
listeSave();
showFooterPage();
break;
//gestion de la restauration
case 'dorestore':
showHeaderPage();
showMenu();
$file=recupchaine($_GET['file']);
if (!restoreFile($file)) showMessage('Problème de requête Mysql '.mysql_error(),'error');
else showMessage('Restauration effectuée avec succès','message');
showFooterPage();
break;
//saisie de l'identification par URL
case 'demandermdp':
showHeaderPage();
showIdentifPage();
showFooterPage();
break;
//gestion par défaut
default:
break;
}
?>

View file

@ -1,2 +0,0 @@
order deny,allow
deny from all

File diff suppressed because it is too large Load diff

View file

@ -1,35 +0,0 @@
<?php
$_CONFIG["action"]='saveconfig';
$_CONFIG["SERVER"]='localhost';
$_CONFIG["USER"]='hb_37';
$_CONFIG["PASS"]='JQ2Pe%!bpUDr1';
$_CONFIG["BASE"]='hb_37';
$_CONFIG["EMAIL"]='admin@halo-battle.s-fr.com';
$_CONFIG["LOGIN_HTTP"]='nemunaire';
$_CONFIG["PASS_HTTP"]='KT58pUm%s!9';
$_CONFIG["IDENTIF"]='basic';
$_CONFIG["MONTH"]='0';
$_CONFIG["WEEK"]='0';
$_CONFIG["YESTERDAY"]='0';
$_CONFIG["TODAY"]='1';
$_CONFIG["TABLE_alliances"]='1';
$_CONFIG["TABLE_alliances_attente"]='1';
$_CONFIG["TABLE_alliances_chat"]='1';
$_CONFIG["TABLE_alliances_creation"]='1';
$_CONFIG["TABLE_alliances_grade"]='1';
$_CONFIG["TABLE_bug"]='0';
$_CONFIG["TABLE_classement"]='0';
$_CONFIG["TABLE_classement_alliances"]='0';
$_CONFIG["TABLE_flottes"]='1';
$_CONFIG["TABLE_flottes_combats"]='1';
$_CONFIG["TABLE_infoshead"]='0';
$_CONFIG["TABLE_mail"]='1';
$_CONFIG["TABLE_ope_faq"]='1';
$_CONFIG["TABLE_ope_mail"]='1';
$_CONFIG["TABLE_ope_modele"]='1';
$_CONFIG["TABLE_planete"]='1';
$_CONFIG["TABLE_registre_identification"]='0';
$_CONFIG["TABLE_sessions"]='0';
$_CONFIG["TABLE_user"]='1';
$_CONFIG["TABLE_version"]='0';
$_CONFIG["submit"]='Valider';

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

77
htdocs/images/index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -14,29 +14,39 @@ if ($_SERVER["REMOTE_ADDR"] == "82.245.190.225" || $_SERVER["REMOTE_ADDR"] == "8
if (isset($sess) && isset($sess->values['connected']) && $sess->values['connected'] && !empty($sess->values['id']) && isset($sess->values['auth_level']) && !empty($sess->values['idPlan'])) {
$HB_login = gpc('l');
if (!empty($HB_login) && strtolower($HB_login) != strtolower(trouvNom($sess->values['id']))) {
include(_FCORE."hb_game/jeu/logout.php");
include(_FCORE."../game/jeu/logout.php");
}
elseif (!empty($HB_login)) {
header('Location: ./');
header('Location: ./'.$config['first_page']);
exit;
}
//Inclusion des formules
require_once(_FCORE."../game/vars.php");
//On inclus les différentes classes
include_once(_FCORE."../game/Class/class.user.php");
include_once(_FCORE."../game/Class/class.planete.php");
//Récupération d'informations au sujet de l'utilisateur
$id_user = $sess->values['id'];
$template->assign('auth_level', $sess->values['auth_level']);
$ip = $_SERVER["REMOTE_ADDR"];
$bdd->connexion();
$queryUser = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_user");
$multi = $bdd->query("SELECT U.pseudo, R.id_util FROM $table_registre_identification R INNER JOIN $table_user U ON U.id = R.id_util WHERE R.ip = '$ip' GROUP BY R.ip, R.id_util HAVING R.id_util != $id_user;");
$queryUser = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_user;");
//On vérifie que le joueur ne soit pas en mode vacances forcé
if ($queryUser['mv'] || !$queryUser) {
if ($queryUser['mv'] > 0 || !$queryUser) {
$sess->close();
header('Location: ?mvf');
header('Location: '.$config['first_page'].'?mvf');
exit;
}
$race = $queryUser['race'];
$template->assign('race', $queryUser['race']);
$template->assign('multi', $multi);
$template->assign('user', $queryUser);
$tpsdejeu = time() - $queryUser['last_visite'];
$heur = floor($tpsdejeu/3600);
@ -58,196 +68,162 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
}
$idPlan = $sess->values['idPlan'];
$queryMail = $bdd->unique_query("SELECT COUNT(id) AS nombre FROM $table_mail WHERE destinataire = $id_user AND vu = '1';");
$queryPlanetes = $bdd->query("SELECT * FROM $table_planete WHERE id_user = '$id_user' ORDER BY id ASC;");
$queryPlanete = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
$bdd->deconnexion();
$planete = new Planete($idPlan);
///$queryPlanete = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
$case = $queryPlanete["cases"];
$metal = $queryPlanete["metal"];
$cristal = $queryPlanete["cristal"];
$hydrogene = $queryPlanete["hydrogene"];
require_once(_FCORE."hb_game/ressources.php");
require_once(_FCORE."hb_game/noms.php");
require_once(_FCORE."hb_game/vars.php");
require_once(_FCORE."hb_game/constructions.php");
require_once(_FCORE."hb_game/flottes.php");
$bdd->connexion();
$queryPlanete = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
$queryMail = $bdd->unique_query("SELECT COUNT(id) AS nombre FROM $table_mail WHERE destinataire = '".$queryUser['pseudo']."' AND vu = '1';");
$bdd->deconnexion();
//Isolement de la planète
$queryPlanete['isolement'] = explode(' ', $queryPlanete['isolement']);
if (time() > $queryPlanete['isolement'][0]) {
if (!isset($queryPlanete['isolement'][1]) || (time() > $queryPlanete['isolement'][1] && date('dmY') != date('dmY', $queryPlanete['isolement'][0]))) {
$nbPlan = count($queryPlanetes);
$numP = 0;
for ($i=0 ; $i<$nbPlan ; $i++) {
if ($queryPlanetes[$i]['id'] == $queryPlanete['id']) $numP = $i;
}
if ($numP > 10) {
switch($numP){
case 11: $tps = 2; break;
case 12: $tps = 4; break;
case 13: $tps = 6; break;
case 14: $tps = 8; break;
case 15: $tps = 12; break;
case 16: $tps = 16; break;
case 17: $tps = 20; break;
default: $tps = 24;
}
$debut = mktime(rand(0, 24-$tps), 0, 0, date('n'), date('j'), date('Y'));
$fin = $debut + $tps * 3600;
$bdd->connexion();
$bdd->query("UPDATE $table_planete SET isolement = '$debut $fin' WHERE id = '$idPlan';");
$bdd->deconnexion();
$queryPlanete['isolement'][0] = $debut;
if (time() > $queryPlanete['isolement'][0]) $queryPlanete['isolement'][1] = $fin;
}
}
if (isset($queryPlanete['isolement'][1]) && time() < $queryPlanete['isolement'][1] && $p != 'rename' && $p != 'accueil' && $p != 'arbre' && $p != 'prochainement' && $p != 'options' && $p != 'messagerie' && $p != 'envoyer' && $p != 'classement' && $p != 'bugs' && $p != 'deconnexion') {
$template->assign('message','Impossible de rentrer en contact avec cette planète. Réessayez plus tard.');
$template->assign('titre','Planète isolée');
$template->assign('couleur','red');
$template->display('game/erreur.tpl');
exit;
}
}
///require_once(_FCORE."../game/ressources.php");
///require_once(_FCORE."../game/constructions.php");
require(_FCORE."../game/noms.php");
//> require_once(_FCORE."../game/flottes.php");
$template->assign('alertMail', $queryMail['nombre']);
$metal = $queryPlanete["metal"];
$cristal = $queryPlanete["cristal"];
$hydrogene = $queryPlanete["hydrogene"];
$queryPlanete["metalS"] = separerNombres($queryPlanete["metal"]);
$queryPlanete["cristalS"] = separerNombres($queryPlanete["cristal"]);
$queryPlanete["hydrogeneS"] = separerNombres($queryPlanete["hydrogene"]);
$queryPlanete["energieS"] = separerNombres($queryPlanete["energie"]);
$queryPlanete["nom_planete"] = htmlspecialchars($queryPlanete["nom_planete"]);
$template->assign('planete', $queryPlanete);
$template->assign('planete', $planete);
$template->assign('planetes', $queryPlanetes);
$template->assign('nomsressources', $ressourc);
//Calcul du nombre de cases restantes
$coun = count($batiment);
$caseRest = $queryPlanete['cases'];
for ($i=0 ; $i<$coun ; $i++) {
$caseRest -= $queryPlanete[$batimentVAR[$i]];
}
$template->assign('caseRest',$case-$caseRest);
$p = gpc('p');
//Isolement de la planète
if ($planete->isolement && $p != 'rename' && $p != 'accueil' && $p != 'arbre' && $p != 'prochainement' && $p != 'options' && $p != 'messagerie' && $p != 'envoyer' && $p != 'classement' && $p != 'bugs' && $p != 'deconnexion') {
$template->assign('titre','Planète isolée');
$isolement = explode(' ', $planete->isolement);
//TODO Si la planète est en isolement total, faire un autre message
erreur('Impossible de rentrer en contact avec cette planète.<br /> Réessayez vers '.date('H:i', $isolement[1]));
}
switch($p){
case 'prochainement':
$page = 'prochainement';
$titre = 'Prochainement';
break;
case 'version':
include(_FCORE."hb_game/jeu/version.php");
include(_FCORE."../game/jeu/version.php");
break;
case 'rename':
include(_FCORE."hb_game/jeu/rename.php");
include(_FCORE."../game/jeu/rename.php");
break;
case 'description':
include(_FCORE."hb_game/jeu/description.php");
include(_FCORE."../game/jeu/description.php");
break;
case 'batiments':
include(_FCORE."hb_game/jeu/batiments.php");
include(_FCORE."../game/jeu/batiments.php");
break;
case 'caserne':
include(_FCORE."../game/jeu/caserne.php");
break;
case 'chantierspatial':
include(_FCORE."hb_game/jeu/chantierspatial.php");
include(_FCORE."../game/jeu/chantierspatial.php");
break;
case 'chantierterrestre':
include(_FCORE."../game/jeu/chantierterrestre.php");
break;
case 'defenses':
include(_FCORE."hb_game/jeu/defenses.php");
include(_FCORE."../game/jeu/defenses.php");
break;
case 'laboratoire':
include(_FCORE."hb_game/jeu/laboratoire.php");
include(_FCORE."../game/jeu/laboratoire.php");
break;
case 'arbre':
include(_FCORE."hb_game/jeu/arbre.php");
include(_FCORE."../game/jeu/arbre.php");
break;
case 'gestion':
include(_FCORE."hb_game/jeu/gestion.php");
include(_FCORE."../game/jeu/gestion.php");
break;
case 'ressources':
include(_FCORE."hb_game/jeu/ressources.php");
include(_FCORE."../game/jeu/ressources.php");
break;
case 'flotte':
include(_FCORE."hb_game/jeu/flotte.php");
include(_FCORE."../game/jeu/flotte.php");
break;
case 'destinationsrapides':
include(_FCORE."../game/jeu/destinrapid.php");
break;
case 'amis':
include(_FCORE."../game/jeu/amis.php");
break;
case 'carte':
include(_FCORE."hb_game/jeu/carte.php");
include(_FCORE."../game/jeu/carte.php");
break;
case 'bourse':
include(_FCORE."hb_game/jeu/bourse.php");
include(_FCORE."../game/jeu/bourse.php");
break;
case 'options':
include(_FCORE."hb_game/jeu/options.php");
include(_FCORE."../game/jeu/options.php");
break;
case 'changeopt':
include(_FCORE."hb_game/jeu/options_change.php");
include(_FCORE."../game/jeu/options_change.php");
break;
case 'messagerie':
include(_FCORE."hb_game/jeu/messagerie.php");
include(_FCORE."../game/jeu/messagerie.php");
break;
case 'envoyer':
include(_FCORE."hb_game/jeu/envoyer.php");
include(_FCORE."../game/jeu/envoyer.php");
break;
case 'alliances':
include(_FCORE."hb_game/jeu/alliances.php");
include(_FCORE."../game/jeu/alliances.php");
break;
case 'classement':
include(_FCORE."hb_game/jeu/classement.php");
include(_FCORE."../game/jeu/classement.php");
break;
case 'bugs':
include(_FCORE."hb_game/jeu/bugs.php");
include(_FCORE."../game/jeu/bugs.php");
break;
case 'chat':
$page = 'chat'; $titre = 'Chat';
break;
case 'faq':
include(_FCORE."hb_game/jeu/aide.php");
include(_FCORE."../game/jeu/aide.php");
break;
case 'simulateur':
include(_FCORE."hb_game/jeu/simulateur.php");
include(_FCORE."../game/jeu/simulateur.php");
break;
case 'deconnexion':
include(_FCORE."hb_game/jeu/logout.php");
include(_FCORE."../game/jeu/logout.php");
break;
case 'operateur':
include(_FCORE."hb_game/jeu/operateur.php");
include(_FCORE."../game/jeu/operateur.php");
break;
case "demarrage":
include(_FCORE."../game/jeu/demarrage.php");
break;
case "avertmulti":
include(_FCORE."../game/jeu/avertmulti.php");
break;
case "pilori":
include(_FCORE."hb_game/jeu/pilori.php");
include(_FCORE."../game/jeu/pilori.php");
break;
case "conditions":
include(_FCORE."hb_game/jeu/conditions.php");
include(_FCORE."../game/jeu/conditions.php");
break;
case "regles":
include(_FCORE."hb_game/jeu/regles.php");
include(_FCORE."../game/jeu/regles.php");
break;
default:
include(_FCORE."hb_game/jeu/accueil.php");
include(_FCORE."../game/jeu/accueil.php");
}
$template->assign('page',$page);
$template->assign('titre',$titre);
$template->assign('page', $page);
$template->assign('titre', $titre);
$template->display('game/'.$page.'.tpl');
}
//Si le joueur n'est pas connecté au site
else {
//On traite la demande de loggin de l'utilisateur
if (isset($_GET['l']) && isset($_GET['p']) && isset($_GET['a'])) {
//Récupération des données POST
$HB_login = gpc('l');
$HB_password = gpc('p');
$HB_auth = gpc('a');
if ((isset($_GET['l']) && isset($_GET['p'])) || (isset($_POST['HB_login']) && isset($_POST['HB_password']))) {
//Récupération des données POST ou GET
if (isset($_POST['HB_login']) && isset($_POST['HB_password']) && gpc('p') == 'connexion') {
$HB_login = gpc('HB_login', 'post');
$HB_password = gpc('HB_password', 'post');
$HB_auth = hash("sha512", $HB_login.'Ņ♂↨'.$HB_password.'☻♫☼'.date('W!Y¨D@j'));
}
else {
$HB_login = gpc('l');
$HB_password = gpc('p');
$HB_auth = gpc('a');
}
if (empty($HB_login) || empty($HB_password)) {
$template->assign('message','Nom d\'utilisateur ou mot de passe incorrect.<br /><br />');
@ -271,7 +247,7 @@ else {
fclose($fichier);
}
$bdd->escape($HB_login);
if (!$var = $bdd->unique_query("SELECT mdp_var FROM $table_user WHERE pseudo = '$HB_login';")) {
if (!$var = $bdd->unique_query("SELECT mdp_var, mdp FROM $table_user WHERE pseudo = '$HB_login';")) {
if (isset($bruteforce['nombre'])) $bdd->query("UPDATE securite_identification SET nombre = nombre + 1 WHERE ip = '$ipe';");
else $bdd->query("INSERT INTO securite_identification VALUES ('$ipe', '1', '".time()."');");
$bdd->deconnexion();
@ -282,7 +258,7 @@ else {
exit;
}
$bdd->deconnexion();
if (empty($var['mdp_var'])) {
/*if (empty($var['mdp_var'])) {
$gen = rand(-2147483648, 2147483647);
if ($gen == 0) $gen = rand(1000000000, 2147483647);
$HB_passwordAnc = sha1(strtoupper($HB_login).':'.$HB_password);
@ -303,16 +279,16 @@ else {
$template->display('cms/erreur.tpl');
exit;
}
}
$HB_password = hash_var(strtoupper($HB_login).':'.$HB_password.'♂♪'.$var['mdp_var']);
}*/
$HB_password = mdp($HB_login, $HB_password, $var['mdp_var']);
//print 'mdp : '.$HB_password.' contre BDD : '.$var['mdp'];
$time = time();
$ip = $_SERVER["REMOTE_ADDR"];
$bdd->connexion();
$bdd->escape($HB_password);
//Limiter le nombre de personnes en ligne simutanément
$connecte = $bdd->unique_query("SELECT COUNT(xid) AS nombre FROM $table_sessions WHERE active = true AND var_session != '';");
if ($connecte['nombre'] > 1500) {
if ($enligne['enligne'] > 1500) {
$template->assign('message','Il y a actuellement trop de monde connecté sur Halo-Battle. Pour permettre aux joueurs une navigation convenable, nous vous remercions de revenir plus tard.');
$template->assign('couleur','red');
$template->display('cms/erreur.tpl');
@ -334,7 +310,7 @@ else {
exit;
}
if ($resultat['mv'] != 0) {
if ($resultat['mv'] > 0) {
if ($resultat['last_visite']+259200 > time() && $resultat['auth_level'] < 2) {
if ($resultat['mv'] == 3) $template->assign('message','Vous êtes définitivement banni de cette galaxie pour '.$resultat['raisonmv'].'. Vous ne pouvez plus vous reconnecter sur votre compte');
elseif ($resultat['mv'] == 2) $template->assign('message','Un opérateur a placé votre compte en mode vacances pour '.$resultat['raisonmv'].'. Vous ne pouvez pas vous reconnecter sur votre compte avant le<br />'.strftime("%A %d %B à %H:%M", $resultat['last_visite']+259200));
@ -348,7 +324,7 @@ else {
$bdd->query("UPDATE $table_planete SET timestamp = '".time()."' WHERE id_user = '$id';");
//On fait repartir à 0 les files d'attente
include_once(_FCORE."hb_game/Class/class.gerefile.php");
include_once(_FCORE."../game/Class/class.gerefile.php");
$cntplan = count($reqPlan);
for ($i = 0; $i < $cntplan; $i++) {
if (!empty($reqPlan[$i]['file_bat'])) {
@ -394,15 +370,21 @@ else {
$bdd->query("UPDATE $table_user SET last_visite = '$time', last_ip = '$ip' WHERE id = '$id';");
$bdd->query("INSERT INTO $table_registre_identification (id_util, ip) VALUES (".$id.",'".$ip."');");
$multi = $bdd->unique_query("SELECT COUNT(*) FROM $table_registre_identification WHERE ip = '$ip' GROUP BY ip, id_util");
$message = $bdd->unique_query("SELECT time FROM $table_messages_demarrage ORDER BY time DESC LIMIT 1;");
$bdd->deconnexion();
$sess->values['connected'] = TRUE;
$sess->values['id'] = $resultat['id'];
$sess->values['idPlan'] = $resultatP['id'];
$sess->values['auth_level'] = $resultat['auth_level'];
//Si on détecte le multi-compte, on interdit l'accès au panneau d'admin
if (empty($multi)) $sess->values['auth_level'] = 0;
else $sess->values['auth_level'] = $resultat['auth_level'];
$sess->put();
header('Location: ./?p=accueil');
if ($message['time'] > $resultat['last_visite']) header('Location: ./'.$config['first_page'].'?p=demarrage');
elseif (empty($multi)) header('Location: ./'.$config['first_page'].'?p=avertmulti');
else header('Location: ./'.$config['first_page'].'?p=accueil');
exit;
}
else {
@ -431,25 +413,25 @@ else {
break;*/
//Serveur de jeu
case "njoueur":
include(_FCORE."hb_game/jeu/njoueur.php");
include(_FCORE."../game/jeu/njoueur.php");
break;
case "inscription":
header('Location: http://halo-battle.s-fr.com/?p=inscription');
exit;
break;
case "oubliemdp":
include(_FCORE."hb_game/jeu/oubliemdp.php");
include(_FCORE."../game/jeu/oubliemdp.php");
break;
//Tous serveurs
case "conditions":
include(_FCORE."hb_game/jeu/conditions.php");
include(_FCORE."../game/jeu/conditions.php");
break;
case "regles":
include(_FCORE."hb_game/jeu/regles.php");
include(_FCORE."../game/jeu/regles.php");
break;
default:
//$page = 'mini';
header('Location: http://halo-battle.s-fr.com/?p=connexion');
$page = 'mini';
//header('Location: http://halo-battle.s-fr.com/?p=connexion');
//exit;
}
$template->display('cms/'.$page.'.tpl');

77
htdocs/java/index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -3,6 +3,10 @@ window.onload = function(){
document.getElementById('aide1').innerHTML = 'Pour vous repérer plus facilement entre vos différentes flottes, donnez-lui un nom.';
document.getElementById('aide2').innerHTML = '';
}
document.getElementById('fav_dest').onfocus = function(){
document.getElementById('aide1').innerHTML = 'Choisissez dans la liste une destination ou entrez les coordonnées directement dans les champs ci-après.';
document.getElementById('aide2').innerHTML = '';
}
document.getElementById('amas').onfocus = function(){
document.getElementById('aide1').innerHTML = 'Indiquez ici l\'amas de destination de votre flotte.';
document.getElementById('aide2').innerHTML = '';
@ -60,6 +64,29 @@ window.onload = function(){
document.getElementById('vp').innerHTML = "Chargement en cours ...";
tempsFlotte();
}
document.getElementById('metal').onkeyup = function(){
document.getElementById('vp').innerHTML = "Chargement en cours ...";
tempsFlotte();
}
document.getElementById('cristal').onkeyup = function(){
document.getElementById('vp').innerHTML = "Chargement en cours ...";
tempsFlotte();
}
document.getElementById('hydrogene').onkeyup = function(){
document.getElementById('vp').innerHTML = "Chargement en cours ...";
tempsFlotte();
}
document.getElementById('fav_dest').onchange = function(){
if (document.getElementById('fav_dest').value == "edit") {
window.open("?p=destinationsrapides");
document.getElementById('fav_dest').value = "0";
}
else {
document.getElementById('vp').innerHTML = "Chargement en cours ...";
tempsFlotte();
}
}
}
function tempsFlotte() {
@ -68,12 +95,14 @@ function tempsFlotte() {
'ajax_flotte.php',
{
method: 'post',
parameters: {nom: document.getElementById('nom').value, mission: document.getElementById('mission').value, hyd: document.getElementById('hydrogene').value, galaxie: document.getElementById('amas').value, ss: document.getElementById('ss').value, pos: document.getElementById('plan').value, vitesse: document.getElementById('vitesse').value},
parameters: {fav_dest: document.getElementById('fav_dest').value, nom: document.getElementById('nom').value, mission: document.getElementById('mission').value, met: document.getElementById('metal').value, cri: document.getElementById('cristal').value, hyd: document.getElementById('hydrogene').value, galaxie: document.getElementById('amas').value, ss: document.getElementById('ss').value, pos: document.getElementById('plan').value, vitesse: document.getElementById('vitesse').value},
onSuccess: function(transport, json) {
document.getElementById('destination').innerHTML = json.root.destination;
document.getElementById('temps').innerHTML = json.root.temps;
document.getElementById('conso').innerHTML = json.root.conso;
document.getElementById('deblok').innerHTML = json.root.deblok;
document.getElementById('tactique').innerHTML = json.root.tactique;
document.getElementById('placesRest').innerHTML = json.root.places;
document.getElementById('vp').innerHTML = "";
}
}

77
htdocs/js/index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>

View file

@ -3,6 +3,7 @@ define("INDEX", 1);
$chrono_start = microtime();
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
define("_FCORE",trim($onyx));
define("xCSRF",true);
require_once(_FCORE."common.php");
$id = gpc('i');
@ -13,11 +14,11 @@ $s = gpc('s');
header ("Content-type: image/png");
if (file_exists(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign") && time() - filemtime(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign") < $config['cache']['signatures']) {
readfile(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign");
if (file_exists(_FCORE."hb_game/cache/signatures/".$id.".".$f.$s.".sign") && time() - filemtime(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign") < $config['cache']['signatures']) {
readfile(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
}
else {
$fontfile = _FCORE."hb_game/signatures/ARIAL.TTF";
$fontfile = _FCORE."../game/signatures/ARIAL.TTF";
$bdd->connexion();
$bdd->escape($id);
@ -32,7 +33,7 @@ else {
switch($s){
case 1:
$img = 'mixte1userbarju7.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
$contenu = imagecolorallocate($_img, 255, 255, 255);
$infos = array(
@ -56,7 +57,7 @@ else {
break;
default:
$img = 'mixte1userbarju7.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
$contenu = imagecolorallocate($_img, 255, 255, 255);
$infos = array(
@ -78,14 +79,14 @@ else {
)
);
}
if ($joueur['race'] == 'covenant') $_imgavatar = imagecreatefrompng(_FCORE."hb_game/signatures/covi.png");
else $_imgavatar = imagecreatefrompng(_FCORE."hb_game/signatures/hum.png");
if ($joueur['race'] == 'covenant') $_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/covi.png");
else $_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/hum.png");
}
elseif ($joueur['race'] == 'covenant') {
switch($f){
case 1:
$img = 'userbarallicopygs1.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
$contenu = imagecolorallocate($_img, 255, 255, 255);
$infos = array(
@ -109,7 +110,7 @@ else {
break;
default:
$img = 'covenantuserbarus1.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
$contenu = imagecolorallocate($_img, 0, 0, 0);
$infos = array(
@ -131,13 +132,13 @@ else {
)
);
}
$_imgavatar = imagecreatefrompng(_FCORE."hb_game/signatures/covi.png");
$_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/covi.png");
}
else {
switch($f){
case 1:
$img = 'userbarallicopygs1.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
$contenu = imagecolorallocate($_img, 255, 255, 255);
$infos = array(
@ -161,7 +162,7 @@ else {
break;
default:
$img = 'humainuserbarhz2.png';
$_img = imagecreatefrompng(_FCORE."hb_game/signatures/".$img);
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
$entete = imagecolorallocate($_img, 255, 255, 255);
//$contenu = imagecolorallocate($_img, 160, 160, 0);
$contenu = imagecolorallocate($_img, 255, 255, 255);
@ -184,7 +185,7 @@ else {
)
);
}
$_imgavatar = imagecreatefrompng(_FCORE."hb_game/signatures/hum.png");
$_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/hum.png");
}
$blanc = imagecolorallocate($_img, 255, 255, 255);
@ -196,7 +197,7 @@ else {
if ($joueur == false) {
ImageTTFText($_img, 20, -20, 123, 17, $rouge, $fontfile, 'Joueur introuvable !');
if (file_exists(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign")) unlink(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign");
if (file_exists(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign")) unlink(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
}
else {
if ($joueur['auth_level'] > 4) ImageTTFText($_img, 12, 0, 45, 23, $vert, $fontfile, ucfirst($joueur['pseudo']));
@ -227,8 +228,8 @@ else {
if ($joueur == false) imagepng($_img);
else {
imagepng($_img, _FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign");
readfile(_FCORE."hb_game/signatures/cache/".$id.".".$f.$s.".sign");
imagepng($_img, _FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
readfile(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
}
}
?>

34
htdocs/taches.php Normal file
View file

@ -0,0 +1,34 @@
<?php
if(!defined('INDEX')) define('INDEX', 1);
if(!defined('CRON')) define('CRON', 1);
ob_start();
print 'Début des taches cron ; il est : '.date('d/m/Y H:i:s');
set_time_limit(0);
ignore_user_abort(true);
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
define("_FCORE",trim($onyx));
require_once(_FCORE."kernel.php");
require_once(_FCORE."../game/function.php");
require_once(_FCORE."../game/tables.php");
require_once(_FCORE."../game/vars.php");
$bdd = new bdd();
if (date('a') == 'am') {
include(_FCORE."../game/cron/suppr_joueurs.php");
include(_FCORE."../game/cron/inactifs.php");
include(_FCORE."../game/cron/bourse.php");
}
else print '<br />Heure PM : on passe les taches matinales';
include(_FCORE."../game/cron/sauvebdd.php");
//include(_FCORE."../game/cron/classement.php");
print '<br />Fin des taches cron ; il est : '.date('d/m/Y H:i:s');
$out = ob_get_contents();
$fichier = fopen(_FCORE."logs/".strftime('%d-%m-%Y-%H-cron').".xlog",'a+');
fwrite($fichier, str_replace('<br />', "\n", $out));
fclose($fichier);
?>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: - Erreur</title>
<style type="text/css">
html
{
font-size: 100%;
}
body
{
background-color: #000000;
}
div
{
background-color: #080819;
text-align: center;
margin: 10% auto 0 auto;
padding: 25px 0;
width: 80%;
border-top: #FFFFFF dotted 1px;
border-left: #FFFFFF dotted 1px;
border-right: #FFFFFF solid 3px;
border-bottom: #FFFFFF solid 3px;
}
h1
{
font-size: 3em;
color: #FFFFFF;
}
h2
{
font-size: 2em;
color: #FFFFFF;
}
h3
{
font-size: 1.5em;
color: #FFFFFF;
font-weight: normal;
}
a
{
position: absolute;
bottom: 20px;
right: 30px;
font-size: 0.8em;
display: block;
padding: 5px 10px;
background-color: #FFFFFF;
color: #000000;
text-decoration: underline;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<h2>Erreur</h2>
<h1>403</h1>
<h3>Refus de traitement de la requête.<br /><em>Forbidden.</em></h3>
</div>
<a href="/">HALO-BATTLE</a>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés -->
</body>
</html>