2019-09-06 11:48:50 +00:00
|
|
|
<?php
|
|
|
|
|
2020-01-21 22:23:14 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "server_files/views/index.php";
|