Dernière correction
This commit is contained in:
parent
e0209d3117
commit
42a261dd2d
@ -1,4 +1,6 @@
|
||||
[main]
|
||||
root = "http://127.0.0.1/e59.fr/e59-website/html"
|
||||
wwwroot = "C:\\xampp\\htdocs\\e59.fr\\e59-website"
|
||||
title = "Club Réseaux"
|
||||
header-title = "E59"
|
||||
header-subtitle = "Club Réseaux"
|
||||
@ -7,7 +9,7 @@ copyright = "© Jan BELLON - E59"
|
||||
[sql]
|
||||
dbname = "E59"
|
||||
dbuser = "root"
|
||||
dbpass = "vcwfDitW9tQBsRJX"
|
||||
dbpass = "" ; vcwfDitW9tQBsRJX
|
||||
dbhost = "127.0.0.1"
|
||||
|
||||
[nav]
|
||||
|
@ -0,0 +1,11 @@
|
||||
# Utilisation des données<br />
|
||||
<br />
|
||||
Seuls les cookies nécessaires au bon fonctionnement du site sont stockés sur la machine de l'utilisateur.<br />
|
||||
<br />
|
||||
Il est possible de supprimer votre compte et toutes les données associées dans [compte.php](compte.php)<br />
|
||||
<br />
|
||||
###Liste des données personnelles stockées :<br />
|
||||
- Nom d'utilisateur<br />
|
||||
- E-mail<br />
|
||||
- Mot de passe chiffré<br />
|
||||
- Adresse IP
|
@ -0,0 +1,2 @@
|
||||
# Panneau d'administration
|
||||
<div><a href='upload.php'><div class='button'>Publier un article</div></a><a href='editpage.php'><div class='button'>Editer une page</div></a><a href='users.php'><div class='button'>Utilisateurs</div></a></div>
|
@ -1 +1,4 @@
|
||||
# Bienvenue cher visiteur !
|
||||
#Bienvenue sur le site e59.fr<br />
|
||||
##Ce site est la presse du Club Réseaux - E59.<br />
|
||||
###Consulter les dernières infos : <https://e59.fr/news.php><br />
|
||||
Pour nous contacter, envoyez un mail à [bod@intra.e59.fr](mailto:bod@intra.e59.fr)
|
9
content/journal/198183.md
Normal file
9
content/journal/198183.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Changelog update 1.0
|
||||
|
||||
- Creation de compte dans register.php
|
||||
- Classification confidentielle des articles
|
||||
- Publication d'articles en langage MarkDown
|
||||
- Mise à jour des informations de compte
|
||||
- Suppression de compte
|
||||
- Préférences de thème couleur
|
||||
- Adaptation du mode clair/sombre en fonction du navigateur
|
88
database/E59.sql
Normal file
88
database/E59.sql
Normal file
@ -0,0 +1,88 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.1
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Mar 09, 2024 at 03:55 PM
|
||||
-- Server version: 10.5.23-MariaDB-0+deb11u1
|
||||
-- PHP Version: 7.4.33
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
--
|
||||
-- Database: `E59`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `articles`
|
||||
--
|
||||
|
||||
CREATE TABLE `articles` (
|
||||
`ID` int(12) NOT NULL,
|
||||
`titre` varchar(255) NOT NULL,
|
||||
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`auteur` varchar(255) NOT NULL,
|
||||
`classification` int(12) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`ID` int(11) NOT NULL,
|
||||
`username` varchar(255) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`email` varchar(255) DEFAULT NULL,
|
||||
`creation_date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`display_name` varchar(255) DEFAULT 'Unnamed',
|
||||
`role` int(12) NOT NULL,
|
||||
`accreditation` int(12) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indexes for table `admins`
|
||||
--
|
||||
ALTER TABLE `admins`
|
||||
ADD PRIMARY KEY (`ID`);
|
||||
|
||||
--
|
||||
-- Indexes for table `articles`
|
||||
--
|
||||
ALTER TABLE `articles`
|
||||
ADD PRIMARY KEY (`ID`);
|
||||
|
||||
--
|
||||
-- Indexes for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
ADD PRIMARY KEY (`ID`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `admins`
|
||||
--
|
||||
ALTER TABLE `admins`
|
||||
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
|
||||
COMMIT;
|
@ -21,14 +21,14 @@ require "../include/functions.php";
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?=$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -27,14 +27,14 @@ if($_SESSION['role'] < 3) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/">
|
||||
<a href="<?=$root?>">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -79,14 +79,14 @@ if(isset($_POST['delete_account'])) {
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?=$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -13,24 +13,24 @@ $filetypes = [
|
||||
1 => "page"
|
||||
];
|
||||
|
||||
$repertoire = "/var/www/e59/";
|
||||
|
||||
if(isset($_GET['article']) && filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
if(file_exists($repertoire . "content/journal/" . $_GET['article'] . ".md")){
|
||||
$fichier = $repertoire . "content/journal/" . $_GET['article'] . ".md";
|
||||
if(file_exists($wwwroot . "/content/journal/" . $_GET['article'] . ".md")){
|
||||
$fichier = $wwwroot . "/content/journal/" . $_GET['article'] . ".md";
|
||||
$filename = $_GET['article'];
|
||||
$filetype = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['page']) && strpos($_GET['page'], "..") == false) {
|
||||
if(file_exists($repertoire . "content/" . $_GET['page'] . ".md")){
|
||||
$fichier = $repertoire . "content/" . $_GET['page'] . ".md";
|
||||
if(file_exists($wwwroot . "/content/" . $_GET['page'] . ".md")){
|
||||
$fichier = $wwwroot . "/content/" . $_GET['page'] . ".md";
|
||||
$filename = $_GET['page'];
|
||||
$filetype = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$filename = isset($filename) ? $filename : "";
|
||||
|
||||
if(isset($fichier)) {
|
||||
if(isset($_GET['article']) && isset($_POST['deletefile']) && $_POST['deletefile'] == "Supprimer") {
|
||||
if(unlink($fichier)) {
|
||||
@ -73,7 +73,7 @@ if(isset($fichier)) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
<style>
|
||||
textarea {
|
||||
@ -86,7 +86,7 @@ if(isset($fichier)) {
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/">
|
||||
<a href="<?=$root?>">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
@ -108,22 +108,22 @@ if(isset($fichier)) {
|
||||
<main>
|
||||
<div class="content">
|
||||
<div>
|
||||
<form action="?<?php echo $filetypes[$filetype] . "=" . $filename?>" method="post">
|
||||
<div>
|
||||
<?php
|
||||
if(isset($contenu)) {
|
||||
echo '<form action="?' . $filetypes[$filetype] . '=' . $filename . '" method="post">';
|
||||
echo "<div><div class='button'><a href='editpage.php'>Retour</a></div>";
|
||||
echo "<div><div class='button'><a href='news.php?article=" . $filename . "'>Voir l'article</a></div>";
|
||||
echo "<div><h1>" . $filename . "</h1></div>";
|
||||
echo '<div><textarea name="page-content">' . $texte = str_replace("<br />", "", $contenu) . '</textarea></div>';
|
||||
echo '<div><input type="submit" value="Publier"></div>';
|
||||
echo '<div><input type="submit" value="Publier"></div></form>';
|
||||
} else {
|
||||
echo "<div><div><h2>Pages</h2></div>";
|
||||
echo "<div>";
|
||||
$pages = scandir($repertoire . "content/");
|
||||
$pages = scandir($wwwroot . "/content/");
|
||||
foreach($pages as $page) {
|
||||
if($page != "." && $page != "..") {
|
||||
if (is_file($repertoire . "content/" . $page)) {
|
||||
if (is_file($wwwroot . "/content/" . $page)) {
|
||||
echo "<a href='?page=" . pathinfo($page, PATHINFO_FILENAME) . "'><div class='button'>" . pathinfo($page, PATHINFO_FILENAME) . "</div></a>";
|
||||
}
|
||||
}
|
||||
@ -149,7 +149,6 @@ if(isset($fichier)) {
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if(isset($contenu)) {
|
||||
echo '<form action=?article=' . $filename . ' method="post"><div><input type="submit" name="deletefile" value="Supprimer"></div></form>';
|
||||
|
@ -21,14 +21,14 @@ require "../include/functions.php";
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?=$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -52,14 +52,14 @@ if(isset($_POST['username']) && isset($_POST['password'])) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?=$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
require "../include/variables.php";
|
||||
require "../include/functions.php";
|
||||
|
||||
if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
if (isset($_GET['article']) && filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
$article = $_GET['article'];
|
||||
} else {
|
||||
$article = "";
|
||||
@ -26,14 +26,14 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
@ -80,8 +80,8 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
} else {
|
||||
echo "Aucun article trouvé";
|
||||
}
|
||||
} else if (!isset($_GET['search']) && $article != "" && file_exists('/var/www/e59/content/journal/' . $article . '.md')) {
|
||||
$markdownContent = file_get_contents('/var/www/e59/content/journal/' . $article . '.md');
|
||||
} else if (!isset($_GET['search']) && $article != "" && file_exists($wwwroot . '/content/journal/' . $article . '.md')) {
|
||||
$markdownContent = file_get_contents($wwwroot . '/content/journal/' . $article . '.md');
|
||||
|
||||
require_once '../include/parsedown.php';
|
||||
$parsedown = new Parsedown();
|
||||
|
@ -52,14 +52,14 @@ if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['passw
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/" class="athena-link">
|
||||
<a href="<?=$root?>" class="athena-link">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -2,20 +2,20 @@
|
||||
require "../include/variables.php";
|
||||
require "../include/functions.php";
|
||||
|
||||
$repertoire = "/var/www/e59/";
|
||||
|
||||
if($_SESSION['role'] < 3) {
|
||||
header("Location: login.php");
|
||||
http_response_code(404);
|
||||
die();
|
||||
}
|
||||
|
||||
$filename = rand(100000, 999999);
|
||||
|
||||
while(file_exists($wwwroot . "/content/journal/" . $filename . ".md")) {
|
||||
$filename = rand(100000, 999999);
|
||||
}
|
||||
|
||||
if(isset($_POST['page-content'])) {
|
||||
$filename = rand(100000, 999999);
|
||||
while(file_exists($repertoire . "content/journal/" . $filename . ".md")) {
|
||||
$filename = rand(100000, 999999);
|
||||
}
|
||||
file_put_contents($repertoire . "content/journal/" . $filename . ".md", nl2br($_POST['page-content']));
|
||||
file_put_contents($wwwroot . "/content/journal/" . $filename . ".md", nl2br($_POST['page-content']));
|
||||
|
||||
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
|
||||
$upload = $bdd->prepare("INSERT INTO articles (ID, titre, auteur, classification) VALUES (:filename, :titre, :auteur, :classification)");
|
||||
@ -31,6 +31,7 @@ if(isset($_POST['page-content'])) {
|
||||
header("Location: editpage.php?article=" . $filename);
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
@ -50,7 +51,7 @@ if(isset($_POST['page-content'])) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
<style>
|
||||
textarea {
|
||||
@ -63,7 +64,7 @@ if(isset($_POST['page-content'])) {
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/">
|
||||
<a href="<?=$root?>">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -41,14 +41,14 @@ if(isset($_POST['userid']) && isset($_POST['role']) && isset($_POST['accreditati
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="src/img/favicon.ico">
|
||||
<link rel="icon" href="./src/img/favicon.ico">
|
||||
<title><?=$title?></title>
|
||||
</head>
|
||||
<body class="body">
|
||||
<header>
|
||||
<div class="pancontent">
|
||||
<div class="athena-container">
|
||||
<a href="/">
|
||||
<a href="<?=$root?>">
|
||||
<img src="./src/img/athena-mono.png" class="athena">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -9,11 +9,17 @@ if(!isset($_SESSION['role'])) {
|
||||
$_SESSION['role'] = 0;
|
||||
}
|
||||
|
||||
if(!isset($_COOKIE['theme'])) {
|
||||
setcookie('theme', 0, time()+10*60*60);
|
||||
$theme_dark = $themes_dark[0];
|
||||
$theme_light = $themes_light[0];
|
||||
}
|
||||
|
||||
if(isset($_GET['theme'])) {
|
||||
setcookie('theme', (int)$_GET['theme'] % 2, time()+10*60*60);
|
||||
setcookie('theme', (int)$_GET['theme'] % 2);
|
||||
$theme_dark = $themes_dark[$_GET['theme']];
|
||||
$theme_light = $themes_light[$_GET['theme']];
|
||||
} else {
|
||||
} else if(isset($_COOKIE['theme'])){
|
||||
$theme_dark = $themes_dark[$_COOKIE['theme']];
|
||||
$theme_light = $themes_light[$_COOKIE['theme']];
|
||||
}
|
||||
|
@ -6,6 +6,9 @@ $dbpass = $config['sql']['dbpass'];
|
||||
$dbname = $config['sql']['dbname'];
|
||||
$dbhost = $config['sql']['dbhost'];
|
||||
|
||||
$root = $config['main']['root'];
|
||||
$wwwroot = $config['main']['wwwroot'];
|
||||
|
||||
$title = $config['main']['title'];
|
||||
$header_title = $config['main']['header-title'];
|
||||
$header_subtitle = $config['main']['header-subtitle'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user