@@ -1,21 +0,0 @@ | |||||
<?php | |||||
session_start(); | |||||
if($_SESSION['status']!=1) | |||||
header("location:index.php"); | |||||
$status=$_SESSION['status']; | |||||
?> | |||||
<?php | |||||
if($status == 1): | |||||
?> | |||||
<div class="alert alert-success">Connecté !</div> | |||||
<?php | |||||
elseif($status == 0): | |||||
?> | |||||
<div class="alert alert-info">Permissions insufisantes.</div> | |||||
<?php | |||||
endif; | |||||
?> | |||||
<br /><br /> |
@@ -0,0 +1,6 @@ | |||||
<?php | |||||
include "header.php"; | |||||
$hash=md5($email); | |||||
unlink("medias/".$hash."/".$_GET['player']); | |||||
header("location:index.php"); | |||||
?> |
@@ -0,0 +1,31 @@ | |||||
<?php | |||||
function connecte($base) | |||||
{ | |||||
$hote="localhost"; | |||||
$utilisateur="ecomonde"; | |||||
$pass="proot"; | |||||
if(!isset($connexion)) | |||||
{ | |||||
$connexion=mysql_connect($hote,$utilisateur,$pass) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Connexion au serveur impossible !</div>"); | |||||
$db=mysql_select_db($base,$connexion) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Selection de la base $base impossible !</div>"); | |||||
} | |||||
mysql_query("SET NAMES UTF8"); | |||||
} | |||||
function requete1l($sql) | |||||
{ | |||||
$resultat=mysql_query($sql) or die("<div class='alert alert-danger'><strong>ERREUR : </strong>Requete $sql problematique !</div>"); | |||||
$ligne=mysql_fetch_array($resultat); | |||||
return $ligne; | |||||
} | |||||
session_start(); | |||||
$status=$_SESSION['status']; | |||||
connecte("ecomonde"); | |||||
$sql="SELECT * FROM membres WHERE id='$status'"; | |||||
$res=mysql_query($sql) or die("Erreur de requete $sql"); | |||||
while ($ligne=mysql_fetch_array($res)) { | |||||
extract($ligne); | |||||
$hash=md5($email); | |||||
} | |||||
?> |
@@ -1,10 +1,26 @@ | |||||
<?php | |||||
session_start(); | |||||
$status=$_SESSION['status']; | |||||
$hash=md5("contact@heuzef.com"); | |||||
<?php include "header.php"; | |||||
$message[0]=''; | |||||
$message[1]=' | |||||
<div class="col-lg-6 alert alert-dismissable alert-success"> | |||||
<button type="button" class="close" data-dismiss="alert">X</button> | |||||
<h4>C\'est bon !</h4> | |||||
<p>Vous pouvez à présent vous connecter pour commencer à configurer votre partie.</p>'; | |||||
$message[2]=' | |||||
<div class="col-lg-6 alert alert-dismissable alert-warning"> | |||||
<button type="button" class="close" data-dismiss="alert">X</button> | |||||
<h4>Hey !</h4> | |||||
<p>Vous avez déjà un compte !</p>'; | |||||
$message[3]=' | |||||
<div class="col-lg-6 alert alert-dismissable alert-danger"> | |||||
<button type="button" class="close" data-dismiss="alert">X</button> | |||||
<h4>Erreur !</h4> | |||||
<p>Votre email/mot de passe est invalide !</p>'; | |||||
$message[4]=' | |||||
<div class="col-lg-6 alert alert-dismissable alert-info"> | |||||
<button type="button" class="close" data-dismiss="alert">X</button> | |||||
<h4>Oups !</h4> | |||||
<p>Vous devez vous connecter pour pouvoir jouer ;)</p>'; | |||||
?> | ?> | ||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html lang="fr"> | <html lang="fr"> | ||||
<head> | <head> | ||||
@@ -15,7 +31,6 @@ $hash=md5("contact@heuzef.com"); | |||||
<link rel="stylesheet" href="./css/bootswatch.min.css"> | <link rel="stylesheet" href="./css/bootswatch.min.css"> | ||||
<link rel="stylesheet" href="./css/ecomonde.css"> | <link rel="stylesheet" href="./css/ecomonde.css"> | ||||
</head> | </head> | ||||
<body> | <body> | ||||
<div class="container-fluid"> | <div class="container-fluid"> | ||||
<div class="col-lg-1"></div> | <div class="col-lg-1"></div> | ||||
@@ -37,8 +52,8 @@ $hash=md5("contact@heuzef.com"); | |||||
<li><a href="https://github.com/heuzef/ecomonde"><i class="glyphicon glyphicon-new-window"></i> GITHUB</a></li> | <li><a href="https://github.com/heuzef/ecomonde"><i class="glyphicon glyphicon-new-window"></i> GITHUB</a></li> | ||||
</ul> | </ul> | ||||
<ul class="nav navbar-nav navbar-right"> | <ul class="nav navbar-nav navbar-right"> | ||||
<?php if($status == 1): ?> | |||||
<li><?php echo '<img src="http://gravatar.com/avatar/'.$hash.'?s=50" alt="gravatar" />'; ?> <strong>HEUZEF</strong></li> | |||||
<?php if($status != 0): ?> | |||||
<li><?php echo '<img class="img-circle" src="http://gravatar.com/avatar/'.$hash.'?s=50" alt="gravatar" />'; ?> <strong><?php echo strtoupper($pseudo); ?></strong></li> | |||||
<li><a href="logout.php"><i class="glyphicon glyphicon-log-out"></i> DECONNEXION</a></li> | <li><a href="logout.php"><i class="glyphicon glyphicon-log-out"></i> DECONNEXION</a></li> | ||||
<?php elseif($status == 0): ?> | <?php elseif($status == 0): ?> | ||||
<li><a data-toggle="modal" data-target="#modal_login"><i class="glyphicon glyphicon-log-in"></i> CONNEXION</a></li> | <li><a data-toggle="modal" data-target="#modal_login"><i class="glyphicon glyphicon-log-in"></i> CONNEXION</a></li> | ||||
@@ -51,8 +66,26 @@ $hash=md5("contact@heuzef.com"); | |||||
</div> | </div> | ||||
<hr /> | <hr /> | ||||
<?php if(isset($_GET["msg"])){?> | |||||
<div class="container-fluid"> | |||||
<div class="col-lg-3"></div> | |||||
<?php echo $message[$_GET["msg"]]; ?> | |||||
</div> | |||||
<div class="col-lg-3"></div> | |||||
</div> | |||||
<?php } else {} ?> | |||||
<?php if($status != 0):?> | |||||
<div class="container-fluid"> | |||||
<div class="col-lg-3"></div> | |||||
<div class="col-lg-6 alert alert-dismissable alert-info"> | |||||
<button type="button" class="close" data-dismiss="alert">X</button> | |||||
<p><i class="glyphicon glyphicon-wrench"></i> EcoMonde est encore en Beta, certaines fonctions ne sont pas encore disponibles.</p> | |||||
</div> | |||||
<div class="col-lg-3"></div> | |||||
</div> | |||||
<?php if($status == 1): ?> | |||||
<div class="container-fluid"> | <div class="container-fluid"> | ||||
<div class="col-lg-1"></div> | <div class="col-lg-1"></div> | ||||
<div class="col-lg-3"> | <div class="col-lg-3"> | ||||
@@ -64,16 +97,16 @@ $hash=md5("contact@heuzef.com"); | |||||
<p> | <p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
<a href="#" class="btn btn-default btn-lg"><i class="glyphicon glyphicon-plus"></i> Créer un joueur</a> | |||||
<a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-plus"></i> Créer un joueur</a> | |||||
</p> | </p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
<a href="#" class="btn btn-default btn-lg"><i class="glyphicon glyphicon-import"></i> Importer un joueur (.XML)</a> | |||||
<a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-import"></i> Importer un joueur (.XML)</a> | |||||
</p> | </p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
<div class="btn-group"> | <div class="btn-group"> | ||||
<a href="#" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown"> | |||||
<a href="#" class="btn btn-default btn-lg dropdown-toggle disabled" data-toggle="dropdown"> | |||||
<i class="glyphicon glyphicon-music"></i> Changer les musiques | <i class="glyphicon glyphicon-music"></i> Changer les musiques | ||||
<span class="caret"></span> | <span class="caret"></span> | ||||
</a> | </a> | ||||
@@ -92,11 +125,7 @@ $hash=md5("contact@heuzef.com"); | |||||
</p> | </p> | ||||
<hr /> | <hr /> | ||||
<p> | <p> | ||||
<a href="#" class="btn btn-default btn-lg"><i class="glyphicon glyphicon-map-marker"></i> Changer la carte</a> | |||||
</p> | |||||
<hr /> | |||||
<p> | |||||
<a href="play" class="btn btn-danger btn-lg"><i class="glyphicon glyphicon-remove"></i> Supprimer votre partie</a> | |||||
<a href="#" class="btn btn-default btn-lg disabled"><i class="glyphicon glyphicon-map-marker"></i> Changer la carte</a> | |||||
</p> | </p> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -145,7 +174,7 @@ $hash=md5("contact@heuzef.com"); | |||||
} | } | ||||
foreach($xml->entry as $entry) { | foreach($xml->entry as $entry) { | ||||
echo '<tr class="active"> | echo '<tr class="active"> | ||||
<td><a href="#" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a> <a href="./medias/'.$hash.'/'.$fichier.'" target="_blank" class="btn btn-success btn-xs"><i class="glyphicon glyphicon-export"></i></a></td> | |||||
<td><a href="del.php?player='.$fichier.'" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a> <a href="./medias/'.$hash.'/'.$fichier.'" target="_blank" class="btn btn-success btn-xs"><i class="glyphicon glyphicon-export"></i></a></td> | |||||
<td>'.$entry->nom.'</td> | <td>'.$entry->nom.'</td> | ||||
<td>'.$entry->hp.'</td> | <td>'.$entry->hp.'</td> | ||||
<td>'.$entry->xp.'</td> | <td>'.$entry->xp.'</td> | ||||
@@ -234,7 +263,8 @@ $hash=md5("contact@heuzef.com"); | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="modal-footer"> | <div class="modal-footer"> | ||||
<button type="submit" class="btn btn-info">Connexion</button> | |||||
<a href="mailto:contact@heuzef.com?subject=Contact%20depuis%20heuzef.com" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=contact@heuzef.com&cc=&bcc=&su=[EcoMonde]%20Probleme%20avec%20mon%20compte&body=Bonjour,','_blank');return false;">Un problème avec votre compte ?</a> | |||||
<button type="submit" class="btn btn-info">Connexion</button> | |||||
</div> | </div> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player1</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player2</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player3</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player1</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player2</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -0,0 +1,18 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player3</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -1,6 +1,4 @@ | |||||
<?php $hash=md5("contact@heuzef.com"); ?> | |||||
<?php | |||||
<?php include "../header.php"; | |||||
$nom_modif=""; | $nom_modif=""; | ||||
@@ -1,4 +1,5 @@ | |||||
<?php $hash=md5("contact@heuzef.com"); ?> | |||||
<?php include "../header.php" ?> | |||||
<?php if($status != 0): ?> | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html lang="fr"> | <html lang="fr"> | ||||
@@ -146,4 +147,8 @@ | |||||
<script src="../js/bootstrap.min.js"></script> | <script src="../js/bootstrap.min.js"></script> | ||||
<script src="../js/bootswatch.js"></script> | <script src="../js/bootswatch.js"></script> | ||||
</body> | </body> | ||||
</html> | |||||
</html> | |||||
<?php elseif($status == 0): | |||||
header("location:../index.php?msg=4"); | |||||
endif; ?> |
@@ -1,6 +1,5 @@ | |||||
<?php $hash=md5("contact@heuzef.com"); ?> | |||||
<?php include "../header.php" | |||||
<?php | |||||
$sample=$_GET["sample"]; | $sample=$_GET["sample"]; | ||||
if ($sample=="soft.mp3") { | if ($sample=="soft.mp3") { | ||||
@@ -1,38 +1,28 @@ | |||||
<?php | |||||
function connecte($base) | |||||
{ | |||||
$hote="localhost"; | |||||
$utilisateur="ecomonde"; | |||||
$pass="proot"; | |||||
if(!isset($connexion)) | |||||
{ | |||||
$connexion=mysql_connect($hote,$utilisateur,$pass) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Connexion au serveur impossible !</div>"); | |||||
$db=mysql_select_db($base,$connexion) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Selection de la base $base impossible !</div>"); | |||||
} | |||||
mysql_query("SET NAMES UTF8"); | |||||
} | |||||
function requete1l($sql) | |||||
{ | |||||
$resultat=mysql_query($sql) or die("<div class='alert alert-danger'><strong>ERREUR : </strong>Requete $sql problematique !</div>"); | |||||
$ligne=mysql_fetch_array($resultat); | |||||
return $ligne; | |||||
} | |||||
<?php | |||||
include "header.php"; | |||||
connecte("ecomonde"); | connecte("ecomonde"); | ||||
$pseudo=$_POST['pseudo']; | $pseudo=$_POST['pseudo']; | ||||
$pass=$_POST['pass']; | |||||
$pass=sha1($_POST['pass']); | |||||
$email=$_POST['email']; | $email=$_POST['email']; | ||||
$hash=md5($email); | |||||
$check_email=requete1l("SELECT * FROM membres WHERE email='$email'"); | $check_email=requete1l("SELECT * FROM membres WHERE email='$email'"); | ||||
if ($email = $check_email) { | |||||
echo "Vous avez déjà un compte !"; | |||||
if ($check_email) { | |||||
header("location:index.php?msg=2"); | |||||
} | } | ||||
else { | else { | ||||
$sql="INSERT INTO membres VALUES(NULL,'$pseudo','$pass','$email')"; | |||||
mysql_query($sql) or die("ERREUR !"); | |||||
if($sql) header("location:index.php"); | |||||
$sql="INSERT INTO membres VALUES(NULL,'$pseudo','$pass','$email')"; | |||||
mysql_query($sql) or die("ERREUR !"); | |||||
mkdir("medias/".$hash."/"); | |||||
copy("medias/default/player1.xml", "medias/".$hash."/player1.xml"); | |||||
copy("medias/default/player2.xml", "medias/".$hash."/player2.xml"); | |||||
copy("medias/default/player3.xml", "medias/".$hash."/player3.xml"); | |||||
copy("medias/default/map.jpg", "medias/".$hash."/map.jpg"); | |||||
copy("medias/default/soft.mp3", "medias/".$hash."/soft.mp3"); | |||||
copy("medias/default/tonic.mp3", "medias/".$hash."/tonic.mp3"); | |||||
copy("medias/default/hard.mp3", "medias/".$hash."/hard.mp3"); | |||||
copy("medias/default/light.mp3", "medias/".$hash."/light.mp3"); | |||||
copy("medias/default/dark.mp3", "medias/".$hash."/dark.mp3"); | |||||
header("location:index.php?msg=1"); | |||||
} | } | ||||
?> | ?> |
@@ -22,17 +22,17 @@ function requete1l($sql) | |||||
} | } | ||||
$email=$_POST['email']; | $email=$_POST['email']; | ||||
$password=$_POST['password']; | |||||
$password=sha1($_POST['password']); | |||||
connecte("ecomonde"); | connecte("ecomonde"); | ||||
$ligne=requete1l("SELECT * FROM membres WHERE email='$email' AND pass='$password'"); | $ligne=requete1l("SELECT * FROM membres WHERE email='$email' AND pass='$password'"); | ||||
if($ligne=="") | if($ligne=="") | ||||
header("location:index.php"); | |||||
header("location:index.php?msg=3"); | |||||
else | else | ||||
{ | { | ||||
$_SESSION['status']=1; | |||||
extract($ligne); | extract($ligne); | ||||
$_SESSION['status']=$id; | |||||
header("location:index.php"); | header("location:index.php"); | ||||
} | } |