Explorar el Código

Commit initial sur GitLab

Cebabonet hace 8 años
commit
5f536d1fb2
Se han modificado 53 ficheros con 1959 adiciones y 0 borrados
  1. 45 0
      administration/article_ecrire.php
  2. 30 0
      administration/edition_article.php
  3. 37 0
      administration/edition_page.php
  4. 1 0
      administration/index.php
  5. 42 0
      administration/page_ecrire.php
  6. 70 0
      files/article_suppression.php
  7. 19 0
      files/check_admin.php
  8. 30 0
      files/check_status.php
  9. 0 0
      files/down_check_admin.php
  10. 12 0
      files/lang/en_us.php
  11. 12 0
      files/lang/fr_fr.php
  12. 9 0
      files/navheader.php
  13. 69 0
      files/page_suppression.php
  14. 28 0
      files/submit_article.php
  15. 1 0
      files/submit_blog_config.php
  16. 42 0
      files/submit_edit.php
  17. 41 0
      files/submit_edit_page.php
  18. 28 0
      files/submit_page.php
  19. 34 0
      files/up_check_admin.php
  20. BIN
      img/1012919-10152363195122223-160090348-n.jpg
  21. BIN
      img/12299211-1029636273754798-1152374680217441977-n.jpg
  22. BIN
      img/2784030124-676e49e218-m.jpg
  23. BIN
      img/blag_logo.jpg
  24. BIN
      img/cat-edit-.peg
  25. 1 0
      img/great-progressive-rock-keyboard-players-in-the-world.jpg
  26. 15 0
      img/index.php
  27. BIN
      img/jan-akkerman.jpg
  28. BIN
      img/keyboardproglol.jpg
  29. BIN
      img/no-facebook-me.png
  30. BIN
      img/pecesamanet2004-2008.jpg
  31. BIN
      img/retroshare-symbol.png
  32. BIN
      img/upost_light.png
  33. BIN
      img/vander-taverne-de-lolympia-juin-1975.jpg
  34. 391 0
      index.php
  35. 10 0
      install/install.txt
  36. 86 0
      install/sql_instructions.db
  37. 42 0
      rss.php
  38. 5 0
      user/bottom.php
  39. 99 0
      user/config.php
  40. 99 0
      user/config.php~
  41. 10 0
      user/fonctions.php
  42. 129 0
      user/index.php
  43. 39 0
      user/login.php
  44. 8 0
      user/logout.php
  45. 31 0
      user/lost.php
  46. 60 0
      user/lost2.php
  47. 59 0
      user/profile.php
  48. 115 0
      user/profile2.php
  49. 64 0
      user/register.php
  50. 18 0
      user/top.php
  51. 16 0
      user/top.php~
  52. 83 0
      user/verification.php
  53. 29 0
      user/verifications.php

+ 45 - 0
administration/article_ecrire.php Ver fichero

@@ -0,0 +1,45 @@
1
+
2
+
3
+<?php 
4
+$AdminDir = str_replace("administration", "",dirname(__FILE__));
5
+session_start();
6
+require_once(''.$AdminDir.'user/config.php');
7
+include("".$MainDir."files/navheader.php"); 
8
+include(''.$MainDir.'files/check_status.php');
9
+
10
+$page_name='Rédaction d\'article';
11
+include_once(''.$MainDir.'user/top.php');
12
+
13
+if($connected=="1"){
14
+
15
+require_once(''.$MainDir.'user/verifications.php');
16
+
17
+
18
+
19
+
20
+
21
+if($admin_mode=="1"){
22
+	
23
+	
24
+echo'
25
+<form action="'.$root_path.'files/submit_article.php" method="post">
26
+<b>Titre</b> :<br />
27
+<input type="text" name="titre" /><br />
28
+<b>Article</b> :
29
+<br />
30
+<textarea name="article" cols="60" rows="10"></textarea><br />
31
+<input type="submit" value="Envoyer !!" />';
32
+	
33
+}else{
34
+	
35
+	echo"<br><br>Tu n'es pas admin !";
36
+	
37
+}
38
+
39
+
40
+}else{
41
+	
42
+	echo"<br><br>Tu n'es pas connecté !";
43
+}
44
+
45
+?>

+ 30 - 0
administration/edition_article.php Ver fichero

@@ -0,0 +1,30 @@
1
+<?php 
2
+$AdminDir = str_replace("administration", "",dirname(__FILE__));
3
+require_once(''.$AdminDir.'user/config.php');
4
+require_once(''.$MainDir.'user/verifications.php');
5
+
6
+
7
+
8
+$article_id_edit_page=$_GET['id'];
9
+
10
+$sql="SELECT * FROM article WHERE id_article='$article_id_edit_page'";
11
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
12
+$article_data = mysql_fetch_assoc($req);
13
+
14
+include("".$MainDir."files/navheader.php"); 
15
+
16
+
17
+
18
+$page_name='Edition de l\'article "'.$article_data['titre'].'"';
19
+include_once(''.$MainDir.'user/top.php');
20
+
21
+?>
22
+<form action='<?php echo $root_path; ?>files/submit_edit.php?id=<?php echo $article_id_edit_page; ?>' method='post'>
23
+<b>Titre</b> :<br />
24
+<input value="<?php echo htmlspecialchars(stripslashes($article_data['titre'])); ?>"  type='text' name='titre' /><br />
25
+<b>Article</b> :
26
+<br />
27
+<textarea name='article' cols='60' rows='10'><?php echo htmlspecialchars(stripslashes($article_data['article'])); ?></textarea><br />
28
+<input type='submit' value='Envoyer !!' />
29
+
30
+

+ 37 - 0
administration/edition_page.php Ver fichero

@@ -0,0 +1,37 @@
1
+<?php 
2
+$AdminDir = str_replace("administration", "",dirname(__FILE__));
3
+require_once(''.$AdminDir.'user/config.php');
4
+require_once(''.$MainDir.'user/verifications.php');
5
+
6
+
7
+
8
+$page_id_edit_page=$_GET['id'];
9
+
10
+$sql="SELECT * FROM page WHERE id_page='$page_id_edit_page'";
11
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
12
+$page_data = mysql_fetch_assoc($req);
13
+
14
+include("".$MainDir."files/navheader.php"); 
15
+
16
+
17
+
18
+$page_name='Edition de la page "'.$page_data['titre'].'"';
19
+include_once(''.$MainDir.'user/top.php');
20
+//echo'<title>Edition de la page "'.$page_data['titre'].'"</title>';
21
+
22
+?>
23
+
24
+
25
+<form action='<?php echo $root_path ?>files/submit_edit_page.php?id=<?php echo $page_id_edit_page ?>' method='post'>
26
+<b>Titre</b> :<br />
27
+<input value="<?php echo htmlspecialchars($page_data['titre']); ?>"  type='text' name='titre' /><br />
28
+<b>Page</b> :
29
+<br />
30
+<textarea name='page' cols='60' rows='10'><?php echo htmlspecialchars(stripslashes($page_data['page'])); ?></textarea><br />
31
+<input type='submit' value='Envoyer !!' />
32
+
33
+
34
+
35
+
36
+
37
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
administration/index.php


+ 42 - 0
administration/page_ecrire.php Ver fichero

@@ -0,0 +1,42 @@
1
+<?php 
2
+$AdminDir = str_replace("administration", "",dirname(__FILE__));
3
+session_start();
4
+require_once(''.$AdminDir.'user/config.php');
5
+include("".$MainDir."files/navheader.php"); 
6
+include(''.$MainDir.'files/check_status.php');
7
+
8
+$page_name='Rédaction de page';
9
+include_once(''.$MainDir.'user/top.php');
10
+
11
+if($connected=="1"){
12
+
13
+require_once(''.$MainDir.'user/verifications.php');
14
+
15
+
16
+
17
+
18
+
19
+if($admin_mode=="1"){
20
+
21
+
22
+echo'<form action="'.$root_path.'files/submit_page.php" method="post">
23
+<b>Titre</b> :<br />
24
+<input type="text" name="titre" /><br />
25
+<b>Page</b> :
26
+<br />
27
+<textarea name="page" cols="60" rows="10"></textarea><br />
28
+<input type="submit" value="Envoyer !!" />';    
29
+}else{
30
+        
31
+        echo"<br><br>Tu n'es pas admin !";
32
+        
33
+}
34
+
35
+
36
+}else{
37
+
38
+        echo"<br><br>Tu n'es pas connecté !";
39
+}
40
+
41
+?>
42
+

+ 70 - 0
files/article_suppression.php Ver fichero

@@ -0,0 +1,70 @@
1
+<?php
2
+$FilesDir = str_replace("files", "",dirname(__FILE__));
3
+session_start();
4
+
5
+
6
+require_once(''.$FilesDir.'user/config.php');
7
+include("".$MainDir."files/navheader.php"); 
8
+
9
+$page_name='Confirmation de suppression';
10
+include_once(''.$MainDir.'user/top.php');
11
+
12
+if(!@$_SESSION['session'])
13
+	{
14
+
15
+echo"<br><br>Vous ne pouvez pas effectuer cette opération si vous n'êtes pas connecté(e).";
16
+	}
17
+	if(@$_SESSION['session']){
18
+		require_once(''.$MainDir.'user/verifications.php');
19
+		include("".$MainDir."files/check_admin.php");
20
+		
21
+		
22
+
23
+$this_article_id=$_GET['id'];
24
+
25
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
26
+
27
+$sql="SELECT * FROM article";
28
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
29
+$data_articles=mysql_fetch_assoc($req);
30
+
31
+$confirmed="0";
32
+
33
+if($admin_mode == "1"){
34
+	
35
+if(isset($_POST['oui'])){
36
+	
37
+	
38
+	$confirmed="1";
39
+	
40
+	if(($_POST['oui']=="Oui"))
41
+	{
42
+
43
+mysql_query("DELETE FROM article WHERE id_article='$this_article_id'") or die ('error : '.mysql_error());
44
+
45
+
46
+echo "<br><br>Opération effectuée ! <a href='".$root_path."'>Retour</a>";
47
+	} 
48
+						}
49
+if(($confirmed=="0")){
50
+	
51
+echo'<br><br>Etes-vous certain de vouloir supprimer cet article ?!!
52
+<br><br>
53
+<form action="'.$root_path.'files/article_suppression.php?id='.$this_article_id.'" method="post">
54
+<input name="oui" type="submit" value="Oui">
55
+ <a href="'.$root_path.'"><input type="button" value="Euh, non en fin de compte."></a>';
56
+
57
+					}
58
+	
59
+}else{
60
+	echo"<br><br>Mais que fais-tu ignorant ? Tu n'es pas administrateur !";
61
+	
62
+	}
63
+		
64
+		}
65
+
66
+
67
+
68
+
69
+
70
+?>

+ 19 - 0
files/check_admin.php Ver fichero

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+
4
+
5
+
6
+$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
7
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
8
+$user_ranking = mysql_fetch_assoc($req);
9
+$user_rank="$user_ranking[user_rank]";
10
+
11
+if($user_rank==1){
12
+	
13
+	$admin_mode = "1";
14
+	
15
+}else{
16
+	$admin_mode = "0";
17
+}
18
+
19
+?>

+ 30 - 0
files/check_status.php Ver fichero

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+if(@!$_SESSION['session'])
4
+	{
5
+
6
+$connected="0";
7
+	}
8
+if(@$_SESSION['session'])
9
+	{
10
+require_once(''.$MainDir.'user/verifications.php');
11
+$connected="1";
12
+
13
+
14
+
15
+$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
16
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
17
+$user_ranking = mysql_fetch_assoc($req);
18
+$user_rank="$user_ranking[user_rank]";
19
+if($user_rank==1){
20
+	
21
+	$admin_mode = "1";
22
+	
23
+				}else{
24
+					$admin_mode = "0";
25
+					
26
+				}
27
+
28
+	}
29
+
30
+?>

+ 0 - 0
files/down_check_admin.php Ver fichero


+ 12 - 0
files/lang/en_us.php Ver fichero

@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+$user_panel = "User Panel";
4
+$administration = "Control Panel";
5
+$home_display = "Home";
6
+$article_title_display = "Title";
7
+$article_date_display = "Date";
8
+$article_article_display = "Article";
9
+$page_title_display = "Title";
10
+$page_date_display = "Date";
11
+$page_page_display = "Page";
12
+?>

+ 12 - 0
files/lang/fr_fr.php Ver fichero

@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+$user_panel = "Panneau Utilisateur";
4
+$administration = "Administration";
5
+$home_display = "Accueil";
6
+$article_title_display = "Titre";
7
+$article_date_display = "Date";
8
+$article_article_display = "Article";
9
+$page_title_display = "Titre";
10
+$page_date_display = "Date";
11
+$page_page_display = "Page";
12
+?>

+ 9 - 0
files/navheader.php Ver fichero

@@ -0,0 +1,9 @@
1
+<?php
2
+$FilesDir = str_replace("files", "",dirname(__FILE__));
3
+
4
+require_once''.$FilesDir.'user/config.php';
5
+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>
6
+<br>_____________________________________________';
7
+
8
+?>
9
+

+ 69 - 0
files/page_suppression.php Ver fichero

@@ -0,0 +1,69 @@
1
+<?php
2
+$FilesDir = str_replace("files", "",dirname(__FILE__));
3
+session_start();
4
+
5
+require_once(''.$FilesDir.'user/config.php');
6
+include("".$MainDir."files/navheader.php"); 
7
+
8
+$page_name='Confirmation de suppression de page';
9
+include_once(''.$MainDir.'user/top.php');
10
+
11
+if(!@$_SESSION['session'])
12
+	{
13
+
14
+echo"<br><br>Vous ne pouvez pas effectuer cette opération si vous n'êêtes pas connecté.";
15
+	}
16
+	if(@$_SESSION['session']){
17
+		require_once(''.$MainDir.'user/verifications.php');
18
+		include("".$MainDir."files/check_admin.php");
19
+		
20
+		
21
+
22
+$this_page_id=$_GET['id'];
23
+
24
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
25
+
26
+$sql="SELECT * FROM page";
27
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
28
+$data_pages=mysql_fetch_assoc($req);
29
+
30
+$confirmed="0";
31
+
32
+if($admin_mode == "1"){
33
+	
34
+if(isset($_POST['oui'])){
35
+	
36
+	
37
+	$confirmed="1";
38
+	
39
+	if(($_POST['oui']=="Oui"))
40
+	{
41
+
42
+mysql_query("DELETE FROM page WHERE id_page='$this_page_id'") or die ('error : '.mysql_error());
43
+
44
+
45
+echo "<br><br>Opération effectuée ! <a href='".$root_path."'>Retour</a>";
46
+	} 
47
+						}
48
+if(($confirmed=="0")){
49
+	
50
+echo'<br><br>Etes-vous certain de vouloir supprimer cette page ?!!
51
+<br><br>
52
+<form action="'.$root_path.'files/page_suppression.php?id='.$this_page_id.'" method="post">
53
+<input name="oui" type="submit" value="Oui">
54
+ <a href="'.$root_path.'"><input type="button" value="Euh, non en fin de compte."></a>';
55
+
56
+					}
57
+	
58
+}else{
59
+	echo"<br><br>Mais que fais-tu ignorant ? Tu n'es pas administrateur !";
60
+	
61
+	}
62
+		
63
+		}
64
+
65
+
66
+
67
+
68
+
69
+?>

+ 28 - 0
files/submit_article.php Ver fichero

@@ -0,0 +1,28 @@
1
+<?php
2
+session_start();
3
+if (isset($_POST['titre']) AND isset ($_POST['article']))
4
+{
5
+require_once("../user/config.php");
6
+require_once('../user/verifications.php');
7
+
8
+
9
+
10
+$date = "42";
11
+$titre = addslashes($_POST['titre']);
12
+$article = addslashes($_POST['article']);
13
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
14
+$req = $bdd->prepare('INSERT INTO article(user,titre,article) VALUES (:user, :titre, :article)');
15
+$req->execute(array(
16
+		"user" => $username,
17
+		"titre" => $titre,
18
+		"article" => $article,
19
+
20
+));
21
+echo "Votre article a bien été enregistré ! <a href='".$root_path."'>Retour</a>";
22
+//echo date_default_timezone_set('l jS \of F Y h:i:s A');
23
+}
24
+else
25
+{
26
+echo "Il y a eu une erreur.";
27
+}
28
+?>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
files/submit_blog_config.php


+ 42 - 0
files/submit_edit.php Ver fichero

@@ -0,0 +1,42 @@
1
+<?php
2
+$FilesDir = str_replace("files", "",dirname(__FILE__));
3
+require_once("".$FilesDir."user/config.php");
4
+require_once(''.$MainDir.'user/verifications.php');
5
+if (isset($_POST['titre']) AND isset ($_POST['article']))
6
+{
7
+
8
+
9
+$this_article_id=$_GET['id'];
10
+
11
+$date = "42";
12
+$titre = $_POST['titre'];
13
+$article = $_POST['article'];
14
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
15
+
16
+$sql="SELECT * FROM article";
17
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
18
+$data_articles=mysql_fetch_assoc($req);
19
+
20
+
21
+mysql_query('UPDATE article SET titre=("'.$titre.'") WHERE id_article="'.$this_article_id.'"') or die ('error : '.mysql_error());
22
+
23
+mysql_query('UPDATE article SET article=("'.$article.'") WHERE id_article="'.$this_article_id.'"') or die ('error : '.mysql_error());
24
+
25
+
26
+
27
+
28
+//$req = $bdd->prepare('INSERT INTO article(user,titre,article) VALUES (:user, :titre, :article)');
29
+//$req->execute(array(
30
+//		"user" => $username,
31
+//		"titre" => $titre,
32
+//		"article" => $article,
33
+
34
+//));
35
+echo "Votre article a bien été enregistré ! <a href='".$root_path."'>Retour</a>";
36
+//echo date_default_timezone_set('l jS \of F Y h:i:s A');
37
+}
38
+else
39
+{
40
+echo "Il y a eu une erreur.";
41
+}
42
+?>

+ 41 - 0
files/submit_edit_page.php Ver fichero

@@ -0,0 +1,41 @@
1
+<?php
2
+require_once("../user/config.php");
3
+require_once('../user/verifications.php');
4
+if (isset($_POST['titre']) AND isset ($_POST['page']))
5
+{
6
+
7
+
8
+$this_page_id=$_GET['id'];
9
+
10
+$date = "42";
11
+$titre = addslashes($_POST['titre']);
12
+$page = addslashes($_POST['page']);
13
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
14
+
15
+$sql="SELECT * FROM page";
16
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
17
+$data_pages=mysql_fetch_assoc($req);
18
+
19
+
20
+mysql_query('UPDATE page SET titre="'.$titre.'" WHERE id_page="'.$this_page_id.'"') or die ('error : '.mysql_error());
21
+
22
+mysql_query('UPDATE page SET page="'.$page.'" WHERE id_page="'.$this_page_id.'"') or die ('error : '.mysql_error());
23
+
24
+
25
+
26
+
27
+//$req = $bdd->prepare('INSERT INTO page(user,titre,page) VALUES (:user, :titre, :page)');
28
+//$req->execute(array(
29
+//		"user" => $username,
30
+//		"titre" => $titre,
31
+//		"page" => $page,
32
+
33
+//));
34
+echo "Votre page a bien été enregistrée ! <a href='".$root_path."'>Retour</a>";
35
+//echo date_default_timezone_set('l jS \of F Y h:i:s A');
36
+}
37
+else
38
+{
39
+echo "Il y a eu une erreur.";
40
+}
41
+?>

+ 28 - 0
files/submit_page.php Ver fichero

@@ -0,0 +1,28 @@
1
+<?php
2
+session_start();
3
+if (isset($_POST['titre']) AND isset ($_POST['page']))
4
+{
5
+require_once("../user/config.php");
6
+require_once('../user/verifications.php');
7
+
8
+
9
+
10
+$date = "42";
11
+$titre = addslashes($_POST['titre']);
12
+$page = addslashes($_POST['page']);
13
+$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
14
+$req = $bdd->prepare('INSERT INTO page(user,titre,page) VALUES (:user, :titre, :page)');
15
+$req->execute(array(
16
+		"user" => $username,
17
+		"titre" => $titre,
18
+		"page" => $page,
19
+
20
+));
21
+echo "Votre page a bien été enregistrée ! <a href='".$root_path."'>Retour</a>";
22
+//echo date_default_timezone_set('l jS \of F Y h:i:s A');
23
+}
24
+else
25
+{
26
+echo "Il y a eu une erreur.";
27
+}
28
+?>

+ 34 - 0
files/up_check_admin.php Ver fichero

@@ -0,0 +1,34 @@
1
+<?php include("navheader.php");
2
+?>
3
+<?php 
4
+
5
+require '/../user/config.php';
6
+mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
7
+mysql_select_db(DB_DB);
8
+$sql="SELECT user_rank FROM user WHERE id_user=id_user";
9
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
10
+$user_ranking = mysql_fetch_assoc($req);
11
+
12
+
13
+$user_rank="$user_ranking[user_rank]";
14
+
15
+
16
+
17
+if(@$_SESSION['session'])
18
+{
19
+echo("<br>Etat utilisateur : Connecté <br>");
20
+echo "<br>";
21
+echo("Votre rang est : ".$user_ranking[user_rank].". ");
22
+if($user_rank!=1){
23
+echo("Vous n'êtes pas administrateur ! Vous ne pouvez pas accéder à cette partie du site.");
24
+}else{
25
+	
26
+	echo("<br>vous etes admin");
27
+}
28
+
29
+ ?>
30
+ <?php 
31
+
32
+
33
+}
34
+?>

BIN
img/1012919-10152363195122223-160090348-n.jpg Ver fichero


BIN
img/12299211-1029636273754798-1152374680217441977-n.jpg Ver fichero


BIN
img/2784030124-676e49e218-m.jpg Ver fichero


BIN
img/blag_logo.jpg Ver fichero


BIN
img/cat-edit-.peg Ver fichero


+ 1 - 0
img/great-progressive-rock-keyboard-players-in-the-world.jpg Ver fichero

@@ -0,0 +1 @@
1
+<html><head><title>Not Found</title></head><body><h1>404 - Not Found</h1></body></html>

+ 15 - 0
img/index.php Ver fichero

@@ -0,0 +1,15 @@
1
+<?php
2
+if(!defined('entry') || !entry) die('Not a valid page'); /* ===========================
3
+
4
+  gelato CMS - A PHP based tumblelog CMS
5
+  development version
6
+  http://www.gelatocms.com/
7
+
8
+  gelato CMS is a free software licensed under the GPL 2.0
9
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
10
+
11
+  =========================== */
12
+?>
13
+<?php
14
+// Nothing here
15
+?>

BIN
img/jan-akkerman.jpg Ver fichero


BIN
img/keyboardproglol.jpg Ver fichero


BIN
img/no-facebook-me.png Ver fichero


BIN
img/pecesamanet2004-2008.jpg Ver fichero


BIN
img/retroshare-symbol.png Ver fichero


BIN
img/upost_light.png Ver fichero


BIN
img/vander-taverne-de-lolympia-juin-1975.jpg Ver fichero


+ 391 - 0
index.php Ver fichero

@@ -0,0 +1,391 @@
1
+<?php 
2
+
3
+$index_check="1";
4
+require_once ('user/config.php');
5
+
6
+
7
+if(isset($root_path)){
8
+$page_name=$meta_description;
9
+include_once("user/top.php");
10
+include("files/navheader.php");
11
+}
12
+
13
+
14
+session_start();
15
+
16
+
17
+
18
+if(isset($_GET['error']))
19
+	{
20
+	echo'<span class="error">';
21
+	$error=$_GET['error'];
22
+	if($error=="username")
23
+		{
24
+		echo'Error : Your username is invalid';
25
+		}
26
+	if($error=="pass")
27
+		{
28
+		echo'error : Your password is invalid';
29
+		}
30
+	if($error=="connection")
31
+		{
32
+		echo"error : Your password don't match with your username";
33
+		}
34
+	echo'</span>';
35
+	}
36
+
37
+
38
+if(isset($root_path))
39
+	{
40
+
41
+mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
42
+mysql_select_db(DB_DB);
43
+$nombre_utilisateur=mysql_query("SELECT * FROM user") or die ('error : '.mysql_error());	
44
+$count_user=mysql_num_rows($nombre_utilisateur);
45
+	}
46
+if(isset($count_user) && $count_user == 0){
47
+
48
+	
49
+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>");
50
+
51
+
52
+} elseif(!isset($root_path)) {
53
+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 !";
54
+} else {
55
+?>
56
+
57
+
58
+
59
+
60
+<style type="text/css">
61
+html
62
+{
63
+height:100%;
64
+width:100%;
65
+}
66
+#header
67
+{
68
+width:100%;
69
+height:20%;
70
+font-size:50px;
71
+text-align:center;
72
+border-style:solid;
73
+border-color:black;
74
+border-size:1px;
75
+}
76
+.corps
77
+{
78
+width:80%;
79
+height:5%;
80
+border-bottom-style:solid;
81
+border-bottom-color:black;
82
+border-bottom-size:1px;
83
+//float:left;
84
+z-index:2;
85
+}
86
+#widget
87
+{
88
+margin-left:80%;
89
+width:15%;
90
+z-index:1;
91
+position:absolute;
92
+border-left-style:solid;
93
+border-left-color:black;
94
+border-left-size:2px;
95
+}
96
+a
97
+{
98
+color:black;
99
+text-decoration:none;
100
+}
101
+a:hover
102
+{
103
+color:black;
104
+text-decoration:underline;
105
+}
106
+#contact
107
+{
108
+color:white;
109
+text-decoration:none;
110
+}
111
+#contact:hover
112
+{
113
+color:white;
114
+text-decoration:underline;
115
+}
116
+</style>
117
+
118
+
119
+<div id="header"><p style="margin-top:3%;"><?php echo $site_name; ?></p></div>
120
+<div style="width:100%; color:white;">
121
+<p style="height:5%; background-color:black;">
122
+
123
+<marquee onmouseout="this.start();" onmouseover="this.stop();" loop="infinite" scrolldelay="100" scrollamount="5" direction="left">
124
+
125
+
126
+
127
+<?php echo $bandeau ?>
128
+
129
+
130
+</marquee>
131
+</p>
132
+</div>
133
+<div id="widget">
134
+<b>&nbsp;Pages :</b>
135
+<ul>
136
+<?php 
137
+
138
+
139
+
140
+$sql_page_menu="SELECT * FROM page ORDER BY priority";
141
+$req = mysql_query($sql_page_menu) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
142
+while($data_page_menu=mysql_fetch_assoc($req))
143
+{
144
+
145
+
146
+
147
+echo"<a href='?id_page=".$data_page_menu["id_page"]."'>{$data_page_menu["titre"]}</a><br><br>";
148
+}
149
+
150
+
151
+
152
+
153
+
154
+?>
155
+
156
+</ul>
157
+</div>
158
+
159
+<div class="corps">
160
+
161
+<?php 
162
+
163
+if(@!$_SESSION['session'])
164
+	{
165
+
166
+$connected="0";
167
+	}
168
+if(@$_SESSION['session'])
169
+	{
170
+require_once(''.$MainDir.'user/verifications.php');
171
+$connected="1";
172
+
173
+
174
+
175
+$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
176
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
177
+$user_ranking = mysql_fetch_assoc($req);
178
+$user_rank="$user_ranking[user_rank]";
179
+if($user_rank==1){
180
+	
181
+	$admin_mode = "1";
182
+	
183
+				}
184
+
185
+	}else{
186
+	
187
+	$admin_mode = "0";
188
+}
189
+
190
+
191
+
192
+
193
+////Start check content
194
+
195
+if(isset($_GET['id_page']) || $static_homepage_status=="1" && $static_homepage_id!=NULL){
196
+
197
+if(isset($_GET['id_page'])){
198
+	
199
+	$sql_page="SELECT * FROM page WHERE id_page=".$_GET['id_page']."";
200
+	
201
+}elseif($static_homepage_status=="1"){
202
+	
203
+	$sql_page="SELECT * FROM page WHERE id_page=".$static_homepage_id."";
204
+
205
+}
206
+$req_page = mysql_query($sql_page) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
207
+$data_page=mysql_fetch_assoc($req_page);
208
+
209
+if($data_page["id_page"]== null && $static_homepage_status!="1"){
210
+	
211
+	echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cette page existe pas j'ai l'impression cher camarade !<br><br>";
212
+	
213
+	
214
+}elseif($data_page["id_page"]== null && $static_homepage_status=="1"){
215
+	
216
+	echo"La page que vous aviez défini en page d'accueil n'existe plus.<br><br>";
217
+	
218
+}else{
219
+$page_name= $data_page["titre"];?>
220
+<title><?php echo $website_name.' : '.$page_name; ?></title>
221
+<?php
222
+$page_stripslash = stripslashes($data_page['page']);
223
+echo"<h2>{$data_page["titre"]}</h2>";
224
+echo"<b>".$page_date_display." :</b> {$data_page["date"]} par : {$data_page['user']}<br />";
225
+echo"<b>".$page_page_display." :</b><br />{$page_stripslash}<br><br>";
226
+
227
+
228
+if($connected==1){
229
+
230
+		if(isset($admin_mode) && $admin_mode==1){
231
+	echo"<br><br><b><a href='administration/edition_page.php?id={$data_page["id_page"]}'>Editer</a></b>";
232
+	
233
+	echo"  - <b><a href='files/page_suppression.php?id={$data_page["id_page"]}'>Supprimer</a></b><br><br>";
234
+if($static_homepage_status=="1" && $static_homepage_id != $data_page["id_page"] && $data_page["id_page"]!= null){
235
+	
236
+	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>";
237
+	
238
+}
239
+	
240
+						}
241
+				}
242
+				
243
+	}
244
+	
245
+
246
+
247
+
248
+
249
+	
250
+}elseif(isset($_GET['id'])){
251
+	
252
+$sql_article="SELECT * FROM article WHERE id_article=".$_GET['id']."";
253
+$req_article = mysql_query($sql_article) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
254
+$data_article=mysql_fetch_assoc($req_article);
255
+
256
+if($data_article["id_article"]== null){
257
+	
258
+	echo"<h1>QUATRE CENT QUATRE</h1><br>Non mais, cet article n'existe pas j'ai l'impression cher camarade !<br><br>";
259
+	
260
+	
261
+}else{
262
+
263
+$page_name= $data_article["titre"];?>
264
+<title><?php echo $website_name.' : '.$page_name; ?></title>
265
+<?php
266
+$article_stripslash = stripslashes($data_article['article']);
267
+echo"<h2>{$data_article["titre"]}</h2>";
268
+echo"<b>".$article_date_display." :</b> {$data_article["date"]} par : {$data_article['user']}<br />";
269
+echo"<b>".$article_article_display." :</b><br />{$article_stripslash}<br><br>";
270
+
271
+if($connected==1){
272
+
273
+		if($admin_mode==1){
274
+	echo"<br><br><b><a href='administration/edition_article.php?id={$data_article["id_article"]}'>Editer</a></b>";
275
+	
276
+	echo"  - <b><a href='files/article_suppression.php?id={$data_article["id_article"]}'>Supprimer</a></b><br /><br>";
277
+	
278
+						}
279
+				}
280
+
281
+}
282
+					
283
+	
284
+	
285
+}else{
286
+
287
+
288
+?>
289
+<?php
290
+
291
+
292
+
293
+if(empty($_GET['p'])) {
294
+$page='0,7'; }
295
+else if (!empty($_GET['p'])){
296
+$pg=$_GET['p'];
297
+$fin=$pg*7;
298
+$debut=$fin-7;
299
+$page=$debut.', 7';
300
+}
301
+
302
+
303
+
304
+$sql="SELECT * FROM article ORDER BY id_article DESC LIMIT ".$page."";
305
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
306
+while($data=mysql_fetch_assoc($req))
307
+{
308
+
309
+$article_stripslash = stripslashes($data['article']);
310
+
311
+echo"<br><br><b>".$article_title_display." :</b> <a href='?id=".$data["id_article"]."'>{$data["titre"]}</a><br />";
312
+echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
313
+echo"<b>".$article_article_display." :</b><br />{$article_stripslash}";
314
+
315
+if($connected==1){
316
+
317
+		if(isset($admin_mode) && $admin_mode==1){
318
+	echo"<br><br><b><a href='administration/edition_article.php?id={$data["id_article"]}'>Editer</a></b>";
319
+	
320
+	echo"  - <b><a href='files/article_suppression.php?id={$data["id_article"]}'>Supprimer</a></b><br />";
321
+	
322
+						}
323
+				}
324
+
325
+
326
+
327
+
328
+
329
+
330
+	}
331
+
332
+
333
+
334
+
335
+
336
+?>
337
+
338
+<br><br>Page <?php
339
+
340
+
341
+
342
+$sqlm='SELECT COUNT(*) AS nb_id FROM article';
343
+$reqm = mysql_query($sqlm) or die('Erreur SQL !<br />'.$sqlm.'<br />'.mysql_error());
344
+$donnee = mysql_fetch_array($reqm);
345
+$nb_pg=((int)($donnee['nb_id']/7))+1;
346
+$nb_pg_r=0;
347
+while($nb_pg_r!=$nb_pg AND $nb_pg_r<10){
348
+    if(empty($_GET['p'])){
349
+        $_GET['p'] = "1";
350
+    }
351
+$nb_pg_r=$nb_pg_r+1;
352
+?>
353
+ <a class="page" href="?p=<?php echo $nb_pg_r; ?>">
354
+ <?php
355
+    if($_GET['p']==$nb_pg_r){
356
+        echo '<strong>'.$nb_pg_r.'</strong>';
357
+    }else{
358
+        echo $nb_pg_r;
359
+    }
360
+ ?>
361
+
362
+ </a> &nbsp;
363
+
364
+<?php
365
+}
366
+
367
+mysql_close();
368
+?>
369
+<br>
370
+<br>
371
+<?php 
372
+}
373
+////End check content
374
+
375
+?>
376
+<title><?php echo $website_name.' : '.$page_name; ?></title>
377
+</div>
378
+
379
+</body>
380
+
381
+
382
+
383
+
384
+<div id="footer">
385
+<?php 
386
+echo "(Copyleft) ".$site_name." | Ce site utilise le CMS <a href='http://www.blogartisanal.tk/'>Blog Artisanal</a>.";
387
+}
388
+
389
+?></div>
390
+</html>
391
+

+ 10 - 0
install/install.txt Ver fichero

@@ -0,0 +1,10 @@
1
+Blog Artisanal Beta 1.0
2
+------------------------------------
3
+
4
+
5
+
6
+Utilisez le fichier sql_instructions.db pour créer les tables nécessaires dans la base de données souhaitée.
7
+
8
+N'oubliez pas de modifier le fichier /user/config.php afin qu'il soit en accord avec votre installation.
9
+
10
+

+ 86 - 0
install/sql_instructions.db Ver fichero

@@ -0,0 +1,86 @@
1
+
2
+
3
+--
4
+-- Structure de la table `article`
5
+--
6
+
7
+CREATE TABLE IF NOT EXISTS `article` (
8
+  `id_article` int(11) NOT NULL AUTO_INCREMENT,
9
+  `titre` varchar(120) NOT NULL,
10
+  `user` varchar(100) NOT NULL,
11
+  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+  `article` mediumtext NOT NULL,
13
+  PRIMARY KEY (`id_article`)
14
+) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
15
+
16
+--
17
+-- Contenu de la table `article`
18
+--
19
+
20
+INSERT INTO `article` (`id_article`, `titre`, `user`, `date`, `article`) VALUES
21
+(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 ! :-)');
22
+
23
+
24
+
25
+--
26
+-- Structure de la table `blog_config`
27
+--
28
+
29
+CREATE TABLE IF NOT EXISTS `blog_config` (
30
+  `site_name` varchar(120) NOT NULL,
31
+  `description` varchar(300) NOT NULL,
32
+  `bandeau` varchar(300) NOT NULL,
33
+  `static_homepage_status` int(1) DEFAULT '0',
34
+  `static_homepage_id` int(3) DEFAULT NULL,
35
+  UNIQUE KEY `site_name` (`site_name`)
36
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
37
+
38
+--
39
+-- Contenu de la table `blog_config`
40
+--
41
+
42
+INSERT INTO `blog_config` (`site_name`, `description`, `bandeau`, `static_homepage_status`, `static_homepage_id`) VALUES
43
+('Blog Artisanal', 'Un CMS libre et indépendant.', 'Utilise le CMS Blog Artisanal.', 0, 1);
44
+
45
+
46
+--
47
+-- Structure de la table `page`
48
+--
49
+
50
+CREATE TABLE IF NOT EXISTS `page` (
51
+  `id_page` int(11) NOT NULL AUTO_INCREMENT,
52
+  `titre` varchar(120) NOT NULL,
53
+  `user` varchar(100) NOT NULL,
54
+  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
+  `page` mediumtext NOT NULL,
56
+  `priority` int(3) NOT NULL DEFAULT '0',
57
+  PRIMARY KEY (`id_page`)
58
+) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
59
+
60
+
61
+--
62
+-- Contenu de la table `page`
63
+--
64
+
65
+INSERT INTO `page` (`id_page`, `titre`, `user`, `date`, `page`, `priority`) VALUES
66
+(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);
67
+
68
+
69
+
70
+--
71
+-- Structure de la table `user`
72
+--
73
+
74
+CREATE TABLE IF NOT EXISTS `user` (
75
+  `id_user` mediumint(9) NOT NULL AUTO_INCREMENT,
76
+  `session` text NOT NULL,
77
+  `username` text NOT NULL,
78
+  `pass` text NOT NULL,
79
+  `email` text NOT NULL,
80
+  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
81
+  `user_rank` int(2) NOT NULL,
82
+  PRIMARY KEY (`id_user`),
83
+  KEY `id` (`id_user`)
84
+) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
85
+
86
+

+ 42 - 0
rss.php Ver fichero

@@ -0,0 +1,42 @@
1
+<?php 
2
+require_once 'user/config.php';
3
+$page_name=$meta_description;
4
+
5
+
6
+session_start();
7
+
8
+$sql1="SELECT * FROM blog_config";
9
+$bloginfo_rss_req = mysql_query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.mysql_error());
10
+$bloginfo_rss = mysql_fetch_assoc($bloginfo_rss_req);
11
+
12
+echo "<?xml version='1.0' encoding='ISO-8859-1'?>
13
+<rss version='2.0'>
14
+    <channel>  
15
+        <title>".$site_name."</title>
16
+        <link>http://www.monsite.com</link>
17
+        <description>{$bloginfo_rss["description"]}</description>";
18
+$sql="SELECT * FROM article ORDER BY id_article DESC LIMIT 20";
19
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
20
+while($data=mysql_fetch_assoc($req))
21
+
22
+
23
+{
24
+$article_desc = strip_tags($data['article']);
25
+
26
+//
27
+//echo"{$data["titre"]}<///a><br />";
28
+//echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
29
+echo"        
30
+	<item>
31
+            <title>{$data["titre"]}</title>
32
+            <link>http://www.blogartisanal.tk/?id={$data["id_article"]}</link>
33
+            <guid isPermaLink='false'>6</guid>
34
+	    <description>{$article_desc}</description>
35
+            <pubDate>0000-00-00 00:00:00 GMT</pubDate>
36
+        </item>";
37
+}
38
+ echo"
39
+   </channel>
40
+</rss>";
41
+
42
+ ?>

+ 5 - 0
user/bottom.php Ver fichero

@@ -0,0 +1,5 @@
1
+<?php
2
+mysql_close();
3
+?>
4
+</body>
5
+</html>

+ 99 - 0
user/config.php Ver fichero

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+
4
+
5
+//	IMPORTANT : 
6
+//
7
+//	YOU MUST UNCOMMENT THE FOLLOWING (//$root_path="/";) LINE AND SET YOUR CMS LOCATION. 
8
+//
9
+//	For example : http://mywebsite.com/myfolder/ And don't forget the / at the end of the adress, 
10
+//	it won't work without it.
11
+//
12
+//	As soon as the $root_path is set, the Database will be tested, 
13
+//	don't forget to put your db settings bellow or it will print an SQL error.
14
+
15
+
16
+
17
+//$root_path="/";
18
+
19
+
20
+//SET OTHER PREFERENCES
21
+
22
+$lang="fr_fr";
23
+$blog_email='contact@mywebsite.com';
24
+$localite='local';
25
+$meta_key_words='member, space';
26
+
27
+//
28
+
29
+if(isset($root_path))
30
+	{
31
+
32
+
33
+//YOUR MySQL DATABASE SETTINGS
34
+
35
+$server='Your_MySQL_Server_Address';
36
+$user='Your_db_user';
37
+$passwd='Your_db_password';
38
+$base='Your_db_name';
39
+		
40
+
41
+
42
+
43
+
44
+   	define("DB_HOST",$server);
45
+	
46
+	define("DB_LOGIN",$user);
47
+	
48
+	define("DB_PASS",$passwd);
49
+	
50
+	define("DB_DB",$base);
51
+	
52
+
53
+
54
+
55
+@$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!');
56
+@mysql_select_db($base) or die ('Error : '.mysql_error());
57
+require_once('fonctions.php');
58
+
59
+mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
60
+mysql_select_db(DB_DB);
61
+$sql="SELECT * FROM blog_config";
62
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
63
+$blog_info_config_page = mysql_fetch_assoc($req);
64
+
65
+
66
+
67
+$ConfigDir = dirname(__FILE__);
68
+$MainDir = str_replace("user", "",$ConfigDir);
69
+
70
+$meta_description=$blog_info_config_page['description'];
71
+
72
+
73
+
74
+
75
+$site_name=$blog_info_config_page['site_name'];
76
+$website_name=$site_name;
77
+
78
+$bandeau = $blog_info_config_page['bandeau'];
79
+
80
+$static_homepage_status = $blog_info_config_page['static_homepage_status'];
81
+
82
+if($static_homepage_status=="1")
83
+		{
84
+	
85
+	$static_homepage_id = $blog_info_config_page['static_homepage_id'];
86
+	
87
+		}
88
+	}
89
+if($lang=="fr_fr"){
90
+	
91
+	include "".$MainDir."files/lang/fr_fr.php";
92
+	
93
+}elseif($lang=="en_us"){
94
+	
95
+	include''.$MainDir.'files/lang/en_us.php';
96
+	
97
+}
98
+
99
+?>

+ 99 - 0
user/config.php~ Ver fichero

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+
4
+
5
+//	IMPORTANT : 
6
+//
7
+//	YOU MUST UNCOMMENT THE FOLLOWING (//$root_path="/";) LINE AND SET YOUR CMS LOCATION. 
8
+//
9
+//	For example : http://mywebsite.com/myfolder/ And don't forget the / at the end of the adress, 
10
+//	it won't work without it.
11
+//
12
+//	As soon as the $root_path is set, the Database will be tested, 
13
+//	don't forget to put your db settings bellow or it will print an SQL error.
14
+
15
+
16
+
17
+$root_path="http://www.cebabonet.tk/blog/";
18
+
19
+
20
+//SET OTHER PREFERENCES
21
+
22
+$lang="fr_fr";
23
+$blog_email='contact@mywebsite.com';
24
+$localite='local';
25
+$meta_key_words='member, space';
26
+
27
+//
28
+
29
+if(isset($root_path))
30
+	{
31
+
32
+
33
+//YOUR MySQL DATABASE SETTINGS
34
+
35
+$server='Your_MySQL_Server_Address';
36
+$user='Your_db_user';
37
+$passwd='Your_db_password';
38
+$base='Your_db_name';
39
+		
40
+
41
+
42
+
43
+
44
+   	define("DB_HOST",$server);
45
+	
46
+	define("DB_LOGIN",$user);
47
+	
48
+	define("DB_PASS",$passwd);
49
+	
50
+	define("DB_DB",$base);
51
+	
52
+
53
+
54
+
55
+@$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!');
56
+@mysql_select_db($base) or die ('Error : '.mysql_error());
57
+require_once('fonctions.php');
58
+
59
+mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
60
+mysql_select_db(DB_DB);
61
+$sql="SELECT * FROM blog_config";
62
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
63
+$blog_info_config_page = mysql_fetch_assoc($req);
64
+
65
+
66
+
67
+$ConfigDir = dirname(__FILE__);
68
+$MainDir = str_replace("user", "",$ConfigDir);
69
+
70
+$meta_description=$blog_info_config_page['description'];
71
+
72
+
73
+
74
+
75
+$site_name=$blog_info_config_page['site_name'];
76
+$website_name=$site_name;
77
+
78
+$bandeau = $blog_info_config_page['bandeau'];
79
+
80
+$static_homepage_status = $blog_info_config_page['static_homepage_status'];
81
+
82
+if($static_homepage_status=="1")
83
+		{
84
+	
85
+	$static_homepage_id = $blog_info_config_page['static_homepage_id'];
86
+	
87
+		}
88
+	}
89
+if($lang=="fr_fr"){
90
+	
91
+	include "".$MainDir."files/lang/fr_fr.php";
92
+	
93
+}elseif($lang=="en_us"){
94
+	
95
+	include''.$MainDir.'files/lang/en_us.php';
96
+	
97
+}
98
+
99
+?>

+ 10 - 0
user/fonctions.php Ver fichero

@@ -0,0 +1,10 @@
1
+<?php
2
+
3
+function formulaires($value)
4
+	{
5
+	$value=trim(htmlspecialchars(addslashes($value)));
6
+	return $value;
7
+	}
8
+
9
+
10
+?>

+ 129 - 0
user/index.php Ver fichero

@@ -0,0 +1,129 @@
1
+<?php
2
+		require_once('config.php');
3
+	if(!@$_SESSION['session']){
4
+		session_start();
5
+		}
6
+		
7
+		if(@$_SESSION['session']){
8
+		require_once('verifications.php');
9
+		}
10
+		
11
+		
12
+	
13
+
14
+
15
+include("".$MainDir."files/navheader.php");
16
+
17
+?>
18
+<!DOCTYPE html>
19
+<html>
20
+<head>
21
+
22
+</head>
23
+<body>
24
+<center>
25
+<section>
26
+<?php
27
+if(!@$_SESSION['session'])
28
+	{
29
+
30
+	$page_name='Connexion';
31
+	include_once('top.php');
32
+
33
+	
34
+if(isset($_GET['error']))
35
+	{
36
+	echo'<span class="error">';
37
+	$error=$_GET['error'];
38
+	if($error=="username")
39
+		{
40
+		echo'Error : Your username is invalid';
41
+		}
42
+	if($error=="pass")
43
+		{
44
+		echo'error : Your password is invalid';
45
+		}
46
+	if($error=="connection")
47
+		{
48
+		echo"error : Your password don't match with your username";
49
+		}
50
+	echo'</span>';
51
+	}
52
+
53
+	?>
54
+<form method="post" action="login.php">
55
+<table width="300" border="0" align="center">
56
+<tr>
57
+<td colspan="2" >Login</td>
58
+</tr>
59
+<tr>
60
+<td><label for="username">Username : </label></td>
61
+<td><input type="text" name="username" id="username" /></td>
62
+</tr>
63
+<tr>
64
+<td><label for="passwd">Password : </label></td>
65
+<td><input type="password" name="passwd" id="passwd" />
66
+</td>
67
+</tr>
68
+<tr>
69
+<td>
70
+<input type="submit" value="Login" class="addbutton" />
71
+</td>
72
+</tr>
73
+</table>
74
+</form>
75
+<div align="center"><a href="register.php"> &rarr; Register !</a>
76
+<?php 
77
+if($localite != 'local')
78
+echo'<br /><a href="lost.php">Lost Password ?</a>';
79
+echo'</div>';
80
+	}
81
+else
82
+	{
83
+	require_once('config.php');
84
+
85
+	$page_name='Panneau Utilisateur';
86
+	include_once('top.php');
87
+	
88
+	
89
+?>
90
+	<div align="center"><strong>Welcome in your user panel <?php echo htmlspecialchars($username) ?> !</strong></br ></br>
91
+	Your e-mail : <?php echo htmlspecialchars($email) ?><br />
92
+	Your id : <?php echo htmlspecialchars($id_user) ?>	<br />
93
+	<a href="profile.php">Profile Modification</a><br />
94
+	<a href="logout.php">Logout</a></div>
95
+	
96
+	
97
+<?php 
98
+
99
+
100
+mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
101
+mysql_select_db(DB_DB);
102
+$sql="SELECT user_rank FROM user WHERE id_user=$id_user";
103
+$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
104
+$user_ranking = mysql_fetch_assoc($req);
105
+echo "<br>";
106
+echo("Votre rang est : ".$user_ranking['user_rank'].". ");
107
+
108
+$user_rank="$user_ranking[user_rank]";
109
+
110
+if($user_rank==1){
111
+echo("Vous êtes administrateur.");
112
+}
113
+?>
114
+
115
+<?php
116
+	}
117
+include_once('bottom.php');
118
+?>
119
+</div>
120
+
121
+</section>
122
+
123
+
124
+
125
+</center>
126
+
127
+</body>
128
+
129
+</html>

+ 39 - 0
user/login.php Ver fichero

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+session_start();
4
+require_once('config.php');
5
+
6
+$username = formulaires($_POST['username']);
7
+$passwd = formulaires($_POST['passwd']);
8
+
9
+
10
+$passwd=md5($passwd);
11
+
12
+if(!$username)
13
+	{
14
+	header('Location:'.$root_path.'index.php?error=username');
15
+	}
16
+if(!$passwd)
17
+	{
18
+	header('Location:'.$root_path.'index.php?error=pass');
19
+	}
20
+$reponse_cores=mysql_query("SELECT * FROM user WHERE pass='$passwd' AND username='$username'") or die ('error : '.mysql_error());
21
+$count_cores=mysql_num_rows($reponse_cores);
22
+if($count_cores == 0 )
23
+	{
24
+	header('Location:'.$root_path.'index.php?error=connection');
25
+	}
26
+
27
+else
28
+	{
29
+	for ($ligne=0;$ligne<30;$ligne++)		//Création d'un identifiant aléatoire
30
+		{
31
+		@$session.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
32
+		}
33
+	
34
+	mysql_query("UPDATE user SET session='$session' WHERE username='$username'") or die ('error : '.mysql_error());
35
+	$_SESSION['session'] = "$session";		//création de la session
36
+	header('Location:'.$root_path.'user/index.php');			//redirection vers l'index
37
+	}
38
+include_once('bottom.php');
39
+?>

+ 8 - 0
user/logout.php Ver fichero

@@ -0,0 +1,8 @@
1
+<?php
2
+require_once 'config.php';
3
+session_start();
4
+session_unset();
5
+session_destroy();
6
+
7
+header('Location:'.$root_path.'');
8
+?>

+ 31 - 0
user/lost.php Ver fichero

@@ -0,0 +1,31 @@
1
+<?php
2
+
3
+session_start();
4
+require_once('config.php');
5
+$page_name='Password Forgotten';
6
+include_once('top.php');
7
+
8
+?>
9
+<form  action="lost2.php" name="recup" method="POST">
10
+<table width="300" border="0" align="center">
11
+<tr>
12
+<td colspan="2" class="menu">Lost Password</td>
13
+</tr>
14
+<tr>
15
+<td><label for="email">E-mail :</label></td>
16
+<td><input type="text" name="email" id="email" /></td>
17
+</tr>
18
+<tr>
19
+<td><label for="username">Username :</label></td>
20
+<td><input type="text" name="username" id="username" /></td>
21
+</tr>
22
+<tr>
23
+<td><div align="center"><input type="submit" name="Submit" value="Envoyer"></div></td>
24
+</tr>
25
+</table>
26
+</form>
27
+<div align="center"><a href="index.php">Back</a>
28
+</div>
29
+<?php
30
+include_once('bottom.php');
31
+?>

+ 60 - 0
user/lost2.php Ver fichero

@@ -0,0 +1,60 @@
1
+<?php
2
+
3
+session_start();
4
+require_once('config.php');
5
+$page_name='Password forgotten';
6
+include_once('top.php');
7
+
8
+//récupération du formulaire
9
+$email=formulaires($_POST['email']);
10
+$username=formulaires($_POST['username']);
11
+if(!$email)
12
+	{
13
+	echo"Empty E-mail.<br /><a href='#' onClick='history.back()'>Back</a></center>";
14
+	include_once('bottom.php');
15
+	return FALSE;
16
+	}
17
+if(!$username)
18
+	{
19
+	echo"Empty username.<br /><a href='#' onClick='history.back()'>Back</a></center>";
20
+	include_once('bottom.php');
21
+	return FALSE;
22
+	}
23
+
24
+$reponse_username=mysql_query("SELECT username FROM user WHERE username='$username'") or die ('error : '.mysql_error());	
25
+$count_username=mysql_num_rows($reponse_username);
26
+if($count_username == 0)
27
+	{
28
+	echo"Invalid username.<br /><a href='#' onClick='history.back()'>Back</a>";
29
+	include_once('bottom.php');
30
+	return FALSE;
31
+	}
32
+
33
+$reponse_email=mysql_query("SELECT email FROM user WHERE email='$email'") or die ('error : '.mysql_error());	
34
+$count_email=mysql_num_rows($reponse_email);
35
+if($count_email == 0)
36
+	{
37
+	echo" Invalid E-mail.<br /><a href='#' onClick='history.back()'>Back</a>";
38
+	include_once('bottom.php');
39
+	return FALSE;
40
+	}
41
+
42
+$existe=mysql_query("SELECT email FROM user WHERE email='$email' AND username='$username'") or die ('error : '.mysql_error());	
43
+$test=mysql_num_rows($existe);
44
+if($test == 0)
45
+	{
46
+	echo"E-mail and Username don't match.<br /><a href='#' onClick='history.back()'>Back</a>";
47
+	include_once('bottom.php');
48
+	return FALSE;
49
+	}
50
+	
51
+for ($ligne=0;$ligne<10;$ligne++)		//Création d'un mot de passe aléatoire
52
+	{
53
+	@$passwd.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
54
+	}
55
+	
56
+mail("$email", "".$website_name." - Forgotten password" , "Hello, this is your new password : ".$passwd."", "From: ".$blog_email."");
57
+$passwd=md5($passwd);
58
+mysql_query("UPDATE user SET pass='$passwd' WHERE email='$email'") or die ('error : '.mysql_error());	
59
+echo 'An E-mail has been sent to your mailbox with your new password';
60
+?>

+ 59 - 0
user/profile.php Ver fichero

@@ -0,0 +1,59 @@
1
+<?php 
2
+require_once('config.php');
3
+require_once('verifications.php');;
4
+?>
5
+<!DOCTYPE html>
6
+<html>
7
+<head>
8
+<meta charset="UTF-8" />
9
+
10
+<title>Modification du Profile</title>
11
+
12
+<center>
13
+
14
+<section>
15
+<?php
16
+
17
+$page_name='Profile Modification';
18
+include_once('top.php');
19
+{
20
+?>
21
+<form action='profile2.php' method='post' enctype='multipart/form-data' name='form1'>
22
+	<table width='400' border='0' align='center'>
23
+	<tr>
24
+	<td colspan='2' ><div align=center><h2>Profile Modification</h2></div></td>
25
+	</tr>
26
+	<tr>
27
+	<td><label for='email'>E-mail modification</label></td>
28
+	<td><input name='email' type='text' id='email' value="<?php echo htmlspecialchars($email) ?>"></td>
29
+	</tr>
30
+	<tr>
31
+	<td><label for="passwd">Old password</label></td>
32
+	<td><input name="pass_enc" type="password" id="passwd"></td>
33
+	</tr>
34
+	<tr>
35
+	<td><label for="passwd2">New password</label></td>
36
+	<td><input name="new_pass" type="password" id="passwd2"></td>
37
+	</tr>
38
+	<tr>
39
+	<td><label for="passwd3">New password confirmation</label></td>
40
+	<td><input name="new_pass2" type="password" id="passwd3"></td>
41
+	</tr>
42
+	<tr>
43
+	<td><input type="submit" name="Submit" value="Modify" class="addbutton"></td>
44
+	</tr>
45
+	</table>
46
+	</form>
47
+	<div align=center><a href="index.php" onClick="history.back()">Back</a></div>
48
+<?php
49
+}
50
+include_once('bottom.php');
51
+?>
52
+
53
+</section>
54
+
55
+</center>
56
+
57
+</body>
58
+
59
+</html>

+ 115 - 0
user/profile2.php Ver fichero

@@ -0,0 +1,115 @@
1
+<?php session_start(); ?>
2
+<!DOCTYPE html>
3
+<html>
4
+<head>
5
+</head>
6
+<body>
7
+<center>
8
+<section>
9
+<?php
10
+
11
+require_once('config.php');
12
+require_once('verifications.php');
13
+$page_name='Profile Modification';
14
+include_once('top.php');
15
+
16
+//récupération du formulaire
17
+$email=formulaires($_POST['email']);
18
+$pass_enc=formulaires($_POST['pass_enc']);
19
+$new_pass=formulaires($_POST['new_pass']);
20
+$new_pass2=formulaires($_POST['new_pass2']);
21
+
22
+if(!$email)
23
+   	{
24
+?>
25
+
26
+	E-mail inexisant.<br /><a href='profile.php' onClick='history.back()'>Back</a>
27
+	</section>
28
+
29
+
30
+</center>
31
+
32
+</body>
33
+
34
+</html>
35
+	
36
+<?php
37
+	include_once('bottom.php');
38
+	return FALSE;
39
+   	}
40
+
41
+if(isset($pass_enc))
42
+	{
43
+	if(!$new_pass || !$new_pass2 || strlen($new_pass) < 5)
44
+	{
45
+	?>
46
+	
47
+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>
48
+</section>
49
+
50
+
51
+
52
+</center>
53
+
54
+</body>
55
+
56
+</html>
57
+	
58
+	
59
+<?php
60
+	include_once('bottom.php');
61
+	return FALSE;
62
+	}
63
+if($new_pass!=$new_pass2)
64
+	{
65
+	?>
66
+	Passwords don't match !<br /><a href="profile.php" onClick="history.back()">Back</a>
67
+	</section>
68
+
69
+</center>
70
+
71
+</body>
72
+
73
+</html>
74
+<?php
75
+	include_once('bottom.php');
76
+	return FALSE;
77
+	}
78
+	$pass_enc=md5($pass_enc);
79
+$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
80
+$count_pass=mysql_num_rows($reponse_pass);
81
+if($count_pass == 0)
82
+	{
83
+	?>
84
+	
85
+The old password is not correct.<br /><a href="profile.php" onClick="history.back()">Back</a>
86
+</section>
87
+
88
+
89
+
90
+</center>
91
+
92
+</body>
93
+
94
+</html>
95
+	
96
+	<?php
97
+	include_once('bottom.php');
98
+	return FALSE;
99
+	}
100
+	$new_pass=md5($new_pass);
101
+	mysql_query("UPDATE user SET pass='$new_pass' WHERE session='$session'") or die ('error : '.mysql_error());
102
+	}
103
+mysql_query("UPDATE user SET email='$email' WHERE session='$session'") or die ('error : '.mysql_error());
104
+echo"<div align=center>Your profile settings have been saved.<br /><a href='profile.php' onClick='history.back()'>Back</a></div>";
105
+include_once('bottom.php');
106
+?>
107
+
108
+</section>
109
+
110
+
111
+</center>
112
+
113
+</body>
114
+
115
+</html>

+ 64 - 0
user/register.php Ver fichero

@@ -0,0 +1,64 @@
1
+<!DOCTYPE html>
2
+
3
+
4
+
5
+<html>
6
+
7
+<head>
8
+
9
+
10
+<title>Register</title>
11
+
12
+
13
+</head>
14
+
15
+<body>
16
+
17
+
18
+
19
+<section>
20
+
21
+<?php
22
+
23
+require_once('config.php');
24
+$page_name='Register';
25
+include_once('top.php');
26
+?><form method='post' action='verification.php' enctype='multipart/form-data'>	
27
+	<table width="400" border="0" align="center">
28
+	<tr>
29
+	<td colspan="2"><h2>Register</h2></td>
30
+	</tr>
31
+	<tr>
32
+	<td><label for="username">Username : </label></td>
33
+	<td><input name="username" type="text" id="username" /></td>
34
+	</tr>
35
+	<tr>
36
+	<td><label for="email">E-mail : </label></td>
37
+	<td><input name="email" type="text" id="email" /></td>
38
+	</tr>
39
+	<tr>
40
+	<td><label for="passwd">Password : </label></td>
41
+	<td><input name="passwd" type="password" id="passwd" /></td>
42
+	</tr>
43
+	<tr>
44
+	<td><label for="passwd2">Password Confirmation: </label></td>
45
+	<td><input name="passwd2" type="password" id="passwd2" /></td>
46
+	</tr>
47
+	<tr>
48
+	<td><div align="center"><input type="submit" value="GO!" /></div></td>
49
+	</tr>
50
+	</table>
51
+	</form>
52
+	</div>
53
+	<center><a href="index.php">Back</a></center>
54
+<?php
55
+include_once('bottom.php');
56
+?>
57
+</section>
58
+
59
+
60
+</center>
61
+
62
+</body>
63
+
64
+</html>

+ 18 - 0
user/top.php Ver fichero

@@ -0,0 +1,18 @@
1
+<!DOCTYPE html>
2
+<head>
3
+<?php 
4
+if (!isset($index_check)){
5
+?>
6
+<title><?php echo $website_name.' : '.$page_name; ?></title>
7
+<?php 
8
+}
9
+?>
10
+<meta http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1" />
11
+<meta name="description" content="<?php echo $meta_description; ?>" />
12
+<meta name="keywords" content="<?php echo $meta_key_words; ?>" />
13
+<meta name="robots" content="all" />
14
+<link href="style.css" rel="stylesheet" type="text/css" />
15
+<link rel="alternate" type="application/rss+xml"
16
+    href="<?php echo $root_path; ?>rss.php" title="Blog Artisanal" />
17
+</head>
18
+<body>

+ 16 - 0
user/top.php~ Ver fichero

@@ -0,0 +1,16 @@
1
+<!DOCTYPE html>
2
+<head>
3
+<?php 
4
+if (!isset($index_check)){
5
+?>
6
+<title><?php echo $website_name.' : '.$page_name; ?></title>
7
+<?php 
8
+}
9
+?>
10
+<meta http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1" />
11
+<meta name="description" content="<?php echo $meta_description; ?>" />
12
+<meta name="keywords" content="<?php echo $meta_key_words; ?>" />
13
+<meta name="robots" content="all" />
14
+<link href="style.css" rel="stylesheet" type="text/css" />
15
+</head>
16
+<body>

+ 83 - 0
user/verification.php Ver fichero

@@ -0,0 +1,83 @@
1
+<?php
2
+
3
+	
4
+require_once('config.php');
5
+$page_name='Register';
6
+include_once('top.php');
7
+$email=htmlspecialchars(formulaires($_POST['email']));
8
+$username=htmlspecialchars(formulaires($_POST['username']));
9
+$passwd=htmlspecialchars(formulaires($_POST['passwd']));
10
+$passwd2=htmlspecialchars(formulaires($_POST['passwd2']));
11
+
12
+
13
+	
14
+//// VERIFICATIONS BANALES ////
15
+if(!$passwd || !$passwd2 || strlen($passwd) < 5)
16
+	{
17
+	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>';
18
+	include_once('bottom.php');
19
+return FALSE;
20
+	}
21
+if($passwd!=$passwd2)
22
+	{
23
+	echo'Passwords don\'t match !<br /><a href="register.php" onClick="history.Back()">Back</a>';
24
+	include_once('bottom.php');
25
+return FALSE;
26
+	}
27
+if(!$username || strlen($username) > 15)
28
+	{
29
+	echo'Your username is inexisant or is more than 15 caracters...<br /><a href="register.php" onClick="history.Back()">Back</a>';
30
+	include_once('bottom.php');
31
+return FALSE;
32
+	}
33
+if(!$email)
34
+   	{
35
+	echo'Your e-mail is innexistant.<br /><a href="register.php" onClick="history.Back()">Back</a>';
36
+	include_once('bottom.php');
37
+return FALSE;
38
+   	}
39
+	
40
+//// VERIFICATIONS DES EXISTANCES ////
41
+$reponse_mail=mysql_query("SELECT email FROM user WHERE email='$email'") or die ('error : '.mysql_error());	//verification si e-mail existe déjà
42
+$count_mail=mysql_num_rows($reponse_mail);
43
+if($count_mail == 1)
44
+	{
45
+	echo'This e-mail is already taken.<br /><a href="register.php" onClick="history.Back()">Back</a>';
46
+	include_once('bottom.php');
47
+return FALSE;
48
+	}
49
+$reponse_username=mysql_query("SELECT username FROM user WHERE username='$username'") or die ('error : '.mysql_error());	//verification si username existe déjà
50
+$count_username=mysql_num_rows($reponse_username);
51
+if($count_username == 1)
52
+	{
53
+	echo 'This username is already taken.<br /><a href="register.php" onClick="history.Back()">Back</a>';
54
+	include_once('bottom.php');
55
+return FALSE;
56
+	}
57
+		
58
+	for ($ligne=0;$ligne<30;$ligne++)
59
+		{
60
+		@$session.=substr('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN',(rand()%(strlen('0123456789AZERTYUIOPMLKJHGFDSQWXCVBN'))),1);
61
+		}
62
+
63
+		$passwd=md5($passwd);		//Codage du password
64
+		
65
+//// DEFINIR LE PREMIER UTILISATEUR COMME ADMINISTRATEUR ////		
66
+$nombre_utilisateur=mysql_query("SELECT * FROM user") or die ('error : '.mysql_error());	
67
+$count_user=mysql_num_rows($nombre_utilisateur);
68
+if($count_user == 0){
69
+$user_rank = '1';
70
+}else{
71
+$user_rank ='0';
72
+}
73
+
74
+if(!isset($website_name))
75
+{
76
+$website_name = "Blog Artisanal";
77
+}
78
+
79
+//// INSCRIPTION DANS LA BDD ////
80
+mysql_query("INSERT INTO user VALUES ('', '$session', '$username', '$passwd', '$email','','$user_rank')") or die ('error : '.mysql_error());	//insertion dans la bdd
81
+echo'Thank you for registering to '.$website_name.'<br /><a href="index.php">Login !</a>';
82
+include_once('bottom.php');
83
+?>

+ 29 - 0
user/verifications.php Ver fichero

@@ -0,0 +1,29 @@
1
+<?php
2
+if(!@$_SESSION['session']){
3
+		session_start();
4
+		}
5
+$session=htmlspecialchars(formulaires($_SESSION['session']));
6
+if(!@$_SESSION['session'])
7
+	{
8
+	header('Location:index.php?error=connection');
9
+	return false;
10
+	}
11
+	
12
+$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
13
+$verif=mysql_num_rows($verif);
14
+if($verif == 0)
15
+	{
16
+	header('Location:index.php?error=connection');
17
+	session_unset();
18
+	session_destroy();
19
+	return false;
20
+	}
21
+
22
+$sql=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error());
23
+while ($resultat = mysql_fetch_array($sql) )
24
+	{
25
+	$email = $resultat['email'];
26
+	$username = $resultat['username'];
27
+	$id_user = $resultat['id_user'];
28
+	}
29
+?>