Commit initial sur GitLab
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
|
||||
<?php
|
||||
$AdminDir = str_replace("administration", "",dirname(__FILE__));
|
||||
session_start();
|
||||
require_once(''.$AdminDir.'user/config.php');
|
||||
include("".$MainDir."files/navheader.php");
|
||||
include(''.$MainDir.'files/check_status.php');
|
||||
|
||||
$page_name='Rédaction d\'article';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
|
||||
if($connected=="1"){
|
||||
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($admin_mode=="1"){
|
||||
|
||||
|
||||
echo'
|
||||
<form action="'.$root_path.'files/submit_article.php" method="post">
|
||||
<b>Titre</b> :<br />
|
||||
<input type="text" name="titre" /><br />
|
||||
<b>Article</b> :
|
||||
<br />
|
||||
<textarea name="article" cols="60" rows="10"></textarea><br />
|
||||
<input type="submit" value="Envoyer !!" />';
|
||||
|
||||
}else{
|
||||
|
||||
echo"<br><br>Tu n'es pas admin !";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
echo"<br><br>Tu n'es pas connecté !";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
$AdminDir = str_replace("administration", "",dirname(__FILE__));
|
||||
require_once(''.$AdminDir.'user/config.php');
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
|
||||
|
||||
|
||||
$article_id_edit_page=$_GET['id'];
|
||||
|
||||
$sql="SELECT * FROM article WHERE id_article='$article_id_edit_page'";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$article_data = mysql_fetch_assoc($req);
|
||||
|
||||
include("".$MainDir."files/navheader.php");
|
||||
|
||||
|
||||
|
||||
$page_name='Edition de l\'article "'.$article_data['titre'].'"';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
|
||||
?>
|
||||
<form action='<?php echo $root_path; ?>files/submit_edit.php?id=<?php echo $article_id_edit_page; ?>' method='post'>
|
||||
<b>Titre</b> :<br />
|
||||
<input value="<?php echo htmlspecialchars(stripslashes($article_data['titre'])); ?>" type='text' name='titre' /><br />
|
||||
<b>Article</b> :
|
||||
<br />
|
||||
<textarea name='article' cols='60' rows='10'><?php echo htmlspecialchars(stripslashes($article_data['article'])); ?></textarea><br />
|
||||
<input type='submit' value='Envoyer !!' />
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
$AdminDir = str_replace("administration", "",dirname(__FILE__));
|
||||
require_once(''.$AdminDir.'user/config.php');
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
|
||||
|
||||
|
||||
$page_id_edit_page=$_GET['id'];
|
||||
|
||||
$sql="SELECT * FROM page WHERE id_page='$page_id_edit_page'";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$page_data = mysql_fetch_assoc($req);
|
||||
|
||||
include("".$MainDir."files/navheader.php");
|
||||
|
||||
|
||||
|
||||
$page_name='Edition de la page "'.$page_data['titre'].'"';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
//echo'<title>Edition de la page "'.$page_data['titre'].'"</title>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form action='<?php echo $root_path ?>files/submit_edit_page.php?id=<?php echo $page_id_edit_page ?>' method='post'>
|
||||
<b>Titre</b> :<br />
|
||||
<input value="<?php echo htmlspecialchars($page_data['titre']); ?>" type='text' name='titre' /><br />
|
||||
<b>Page</b> :
|
||||
<br />
|
||||
<textarea name='page' cols='60' rows='10'><?php echo htmlspecialchars(stripslashes($page_data['page'])); ?></textarea><br />
|
||||
<input type='submit' value='Envoyer !!' />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?php
$AdminDir = str_replace("administration", "",dirname(__FILE__));
require_once(''.$AdminDir.'user/config.php');
if(!@$_SESSION['session'])
{
session_start();
}
if(@$_SESSION['session']){
require_once(''.$MainDir.'user/verifications.php');
}
include("".$MainDir."files/navheader.php");
$page_name='Administration';
include_once(''.$MainDir.'user/top.php');
if(@$_SESSION['session'])
{
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
mysql_select_db(DB_DB);
$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$user_ranking = mysql_fetch_assoc($req);
$user_rank="$user_ranking[user_rank]";
$sql="SELECT * FROM blog_config";
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$config_blog_page_admin = mysql_fetch_assoc($req);
$description = $config_blog_page_admin['description'];
$static_homepage_status = $config_blog_page_admin['static_homepage_status'];
echo("<br>Etat utilisateur : Connecté <br>");
echo "<br>";
echo("Votre rang est : ".$user_ranking['user_rank'].". ");
if($user_rank!=1){
echo("Vous n'êtes pas administrateur ! Vous ne pouvez pas accéder à cette partie du site.");
}else{
echo("
<br>
<br>
<form method='post' action='{$root_path}files/submit_blog_config.php' enctype='multipart/form-data'>
<table width='400' border='0' align='center'>
<tr>
<td colspan='2'><h2>Modification des Paramètres du blog</h2></td>
</tr>
<tr>
<td><label for='titre'>Titre : </label></td>
<td><input value='".htmlspecialchars($site_name)."' name='titre' type='text' id='titre' /></td>
</tr>
<tr>
<td><label for='description'>Description : </label></td>
<td><input value='".htmlspecialchars($description)."' name='description' type='text' id='description' /></td>
</tr>
<tr>
<td><label for='bandeau'>Bandeau : </label></td>");
echo'<td><input value="'.htmlspecialchars($bandeau).'" name="bandeau" type="text" id="bandeau" /></td>';
echo("
</tr>
<tr>
<td><label for='passwd2'>J-DANIEL: </label></td>
<td><input name='passwd2' type='password' id='passwd2' /></td>
</tr>
<tr>
<td><label for='static_homepage_status'>Static Home Page (Set to 1 to enable.) : </label></td>
<td><input value='".htmlspecialchars($static_homepage_status)."' name='static_homepage_status' type='text' id='static_homepage_status' /></td>
</tr>
<tr>
<td><div align='center'><input type='submit' value='GO!' /></div></td>
</tr>
</table>
</form>
</div>
<center><a href=''.$root_path.'index.php'>Back</a></center>
<br><br><a href='article_ecrire.php'>Ecrire un article !</a>
<br><a href='page_ecrire.php'>Ecrire une page !</a>
");
if($static_homepage_status=="1" && $static_homepage_id!=NULL){
$sql_page="SELECT * FROM page WHERE id_page=".$static_homepage_id."";
$req_page = mysql_query($sql_page) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$data_page=mysql_fetch_assoc($req_page);
echo "<br><br>Actuellement la page {$data_page['titre']} est définie comme page d'accueil !<br><br>";
}elseif($static_homepage_status=="1"){
echo"Vous n'avez pas encore défini de page d'accueil.<br><br>";
}
}
?>
<?php
}else{
echo"<br>Etat utilisateur : Déconnecté <br>
<br>Veuillez vous <a href='".$root_path."user/'>connecter</a> pour accéder à cette page.";
}
include_once(''.$MainDir.'user/bottom.php');
?>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
$AdminDir = str_replace("administration", "",dirname(__FILE__));
|
||||
session_start();
|
||||
require_once(''.$AdminDir.'user/config.php');
|
||||
include("".$MainDir."files/navheader.php");
|
||||
include(''.$MainDir.'files/check_status.php');
|
||||
|
||||
$page_name='Rédaction de page';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
|
||||
if($connected=="1"){
|
||||
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($admin_mode=="1"){
|
||||
|
||||
|
||||
echo'<form action="'.$root_path.'files/submit_page.php" method="post">
|
||||
<b>Titre</b> :<br />
|
||||
<input type="text" name="titre" /><br />
|
||||
<b>Page</b> :
|
||||
<br />
|
||||
<textarea name="page" cols="60" rows="10"></textarea><br />
|
||||
<input type="submit" value="Envoyer !!" />';
|
||||
}else{
|
||||
|
||||
echo"<br><br>Tu n'es pas admin !";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
echo"<br><br>Tu n'es pas connecté !";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
$FilesDir = str_replace("files", "",dirname(__FILE__));
|
||||
session_start();
|
||||
|
||||
|
||||
require_once(''.$FilesDir.'user/config.php');
|
||||
include("".$MainDir."files/navheader.php");
|
||||
|
||||
$page_name='Confirmation de suppression';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
|
||||
if(!@$_SESSION['session'])
|
||||
{
|
||||
|
||||
echo"<br><br>Vous ne pouvez pas effectuer cette opération si vous n'êtes pas connecté(e).";
|
||||
}
|
||||
if(@$_SESSION['session']){
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
include("".$MainDir."files/check_admin.php");
|
||||
|
||||
|
||||
|
||||
$this_article_id=$_GET['id'];
|
||||
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
|
||||
$sql="SELECT * FROM article";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_articles=mysql_fetch_assoc($req);
|
||||
|
||||
$confirmed="0";
|
||||
|
||||
if($admin_mode == "1"){
|
||||
|
||||
if(isset($_POST['oui'])){
|
||||
|
||||
|
||||
$confirmed="1";
|
||||
|
||||
if(($_POST['oui']=="Oui"))
|
||||
{
|
||||
|
||||
mysql_query("DELETE FROM article WHERE id_article='$this_article_id'") or die ('error : '.mysql_error());
|
||||
|
||||
|
||||
echo "<br><br>Opération effectuée ! <a href='".$root_path."'>Retour</a>";
|
||||
}
|
||||
}
|
||||
if(($confirmed=="0")){
|
||||
|
||||
echo'<br><br>Etes-vous certain de vouloir supprimer cet article ?!!
|
||||
<br><br>
|
||||
<form action="'.$root_path.'files/article_suppression.php?id='.$this_article_id.'" method="post">
|
||||
<input name="oui" type="submit" value="Oui">
|
||||
<a href="'.$root_path.'"><input type="button" value="Euh, non en fin de compte."></a>';
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
echo"<br><br>Mais que fais-tu ignorant ? Tu n'es pas administrateur !";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$user_ranking = mysql_fetch_assoc($req);
|
||||
$user_rank="$user_ranking[user_rank]";
|
||||
|
||||
if($user_rank==1){
|
||||
|
||||
$admin_mode = "1";
|
||||
|
||||
}else{
|
||||
$admin_mode = "0";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
if(@!$_SESSION['session'])
|
||||
{
|
||||
|
||||
$connected="0";
|
||||
}
|
||||
if(@$_SESSION['session'])
|
||||
{
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
$connected="1";
|
||||
|
||||
|
||||
|
||||
$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$user_ranking = mysql_fetch_assoc($req);
|
||||
$user_rank="$user_ranking[user_rank]";
|
||||
if($user_rank==1){
|
||||
|
||||
$admin_mode = "1";
|
||||
|
||||
}else{
|
||||
$admin_mode = "0";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$user_panel = "User Panel";
|
||||
$administration = "Control Panel";
|
||||
$home_display = "Home";
|
||||
$article_title_display = "Title";
|
||||
$article_date_display = "Date";
|
||||
$article_article_display = "Article";
|
||||
$page_title_display = "Title";
|
||||
$page_date_display = "Date";
|
||||
$page_page_display = "Page";
|
||||
?>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$user_panel = "Panneau Utilisateur";
|
||||
$administration = "Administration";
|
||||
$home_display = "Accueil";
|
||||
$article_title_display = "Titre";
|
||||
$article_date_display = "Date";
|
||||
$article_article_display = "Article";
|
||||
$page_title_display = "Titre";
|
||||
$page_date_display = "Date";
|
||||
$page_page_display = "Page";
|
||||
?>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
$FilesDir = str_replace("files", "",dirname(__FILE__));
|
||||
|
||||
require_once''.$FilesDir.'user/config.php';
|
||||
echo '<b>Menu</b> | <a href="'.$root_path.'">'.$home_display.'</a> | <a href="'.$root_path.'user">'.$user_panel.'</a> | <a href="'.$root_path.'administration">'.$administration.'</a>
|
||||
<br>_____________________________________________';
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
$FilesDir = str_replace("files", "",dirname(__FILE__));
|
||||
session_start();
|
||||
|
||||
require_once(''.$FilesDir.'user/config.php');
|
||||
include("".$MainDir."files/navheader.php");
|
||||
|
||||
$page_name='Confirmation de suppression de page';
|
||||
include_once(''.$MainDir.'user/top.php');
|
||||
|
||||
if(!@$_SESSION['session'])
|
||||
{
|
||||
|
||||
echo"<br><br>Vous ne pouvez pas effectuer cette opération si vous n'êêtes pas connecté.";
|
||||
}
|
||||
if(@$_SESSION['session']){
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
include("".$MainDir."files/check_admin.php");
|
||||
|
||||
|
||||
|
||||
$this_page_id=$_GET['id'];
|
||||
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
|
||||
$sql="SELECT * FROM page";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_pages=mysql_fetch_assoc($req);
|
||||
|
||||
$confirmed="0";
|
||||
|
||||
if($admin_mode == "1"){
|
||||
|
||||
if(isset($_POST['oui'])){
|
||||
|
||||
|
||||
$confirmed="1";
|
||||
|
||||
if(($_POST['oui']=="Oui"))
|
||||
{
|
||||
|
||||
mysql_query("DELETE FROM page WHERE id_page='$this_page_id'") or die ('error : '.mysql_error());
|
||||
|
||||
|
||||
echo "<br><br>Opération effectuée ! <a href='".$root_path."'>Retour</a>";
|
||||
}
|
||||
}
|
||||
if(($confirmed=="0")){
|
||||
|
||||
echo'<br><br>Etes-vous certain de vouloir supprimer cette page ?!!
|
||||
<br><br>
|
||||
<form action="'.$root_path.'files/page_suppression.php?id='.$this_page_id.'" method="post">
|
||||
<input name="oui" type="submit" value="Oui">
|
||||
<a href="'.$root_path.'"><input type="button" value="Euh, non en fin de compte."></a>';
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
echo"<br><br>Mais que fais-tu ignorant ? Tu n'es pas administrateur !";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
session_start();
|
||||
if (isset($_POST['titre']) AND isset ($_POST['article']))
|
||||
{
|
||||
require_once("../user/config.php");
|
||||
require_once('../user/verifications.php');
|
||||
|
||||
|
||||
|
||||
$date = "42";
|
||||
$titre = addslashes($_POST['titre']);
|
||||
$article = addslashes($_POST['article']);
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
$req = $bdd->prepare('INSERT INTO article(user,titre,article) VALUES (:user, :titre, :article)');
|
||||
$req->execute(array(
|
||||
"user" => $username,
|
||||
"titre" => $titre,
|
||||
"article" => $article,
|
||||
|
||||
));
|
||||
echo "Votre article a bien été enregistré ! <a href='".$root_path."'>Retour</a>";
|
||||
//echo date_default_timezone_set('l jS \of F Y h:i:s A');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Il y a eu une erreur.";
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?php
$FilesDir = str_replace("files", "",dirname(__FILE__));
require_once(''.$FilesDir.'user/config.php');
$page_name='Modifications Blog';
include_once(''.$MainDir.'user/top.php');
session_start();
if(!@$_SESSION['session'])
{
echo"<br><br>Vous ne pouvez pas effectuer cette opération si vous n'êtes pas connecté(e).";
}
if(@$_SESSION['session'])
{
require_once(''.$MainDir.'user/verifications.php');
include("".$MainDir."files/check_admin.php");
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
$sql="SELECT * FROM page";
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$data_pages=mysql_fetch_assoc($req);
if($admin_mode == "1"){
//////// TO SET
if(isset($_POST['static_homepage_status'])){
$site_name=htmlspecialchars(formulaires($_POST['titre']));
$description=htmlspecialchars(formulaires($_POST['description']));
$bandeau=htmlspecialchars(formulaires($_POST['bandeau']));
$static_homepage_status=htmlspecialchars(formulaires($_POST['static_homepage_status']));
////////
//$passwd=htmlspecialchars(formulaires($_POST['passwd']));
//$passwd2=htmlspecialchars(formulaires($_POST['passwd2']));
//////// TO SET
mysql_query("UPDATE blog_config SET site_name='$site_name'") or die ('error : '.mysql_error());
mysql_query("UPDATE blog_config SET description='$description'") or die ('error : '.mysql_error());
mysql_query("UPDATE blog_config SET bandeau='$bandeau'") or die ('error : '.mysql_error());
mysql_query("UPDATE blog_config SET static_homepage_status='$static_homepage_status'") or die ('error : '.mysql_error());
////////
echo'Vous venez de modifier les paramètres de '.$website_name.'<br /><a href="'.$root_path.'">Retour à l\'accueil du site !</a>';
include_once('../user/bottom.php');
}
if(isset($_GET['static_homepage_id'])){
$get_static_homepage_id = $_GET['static_homepage_id'];
mysql_query("UPDATE blog_config SET static_homepage_id='$get_static_homepage_id'") or die ('error : '.mysql_error());
echo'Vous venez de modifier les paramètres de '.$website_name.'<br /><a href="/../">Retour à l\'accueil du site !</a>';
}
}
}
?>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
$FilesDir = str_replace("files", "",dirname(__FILE__));
|
||||
require_once("".$FilesDir."user/config.php");
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
if (isset($_POST['titre']) AND isset ($_POST['article']))
|
||||
{
|
||||
|
||||
|
||||
$this_article_id=$_GET['id'];
|
||||
|
||||
$date = "42";
|
||||
$titre = $_POST['titre'];
|
||||
$article = $_POST['article'];
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
|
||||
$sql="SELECT * FROM article";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_articles=mysql_fetch_assoc($req);
|
||||
|
||||
|
||||
mysql_query('UPDATE article SET titre=("'.$titre.'") WHERE id_article="'.$this_article_id.'"') or die ('error : '.mysql_error());
|
||||
|
||||
mysql_query('UPDATE article SET article=("'.$article.'") WHERE id_article="'.$this_article_id.'"') or die ('error : '.mysql_error());
|
||||
|
||||
|
||||
|
||||
|
||||
//$req = $bdd->prepare('INSERT INTO article(user,titre,article) VALUES (:user, :titre, :article)');
|
||||
//$req->execute(array(
|
||||
// "user" => $username,
|
||||
// "titre" => $titre,
|
||||
// "article" => $article,
|
||||
|
||||
//));
|
||||
echo "Votre article a bien été enregistré ! <a href='".$root_path."'>Retour</a>";
|
||||
//echo date_default_timezone_set('l jS \of F Y h:i:s A');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Il y a eu une erreur.";
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
require_once("../user/config.php");
|
||||
require_once('../user/verifications.php');
|
||||
if (isset($_POST['titre']) AND isset ($_POST['page']))
|
||||
{
|
||||
|
||||
|
||||
$this_page_id=$_GET['id'];
|
||||
|
||||
$date = "42";
|
||||
$titre = addslashes($_POST['titre']);
|
||||
$page = addslashes($_POST['page']);
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
|
||||
$sql="SELECT * FROM page";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_pages=mysql_fetch_assoc($req);
|
||||
|
||||
|
||||
mysql_query('UPDATE page SET titre="'.$titre.'" WHERE id_page="'.$this_page_id.'"') or die ('error : '.mysql_error());
|
||||
|
||||
mysql_query('UPDATE page SET page="'.$page.'" WHERE id_page="'.$this_page_id.'"') or die ('error : '.mysql_error());
|
||||
|
||||
|
||||
|
||||
|
||||
//$req = $bdd->prepare('INSERT INTO page(user,titre,page) VALUES (:user, :titre, :page)');
|
||||
//$req->execute(array(
|
||||
// "user" => $username,
|
||||
// "titre" => $titre,
|
||||
// "page" => $page,
|
||||
|
||||
//));
|
||||
echo "Votre page a bien été enregistrée ! <a href='".$root_path."'>Retour</a>";
|
||||
//echo date_default_timezone_set('l jS \of F Y h:i:s A');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Il y a eu une erreur.";
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
session_start();
|
||||
if (isset($_POST['titre']) AND isset ($_POST['page']))
|
||||
{
|
||||
require_once("../user/config.php");
|
||||
require_once('../user/verifications.php');
|
||||
|
||||
|
||||
|
||||
$date = "42";
|
||||
$titre = addslashes($_POST['titre']);
|
||||
$page = addslashes($_POST['page']);
|
||||
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
|
||||
$req = $bdd->prepare('INSERT INTO page(user,titre,page) VALUES (:user, :titre, :page)');
|
||||
$req->execute(array(
|
||||
"user" => $username,
|
||||
"titre" => $titre,
|
||||
"page" => $page,
|
||||
|
||||
));
|
||||
echo "Votre page a bien été enregistrée ! <a href='".$root_path."'>Retour</a>";
|
||||
//echo date_default_timezone_set('l jS \of F Y h:i:s A');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Il y a eu une erreur.";
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php include("navheader.php");
|
||||
?>
|
||||
<?php
|
||||
|
||||
require '/../user/config.php';
|
||||
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
|
||||
mysql_select_db(DB_DB);
|
||||
$sql="SELECT user_rank FROM user WHERE id_user=id_user";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$user_ranking = mysql_fetch_assoc($req);
|
||||
|
||||
|
||||
$user_rank="$user_ranking[user_rank]";
|
||||
|
||||
|
||||
|
||||
if(@$_SESSION['session'])
|
||||
{
|
||||
echo("<br>Etat utilisateur : Connecté <br>");
|
||||
echo "<br>";
|
||||
echo("Votre rang est : ".$user_ranking[user_rank].". ");
|
||||
if($user_rank!=1){
|
||||
echo("Vous n'êtes pas administrateur ! Vous ne pouvez pas accéder à cette partie du site.");
|
||||
}else{
|
||||
|
||||
echo("<br>vous etes admin");
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
|
@ -0,0 +1 @@
|
|||
<html><head><title>Not Found</title></head><body><h1>404 - Not Found</h1></body></html>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
if(!defined('entry') || !entry) die('Not a valid page'); /* ===========================
|
||||
|
||||
gelato CMS - A PHP based tumblelog CMS
|
||||
development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under the GPL 2.0
|
||||
Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?php
|
||||
// Nothing here
|
||||
?>
|
||||
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 216 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
|
@ -0,0 +1,391 @@
|
|||
<?php
|
||||
|
||||
$index_check="1";
|
||||
require_once ('user/config.php');
|
||||
|
||||
|
||||
if(isset($root_path)){
|
||||
$page_name=$meta_description;
|
||||
include_once("user/top.php");
|
||||
include("files/navheader.php");
|
||||
}
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
|
||||
|
||||
if(isset($_GET['error']))
|
||||
{
|
||||
echo'<span class="error">';
|
||||
$error=$_GET['error'];
|
||||
if($error=="username")
|
||||
{
|
||||
echo'Error : Your username is invalid';
|
||||
}
|
||||
if($error=="pass")
|
||||
{
|
||||
echo'error : Your password is invalid';
|
||||
}
|
||||
if($error=="connection")
|
||||
{
|
||||
echo"error : Your password don't match with your username";
|
||||
}
|
||||
echo'</span>';
|
||||
}
|
||||
|
||||
|
||||
if(isset($root_path))
|
||||
{
|
||||
|
||||
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
|
||||
mysql_select_db(DB_DB);
|
||||
$nombre_utilisateur=mysql_query("SELECT * FROM user") or die ('error : '.mysql_error());
|
||||
$count_user=mysql_num_rows($nombre_utilisateur);
|
||||
}
|
||||
if(isset($count_user) && $count_user == 0){
|
||||
|
||||
|
||||
echo("<br><br>Ce site n'a pas encore été paramétré, vous êtes priés de procéder à l'inscription, en cliquant <a href ='".$root_path."/user/register.php'><span style='text-decoration: underline;'>ICI</span></a>");
|
||||
|
||||
|
||||
} elseif(!isset($root_path)) {
|
||||
echo "<br><br>Attention ! Vous n'avez pas encore modifié le fichier config.php ! Ceci est nécessaire au fonctionnement du CMS Blog Artisanal. <br><br> Vérifiez aussi que vous avez bien retiré les deux // devant la ligne";?> $root_path='/';<?php echo"<br><br>N'oubliez pas de lire le fichier install.txt situé dans le dossier /install !";
|
||||
} else {
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
html
|
||||
{
|
||||
height:100%;
|
||||
width:100%;
|
||||
}
|
||||
#header
|
||||
{
|
||||
width:100%;
|
||||
height:20%;
|
||||
font-size:50px;
|
||||
text-align:center;
|
||||
border-style:solid;
|
||||
border-color:black;
|
||||
border-size:1px;
|
||||
}
|
||||
.corps
|
||||
{
|
||||
width:80%;
|
||||
height:5%;
|
||||
border-bottom-style:solid;
|
||||
border-bottom-color:black;
|
||||
border-bottom-size:1px;
|
||||
//float:left;
|
||||
z-index:2;
|
||||
}
|
||||
#widget
|
||||
{
|
||||
margin-left:80%;
|
||||
width:15%;
|
||||
z-index:1;
|
||||
position:absolute;
|
||||
border-left-style:solid;
|
||||
border-left-color:black;
|
||||
border-left-size:2px;
|
||||
}
|
||||
a
|
||||
{
|
||||
color:black;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:hover
|
||||
{
|
||||
color:black;
|
||||
text-decoration:underline;
|
||||
}
|
||||
#contact
|
||||
{
|
||||
color:white;
|
||||
text-decoration:none;
|
||||
}
|
||||
#contact:hover
|
||||
{
|
||||
color:white;
|
||||
text-decoration:underline;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="header"><p style="margin-top:3%;"><?php echo $site_name; ?></p></div>
|
||||
<div style="width:100%; color:white;">
|
||||
<p style="height:5%; background-color:black;">
|
||||
|
||||
<marquee onmouseout="this.start();" onmouseover="this.stop();" loop="infinite" scrolldelay="100" scrollamount="5" direction="left">
|
||||
|
||||
|
||||
|
||||
<?php echo $bandeau ?>
|
||||
|
||||
|
||||
</marquee>
|
||||
</p>
|
||||
</div>
|
||||
<div id="widget">
|
||||
<b> Pages :</b>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$sql_page_menu="SELECT * FROM page ORDER BY priority";
|
||||
$req = mysql_query($sql_page_menu) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
while($data_page_menu=mysql_fetch_assoc($req))
|
||||
{
|
||||
|
||||
|
||||
|
||||
echo"<a href='?id_page=".$data_page_menu["id_page"]."'>{$data_page_menu["titre"]}</a><br><br>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="corps">
|
||||
|
||||
<?php
|
||||
|
||||
if(@!$_SESSION['session'])
|
||||
{
|
||||
|
||||
$connected="0";
|
||||
}
|
||||
if(@$_SESSION['session'])
|
||||
{
|
||||
require_once(''.$MainDir.'user/verifications.php');
|
||||
$connected="1";
|
||||
|
||||
|
||||
|
||||
$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$user_ranking = mysql_fetch_assoc($req);
|
||||
$user_rank="$user_ranking[user_rank]";
|
||||
if($user_rank==1){
|
||||
|
||||
$admin_mode = "1";
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$admin_mode = "0";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////Start check content
|
||||
|
||||
if(isset($_GET['id_page']) || $static_homepage_status=="1" && $static_homepage_id!=NULL){
|
||||
|
||||
if(isset($_GET['id_page'])){
|
||||
|
||||
$sql_page="SELECT * FROM page WHERE id_page=".$_GET['id_page']."";
|
||||
|
||||
}elseif($static_homepage_status=="1"){
|
||||
|
||||
$sql_page="SELECT * FROM page WHERE id_page=".$static_homepage_id."";
|
||||
|
||||
}
|
||||
$req_page = mysql_query($sql_page) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_page=mysql_fetch_assoc($req_page);
|
||||
|
||||
if($data_page["id_page"]== null && $static_homepage_status!="1"){
|
||||
|
||||
echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cette page existe pas j'ai l'impression cher camarade !<br><br>";
|
||||
|
||||
|
||||
}elseif($data_page["id_page"]== null && $static_homepage_status=="1"){
|
||||
|
||||
echo"La page que vous aviez défini en page d'accueil n'existe plus.<br><br>";
|
||||
|
||||
}else{
|
||||
$page_name= $data_page["titre"];?>
|
||||
<title><?php echo $website_name.' : '.$page_name; ?></title>
|
||||
<?php
|
||||
$page_stripslash = stripslashes($data_page['page']);
|
||||
echo"<h2>{$data_page["titre"]}</h2>";
|
||||
echo"<b>".$page_date_display." :</b> {$data_page["date"]} par : {$data_page['user']}<br />";
|
||||
echo"<b>".$page_page_display." :</b><br />{$page_stripslash}<br><br>";
|
||||
|
||||
|
||||
if($connected==1){
|
||||
|
||||
if(isset($admin_mode) && $admin_mode==1){
|
||||
echo"<br><br><b><a href='administration/edition_page.php?id={$data_page["id_page"]}'>Editer</a></b>";
|
||||
|
||||
echo" - <b><a href='files/page_suppression.php?id={$data_page["id_page"]}'>Supprimer</a></b><br><br>";
|
||||
if($static_homepage_status=="1" && $static_homepage_id != $data_page["id_page"] && $data_page["id_page"]!= null){
|
||||
|
||||
echo "<div style='text-align:right'><a href='files/submit_blog_config.php?static_homepage_id={$_GET['id_page']}'>Définir la page {$data_page['titre']} comme page d'accueil !</a></div><br>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}elseif(isset($_GET['id'])){
|
||||
|
||||
$sql_article="SELECT * FROM article WHERE id_article=".$_GET['id']."";
|
||||
$req_article = mysql_query($sql_article) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$data_article=mysql_fetch_assoc($req_article);
|
||||
|
||||
if($data_article["id_article"]== null){
|
||||
|
||||
echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cet article n'existe pas j'ai l'impression cher camarade !<br><br>";
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$page_name= $data_article["titre"];?>
|
||||
<title><?php echo $website_name.' : '.$page_name; ?></title>
|
||||
<?php
|
||||
$article_stripslash = stripslashes($data_article['article']);
|
||||
echo"<h2>{$data_article["titre"]}</h2>";
|
||||
echo"<b>".$article_date_display." :</b> {$data_article["date"]} par : {$data_article['user']}<br />";
|
||||
echo"<b>".$article_article_display." :</b><br />{$article_stripslash}<br><br>";
|
||||
|
||||
if($connected==1){
|
||||
|
||||
if($admin_mode==1){
|
||||
echo"<br><br><b><a href='administration/edition_article.php?id={$data_article["id_article"]}'>Editer</a></b>";
|
||||
|
||||
echo" - <b><a href='files/article_suppression.php?id={$data_article["id_article"]}'>Supprimer</a></b><br /><br>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if(empty($_GET['p'])) {
|
||||
$page='0,7'; }
|
||||
else if (!empty($_GET['p'])){
|
||||
$pg=$_GET['p'];
|
||||
$fin=$pg*7;
|
||||
$debut=$fin-7;
|
||||
$page=$debut.', 7';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$sql="SELECT * FROM article ORDER BY id_article DESC LIMIT ".$page."";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
while($data=mysql_fetch_assoc($req))
|
||||
{
|
||||
|
||||
$article_stripslash = stripslashes($data['article']);
|
||||
|
||||
echo"<br><br><b>".$article_title_display." :</b> <a href='?id=".$data["id_article"]."'>{$data["titre"]}</a><br />";
|
||||
echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
|
||||
echo"<b>".$article_article_display." :</b><br />{$article_stripslash}";
|
||||
|
||||
if($connected==1){
|
||||
|
||||
if(isset($admin_mode) && $admin_mode==1){
|
||||
echo"<br><br><b><a href='administration/edition_article.php?id={$data["id_article"]}'>Editer</a></b>";
|
||||
|
||||
echo" - <b><a href='files/article_suppression.php?id={$data["id_article"]}'>Supprimer</a></b><br />";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<br><br>Page <?php
|
||||
|
||||
|
||||
|
||||
$sqlm='SELECT COUNT(*) AS nb_id FROM article';
|
||||
$reqm = mysql_query($sqlm) or die('Erreur SQL !<br />'.$sqlm.'<br />'.mysql_error());
|
||||
$donnee = mysql_fetch_array($reqm);
|
||||
$nb_pg=((int)($donnee['nb_id']/7))+1;
|
||||
$nb_pg_r=0;
|
||||
while($nb_pg_r!=$nb_pg AND $nb_pg_r<10){
|
||||
if(empty($_GET['p'])){
|
||||
$_GET['p'] = "1";
|
||||
}
|
||||
$nb_pg_r=$nb_pg_r+1;
|
||||
?>
|
||||
<a class="page" href="?p=<?php echo $nb_pg_r; ?>">
|
||||
<?php
|
||||
if($_GET['p']==$nb_pg_r){
|
||||
echo '<strong>'.$nb_pg_r.'</strong>';
|
||||
}else{
|
||||
echo $nb_pg_r;
|
||||
}
|
||||
?>
|
||||
|
||||
</a>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
mysql_close();
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
////End check content
|
||||
|
||||
?>
|
||||
<title><?php echo $website_name.' : '.$page_name; ?></title>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="footer">
|
||||
<?php
|
||||
echo "(Copyleft) ".$site_name." | Ce site utilise le CMS <a href='http://www.blogartisanal.tk/'>Blog Artisanal</a>.";
|
||||
}
|
||||
|
||||
?></div>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
Blog Artisanal Beta 1.0
|
||||
------------------------------------
|
||||
|
||||
|
||||
|
||||
Utilisez le fichier sql_instructions.db pour créer les tables nécessaires dans la base de données souhaitée.
|
||||
|
||||
N'oubliez pas de modifier le fichier /user/config.php afin qu'il soit en accord avec votre installation.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
|
||||
--
|
||||
-- Structure de la table `article`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `article` (
|
||||
`id_article` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`titre` varchar(120) NOT NULL,
|
||||
`user` varchar(100) NOT NULL,
|
||||
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`article` mediumtext NOT NULL,
|
||||
PRIMARY KEY (`id_article`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
|
||||
|
||||
--
|
||||
-- Contenu de la table `article`
|
||||
--
|
||||
|
||||
INSERT INTO `article` (`id_article`, `titre`, `user`, `date`, `article`) VALUES
|
||||
(1, 'Article d'' Exemple', 'JeSuisLibre', '1991-08-25 20:57:08', 'Bievenue sur Blog Artisanal !\r\n\r\nCeci est votre premier article. Vous pouvez le modifier ou le supprimer et en créer un autre.\r\n\r\nMerci de m''avoir installé !\r\n\r\nAmusez-vous bien ! :-)');
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Structure de la table `blog_config`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `blog_config` (
|
||||
`site_name` varchar(120) NOT NULL,
|
||||
`description` varchar(300) NOT NULL,
|
||||
`bandeau` varchar(300) NOT NULL,
|
||||
`static_homepage_status` int(1) DEFAULT '0',
|
||||
`static_homepage_id` int(3) DEFAULT NULL,
|
||||
UNIQUE KEY `site_name` (`site_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Contenu de la table `blog_config`
|
||||
--
|
||||
|
||||
INSERT INTO `blog_config` (`site_name`, `description`, `bandeau`, `static_homepage_status`, `static_homepage_id`) VALUES
|
||||
('Blog Artisanal', 'Un CMS libre et indépendant.', 'Utilise le CMS Blog Artisanal.', 0, 1);
|
||||
|
||||
|
||||
--
|
||||
-- Structure de la table `page`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `page` (
|
||||
`id_page` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`titre` varchar(120) NOT NULL,
|
||||
`user` varchar(100) NOT NULL,
|
||||
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`page` mediumtext NOT NULL,
|
||||
`priority` int(3) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id_page`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
|
||||
|
||||
|
||||
--
|
||||
-- Contenu de la table `page`
|
||||
--
|
||||
|
||||
INSERT INTO `page` (`id_page`, `titre`, `user`, `date`, `page`, `priority`) VALUES
|
||||
(1, 'Page d''Exemple', 'JeSuisLibre', '1991-08-25 20:57:08', 'Ceci est une page d''exemple.\r\n\r\nTout comme les articles, vous pouvez la modifier, la supprimer, mais de plus, vous pouvez la mettre en page d''accueil statique, à condition que vous soyez administrateur.', 0);
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Structure de la table `user`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `user` (
|
||||
`id_user` mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
`session` text NOT NULL,
|
||||
`username` text NOT NULL,
|
||||
`pass` text NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`user_rank` int(2) NOT NULL,
|
||||
PRIMARY KEY (`id_user`),
|
||||
KEY `id` (`id_user`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
require_once 'user/config.php';
|
||||
$page_name=$meta_description;
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
$sql1="SELECT * FROM blog_config";
|
||||
$bloginfo_rss_req = mysql_query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.mysql_error());
|
||||
$bloginfo_rss = mysql_fetch_assoc($bloginfo_rss_req);
|
||||
|
||||
echo "<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
<rss version='2.0'>
|
||||
<channel>
|
||||
<title>".$site_name."</title>
|
||||
<link>http://www.monsite.com</link>
|
||||
<description>{$bloginfo_rss["description"]}</description>";
|
||||
$sql="SELECT * FROM article ORDER BY id_article DESC LIMIT 20";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
while($data=mysql_fetch_assoc($req))
|
||||
|
||||
|
||||
{
|
||||
$article_desc = strip_tags($data['article']);
|
||||
|
||||
//
|
||||
//echo"{$data["titre"]}<///a><br />";
|
||||
//echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
|
||||
echo"
|
||||
<item>
|
||||
<title>{$data["titre"]}</title>
|
||||
<link>http://www.blogartisanal.tk/?id={$data["id_article"]}</link>
|
||||
<guid isPermaLink='false'>6</guid>
|
||||
<description>{$article_desc}</description>
|
||||
<pubDate>0000-00-00 00:00:00 GMT</pubDate>
|
||||
</item>";
|
||||
}
|
||||
echo"
|
||||
</channel>
|
||||
</rss>";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
mysql_close();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
// IMPORTANT :
|
||||
//
|
||||
// YOU MUST UNCOMMENT THE FOLLOWING (//$root_path="/";) LINE AND SET YOUR CMS LOCATION.
|
||||
//
|
||||
// For example : http://mywebsite.com/myfolder/ And don't forget the / at the end of the adress,
|
||||
// it won't work without it.
|
||||
//
|
||||
// As soon as the $root_path is set, the Database will be tested,
|
||||
// don't forget to put your db settings bellow or it will print an SQL error.
|
||||
|
||||
|
||||
|
||||
//$root_path="/";
|
||||
|
||||
|
||||
//SET OTHER PREFERENCES
|
||||
|
||||
$lang="fr_fr";
|
||||
$blog_email='contact@mywebsite.com';
|
||||
$localite='local';
|
||||
$meta_key_words='member, space';
|
||||
|
||||
//
|
||||
|
||||
if(isset($root_path))
|
||||
{
|
||||
|
||||
|
||||
//YOUR MySQL DATABASE SETTINGS
|
||||
|
||||
$server='Your_MySQL_Server_Address';
|
||||
$user='Your_db_user';
|
||||
$passwd='Your_db_password';
|
||||
$base='Your_db_name';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
define("DB_HOST",$server);
|
||||
|
||||
define("DB_LOGIN",$user);
|
||||
|
||||
define("DB_PASS",$passwd);
|
||||
|
||||
define("DB_DB",$base);
|
||||
|
||||
|
||||
|
||||
|
||||
@$connect=mysql_connect($server, $user, $passwd) or die ('Error : '.mysql_error().' <br><br>Please check if your database settings are correctly set in the config.php file!');
|
||||
@mysql_select_db($base) or die ('Error : '.mysql_error());
|
||||
require_once('fonctions.php');
|
||||
|
||||
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
|
||||
mysql_select_db(DB_DB);
|
||||
$sql="SELECT * FROM blog_config";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$blog_info_config_page = mysql_fetch_assoc($req);
|
||||
|
||||
|
||||
|
||||
$ConfigDir = dirname(__FILE__);
|
||||
$MainDir = str_replace("user", "",$ConfigDir);
|
||||
|
||||
$meta_description=$blog_info_config_page['description'];
|
||||
|
||||
|
||||
|
||||
|
||||
$site_name=$blog_info_config_page['site_name'];
|
||||
$website_name=$site_name;
|
||||
|
||||
$bandeau = $blog_info_config_page['bandeau'];
|
||||
|
||||
$static_homepage_status = $blog_info_config_page['static_homepage_status'];
|
||||
|
||||
if($static_homepage_status=="1")
|
||||
{
|
||||
|
||||
$static_homepage_id = $blog_info_config_page['static_homepage_id'];
|
||||
|
||||
}
|
||||
}
|
||||
if($lang=="fr_fr"){
|
||||
|
||||
include "".$MainDir."files/lang/fr_fr.php";
|
||||
|
||||
}elseif($lang=="en_us"){
|
||||
|
||||
include''.$MainDir.'files/lang/en_us.php';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
// IMPORTANT :
|
||||
//
|
||||
// YOU MUST UNCOMMENT THE FOLLOWING (//$root_path="/";) LINE AND SET YOUR CMS LOCATION.
|
||||
//
|
||||
// For example : http://mywebsite.com/myfolder/ And don't forget the / at the end of the adress,
|
||||
// it won't work without it.
|
||||
//
|
||||
// As soon as the $root_path is set, the Database will be tested,
|
||||
// don't forget to put your db settings bellow or it will print an SQL error.
|
||||
|
||||
|
||||
|
||||
$root_path="http://www.cebabonet.tk/blog/";
|
||||
|
||||
|
||||
//SET OTHER PREFERENCES
|
||||
|
||||
$lang="fr_fr";
|
||||
$blog_email='contact@mywebsite.com';
|
||||
$localite='local';
|
||||
$meta_key_words='member, space';
|
||||
|
||||
//
|
||||
|
||||
if(isset($root_path))
|
||||
{
|
||||
|
||||
|
||||
//YOUR MySQL DATABASE SETTINGS
|
||||
|
||||
$server='Your_MySQL_Server_Address';
|
||||
$user='Your_db_user';
|
||||
$passwd='Your_db_password';
|
||||
$base='Your_db_name';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
define("DB_HOST",$server);
|
||||
|
||||
define("DB_LOGIN",$user);
|
||||
|
||||
define("DB_PASS",$passwd);
|
||||
|
||||
define("DB_DB",$base);
|
||||
|
||||
|
||||
|
||||
|
||||
@$connect=mysql_connect($server, $user, $passwd) or die ('Error : '.mysql_error().' <br><br>Please check if your database settings are correctly set in the config.php file!');
|
||||
@mysql_select_db($base) or die ('Error : '.mysql_error());
|
||||
require_once('fonctions.php');
|
||||
|
||||
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
|
||||
mysql_select_db(DB_DB);
|
||||
$sql="SELECT * FROM blog_config";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$blog_info_config_page = mysql_fetch_assoc($req);
|
||||
|
||||
|
||||
|
||||
$ConfigDir = dirname(__FILE__);
|
||||
$MainDir = str_replace("user", "",$ConfigDir);
|
||||
|
||||
$meta_description=$blog_info_config_page['description'];
|
||||
|
||||
|
||||
|
||||
|
||||
$site_name=$blog_info_config_page['site_name'];
|
||||
$website_name=$site_name;
|
||||
|
||||
$bandeau = $blog_info_config_page['bandeau'];
|
||||
|
||||
$static_homepage_status = $blog_info_config_page['static_homepage_status'];
|
||||
|
||||
if($static_homepage_status=="1")
|
||||
{
|
||||
|
||||
$static_homepage_id = $blog_info_config_page['static_homepage_id'];
|
||||
|
||||
}
|
||||
}
|
||||
if($lang=="fr_fr"){
|
||||
|
||||
include "".$MainDir."files/lang/fr_fr.php";
|
||||
|
||||
}elseif($lang=="en_us"){
|
||||
|
||||
include''.$MainDir.'files/lang/en_us.php';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
function formulaires($value)
|
||||
{
|
||||
$value=trim(htmlspecialchars(addslashes($value)));
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
require_once('config.php');
|
||||
if(!@$_SESSION['session']){
|
||||
session_start();
|
||||
}
|
||||
|
||||
if(@$_SESSION['session']){
|
||||
require_once('verifications.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include("".$MainDir."files/navheader.php");
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<section>
|
||||
<?php
|
||||
if(!@$_SESSION['session'])
|
||||
{
|
||||
|
||||
$page_name='Connexion';
|
||||
include_once('top.php');
|
||||
|
||||
|
||||
if(isset($_GET['error']))
|
||||
{
|
||||
echo'<span class="error">';
|
||||
$error=$_GET['error'];
|
||||
if($error=="username")
|
||||
{
|
||||
echo'Error : Your username is invalid';
|
||||
}
|
||||
if($error=="pass")
|
||||
{
|
||||
echo'error : Your password is invalid';
|
||||
}
|
||||
if($error=="connection")
|
||||
{
|
||||
echo"error : Your password don't match with your username";
|
||||
}
|
||||
echo'</span>';
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="login.php">
|
||||
<table width="300" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" >Login</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="username">Username : </label></td>
|
||||
<td><input type="text" name="username" id="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd">Password : </label></td>
|
||||
<td><input type="password" name="passwd" id="passwd" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="submit" value="Login" class="addbutton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div align="center"><a href="register.php"> → Register !</a>
|
||||
<?php
|
||||
if($localite != 'local')
|
||||
echo'<br /><a href="lost.php">Lost Password ?</a>';
|
||||
echo'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once('config.php');
|
||||
|
||||
$page_name='Panneau Utilisateur';
|
||||
include_once('top.php');
|
||||
|
||||
|
||||
?>
|
||||
<div align="center"><strong>Welcome in your user panel <?php echo htmlspecialchars($username) ?> !</strong></br ></br>
|
||||
Your e-mail : <?php echo htmlspecialchars($email) ?><br />
|
||||
Your id : <?php echo htmlspecialchars($id_user) ?> <br />
|
||||
<a href="profile.php">Profile Modification</a><br />
|
||||
<a href="logout.php">Logout</a></div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
|
||||
mysql_select_db(DB_DB);
|
||||
$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
|
||||
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
|
||||
$user_ranking = mysql_fetch_assoc($req);
|
||||
echo "<br>";
|
||||
echo("Votre rang est : ".$user_ranking['user_rank'].". ");
|
||||
|
||||
$user_rank="$user_ranking[user_rank]";
|
||||
|
||||
if($user_rank==1){
|
||||
echo("Vous êtes administrateur.");
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
require_once('config.php');
|
||||
|
||||
$username = formulaires($_POST['username']);
|
||||
$passwd = formulaires($_POST['passwd']);
|
||||
|
||||
|
||||
$passwd=md5($passwd);
|
||||
|
||||
if(!$username)
|
||||
{
|
||||
header('Location:'.$root_path.'index.php?error=username');
|
||||
}
|
||||
if(!$passwd)
|
||||
{
|
||||
header('Location:'.$root_path.'index.php?error=pass');
|
||||
}
|
||||
$reponse_cores=mysql_query("SELECT * FROM user WHERE pass='$passwd' AND username='$username'") or die ('error : '.mysql_error());
|
||||
$count_cores=mysql_num_rows($reponse_cores);
|
||||
if($count_cores == 0 )
|
||||
{
|
||||
header('Location:'.$root_path.'index.php?error=connection');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
for ($ligne=0;$ligne<30;$ligne++) //Création d'un identifiant aléatoire
|
||||
{
|
||||
@$session.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
|
||||
}
|
||||
|
||||
mysql_query("UPDATE user SET session='$session' WHERE username='$username'") or die ('error : '.mysql_error());
|
||||
$_SESSION['session'] = "$session"; //création de la session
|
||||
header('Location:'.$root_path.'user/index.php'); //redirection vers l'index
|
||||
}
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
require_once 'config.php';
|
||||
session_start();
|
||||
session_unset();
|
||||
session_destroy();
|
||||
|
||||
header('Location:'.$root_path.'');
|
||||
?>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
require_once('config.php');
|
||||
$page_name='Password Forgotten';
|
||||
include_once('top.php');
|
||||
|
||||
?>
|
||||
<form action="lost2.php" name="recup" method="POST">
|
||||
<table width="300" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" class="menu">Lost Password</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="email">E-mail :</label></td>
|
||||
<td><input type="text" name="email" id="email" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="username">Username :</label></td>
|
||||
<td><input type="text" name="username" id="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center"><input type="submit" name="Submit" value="Envoyer"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div align="center"><a href="index.php">Back</a>
|
||||
</div>
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
require_once('config.php');
|
||||
$page_name='Password forgotten';
|
||||
include_once('top.php');
|
||||
|
||||
//récupération du formulaire
|
||||
$email=formulaires($_POST['email']);
|
||||
$username=formulaires($_POST['username']);
|
||||
if(!$email)
|
||||
{
|
||||
echo"Empty E-mail.<br /><a href='#' onClick='history.back()'>Back</a></center>";
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
if(!$username)
|
||||
{
|
||||
echo"Empty username.<br /><a href='#' onClick='history.back()'>Back</a></center>";
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$reponse_username=mysql_query("SELECT username FROM user WHERE username='$username'") or die ('error : '.mysql_error());
|
||||
$count_username=mysql_num_rows($reponse_username);
|
||||
if($count_username == 0)
|
||||
{
|
||||
echo"Invalid username.<br /><a href='#' onClick='history.back()'>Back</a>";
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$reponse_email=mysql_query("SELECT email FROM user WHERE email='$email'") or die ('error : '.mysql_error());
|
||||
$count_email=mysql_num_rows($reponse_email);
|
||||
if($count_email == 0)
|
||||
{
|
||||
echo" Invalid E-mail.<br /><a href='#' onClick='history.back()'>Back</a>";
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$existe=mysql_query("SELECT email FROM user WHERE email='$email' AND username='$username'") or die ('error : '.mysql_error());
|
||||
$test=mysql_num_rows($existe);
|
||||
if($test == 0)
|
||||
{
|
||||
echo"E-mail and Username don't match.<br /><a href='#' onClick='history.back()'>Back</a>";
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for ($ligne=0;$ligne<10;$ligne++) //Création d'un mot de passe aléatoire
|
||||
{
|
||||
@$passwd.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
|
||||
}
|
||||
|
||||
mail("$email", "".$website_name." - Forgotten password" , "Hello, this is your new password : ".$passwd."", "From: ".$blog_email."");
|
||||
$passwd=md5($passwd);
|
||||
mysql_query("UPDATE user SET pass='$passwd' WHERE email='$email'") or die ('error : '.mysql_error());
|
||||
echo 'An E-mail has been sent to your mailbox with your new password';
|
||||
?>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
require_once('config.php');
|
||||
require_once('verifications.php');;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<title>Modification du Profile</title>
|
||||
|
||||
<center>
|
||||
|
||||
<section>
|
||||
<?php
|
||||
|
||||
$page_name='Profile Modification';
|
||||
include_once('top.php');
|
||||
{
|
||||
?>
|
||||
<form action='profile2.php' method='post' enctype='multipart/form-data' name='form1'>
|
||||
<table width='400' border='0' align='center'>
|
||||
<tr>
|
||||
<td colspan='2' ><div align=center><h2>Profile Modification</h2></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for='email'>E-mail modification</label></td>
|
||||
<td><input name='email' type='text' id='email' value="<?php echo htmlspecialchars($email) ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd">Old password</label></td>
|
||||
<td><input name="pass_enc" type="password" id="passwd"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd2">New password</label></td>
|
||||
<td><input name="new_pass" type="password" id="passwd2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd3">New password confirmation</label></td>
|
||||
<td><input name="new_pass2" type="password" id="passwd3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="submit" name="Submit" value="Modify" class="addbutton"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div align=center><a href="index.php" onClick="history.back()">Back</a></div>
|
||||
<?php
|
||||
}
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
|
||||
</section>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?php session_start(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<section>
|
||||
<?php
|
||||
|
||||
require_once('config.php');
|
||||
require_once('verifications.php');
|
||||
$page_name='Profile Modification';
|
||||
include_once('top.php');
|
||||
|
||||
//récupération du formulaire
|
||||
$email=formulaires($_POST['email']);
|
||||
$pass_enc=formulaires($_POST['pass_enc']);
|
||||
$new_pass=formulaires($_POST['new_pass']);
|
||||
$new_pass2=formulaires($_POST['new_pass2']);
|
||||
|
||||
if(!$email)
|
||||
{
|
||||
?>
|
||||
|
||||
E-mail inexisant.<br /><a href='profile.php' onClick='history.back()'>Back</a>
|
||||
</section>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(isset($pass_enc))
|
||||
{
|
||||
if(!$new_pass || !$new_pass2 || strlen($new_pass) < 5)
|
||||
{
|
||||
?>
|
||||
|
||||
Your password or its confirmation is inexistant or your password is less than 5 characters<br /><a href="profile.php" onClick="history.back()">Back</a>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
if($new_pass!=$new_pass2)
|
||||
{
|
||||
?>
|
||||
Passwords don't match !<br /><a href="profile.php" onClick="history.back()">Back</a>
|
||||
</section>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
$pass_enc=md5($pass_enc);
|
||||
$reponse_pass=mysql_query("SELECT pass FROM user WHERE pass='$pass_enc' AND session='$session'") or die ('error : '.mysql_error()); //verification si mot de passe valide
|
||||
$count_pass=mysql_num_rows($reponse_pass);
|
||||
if($count_pass == 0)
|
||||
{
|
||||
?>
|
||||
|
||||
The old password is not correct.<br /><a href="profile.php" onClick="history.back()">Back</a>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
$new_pass=md5($new_pass);
|
||||
mysql_query("UPDATE user SET pass='$new_pass' WHERE session='$session'") or die ('error : '.mysql_error());
|
||||
}
|
||||
mysql_query("UPDATE user SET email='$email' WHERE session='$session'") or die ('error : '.mysql_error());
|
||||
echo"<div align=center>Your profile settings have been saved.<br /><a href='profile.php' onClick='history.back()'>Back</a></div>";
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
|
||||
<title>Register</title>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<?php
|
||||
|
||||
require_once('config.php');
|
||||
$page_name='Register';
|
||||
include_once('top.php');
|
||||
?><form method='post' action='verification.php' enctype='multipart/form-data'>
|
||||
<table width="400" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2"><h2>Register</h2></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="username">Username : </label></td>
|
||||
<td><input name="username" type="text" id="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="email">E-mail : </label></td>
|
||||
<td><input name="email" type="text" id="email" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd">Password : </label></td>
|
||||
<td><input name="passwd" type="password" id="passwd" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="passwd2">Password Confirmation: </label></td>
|
||||
<td><input name="passwd2" type="password" id="passwd2" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center"><input type="submit" value="GO!" /></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<center><a href="index.php">Back</a></center>
|
||||
<?php
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
</section>
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<?php
|
||||
if (!isset($index_check)){
|
||||
?>
|
||||
<title><?php echo $website_name.' : '.$page_name; ?></title>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1" />
|
||||
<meta name="description" content="<?php echo $meta_description; ?>" />
|
||||
<meta name="keywords" content="<?php echo $meta_key_words; ?>" />
|
||||
<meta name="robots" content="all" />
|
||||
<link href="style.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="alternate" type="application/rss+xml"
|
||||
href="<?php echo $root_path; ?>rss.php" title="Blog Artisanal" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<?php
|
||||
if (!isset($index_check)){
|
||||
?>
|
||||
<title><?php echo $website_name.' : '.$page_name; ?></title>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1" />
|
||||
<meta name="description" content="<?php echo $meta_description; ?>" />
|
||||
<meta name="keywords" content="<?php echo $meta_key_words; ?>" />
|
||||
<meta name="robots" content="all" />
|
||||
<link href="style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
|
||||
require_once('config.php');
|
||||
$page_name='Register';
|
||||
include_once('top.php');
|
||||
$email=htmlspecialchars(formulaires($_POST['email']));
|
||||
$username=htmlspecialchars(formulaires($_POST['username']));
|
||||
$passwd=htmlspecialchars(formulaires($_POST['passwd']));
|
||||
$passwd2=htmlspecialchars(formulaires($_POST['passwd2']));
|
||||
|
||||
|
||||
|
||||
//// VERIFICATIONS BANALES ////
|
||||
if(!$passwd || !$passwd2 || strlen($passwd) < 5)
|
||||
{
|
||||
echo'Your password or its confirmation is inexistant or your password is less than 5 characters<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
if($passwd!=$passwd2)
|
||||
{
|
||||
echo'Passwords don\'t match !<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
if(!$username || strlen($username) > 15)
|
||||
{
|
||||
echo'Your username is inexisant or is more than 15 caracters...<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
if(!$email)
|
||||
{
|
||||
echo'Your e-mail is innexistant.<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//// VERIFICATIONS DES EXISTANCES ////
|
||||
$reponse_mail=mysql_query("SELECT email FROM user WHERE email='$email'") or die ('error : '.mysql_error()); //verification si e-mail existe déjà
|
||||
$count_mail=mysql_num_rows($reponse_mail);
|
||||
if($count_mail == 1)
|
||||
{
|
||||
echo'This e-mail is already taken.<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
$reponse_username=mysql_query("SELECT username FROM user WHERE username='$username'") or die ('error : '.mysql_error()); //verification si username existe déjà
|
||||
$count_username=mysql_num_rows($reponse_username);
|
||||
if($count_username == 1)
|
||||
{
|
||||
echo 'This username is already taken.<br /><a href="register.php" onClick="history.Back()">Back</a>';
|
||||
include_once('bottom.php');
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for ($ligne=0;$ligne<30;$ligne++)
|
||||
{
|
||||
@$session.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
|
||||
}
|
||||
|
||||
$passwd=md5($passwd); //Codage du password
|
||||
|
||||
//// DEFINIR LE PREMIER UTILISATEUR COMME ADMINISTRATEUR ////
|
||||
$nombre_utilisateur=mysql_query("SELECT * FROM user") or die ('error : '.mysql_error());
|
||||
$count_user=mysql_num_rows($nombre_utilisateur);
|
||||
if($count_user == 0){
|
||||
$user_rank = '1';
|
||||
}else{
|
||||
$user_rank ='0';
|
||||
}
|
||||
|
||||
if(!isset($website_name))
|
||||
{
|
||||
$website_name = "Blog Artisanal";
|
||||
}
|
||||
|
||||
//// INSCRIPTION DANS LA BDD ////
|
||||
mysql_query("INSERT INTO user VALUES ('', '$session', '$username', '$passwd', '$email','','$user_rank')") or die ('error : '.mysql_error()); //insertion dans la bdd
|
||||
echo'Thank you for registering to '.$website_name.'<br /><a href="index.php">Login !</a>';
|
||||
include_once('bottom.php');
|
||||
?>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
if(!@$_SESSION['session']){
|
||||
session_start();
|
||||
}
|
||||
$session=htmlspecialchars(formulaires($_SESSION['session']));
|
||||
if(!@$_SESSION['session'])
|
||||
{
|
||||
header('Location:index.php?error=connection');
|
||||
return false;
|
||||
}
|
||||
|
||||
$verif=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error()); //on vérifie si il existe une entrée avec cet identifiant
|
||||
$verif=mysql_num_rows($verif);
|
||||
if($verif == 0)
|
||||
{
|
||||
header('Location:index.php?error=connection');
|
||||
session_unset();
|
||||
session_destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error());
|
||||
while ($resultat = mysql_fetch_array($sql) )
|
||||
{
|
||||
$email = $resultat['email'];
|
||||
$username = $resultat['username'];
|
||||
$id_user = $resultat['id_user'];
|
||||
}
|
||||
?>
|
||||