1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 07:40:32 +02:00

Possibilité de modifier la page d'accueil

This commit is contained in:
Yohann D'ANELLO
2020-01-21 23:23:14 +01:00
parent 94f907abf2
commit 48de59f630
4 changed files with 153 additions and 111 deletions

View File

@ -1,3 +1,20 @@
<?php
if (!file_exists("index"))
file_put_contents("index", file_get_contents("server_files/views/index.html"));
if (isset($_GET["edit"])) {
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ADMIN)
require_once "server_files/403.php";
if (isset($_POST["edit_page"])) {
$content = $_POST["content"];
file_put_contents("index", $content);
header("Location: /");
exit(0);
}
}
require_once "server_files/views/index.php";