This commit is contained in:
Krzysztof KrzysiekSiemv Smaga
2024-10-13 19:11:55 +02:00
parent eb805a994b
commit 619e221c61
18 changed files with 317 additions and 59 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
require "../../../../../_config.php";
require "../../Authentication/AuthController.php";
require "../PostController.php";
use BlogEngine\Posts\PostController;
use BlogEngine\Authentication\AuthController;
session_start();
$auth = new AuthController();
$conn = $auth->Connection();
$postcon = new PostController($auth);
if(isset($_POST['see'])){
header("location: /post.php?id={$_POST['see']}");
}
if(isset($_POST['delete'])){
if($postcon->DeletePost($_POST['delete'])){
header("location: /be_panel.php?s=posts");
$auth->Log("Usunięto post o ID: {$_POST['delete']}", "Information", $auth->GetID($_SESSION['uToken_BE']));
} else
$auth->Log("Nie udało się usunąć posta o ID: {$_POST['delete']}.", "Error", $auth->GetID($_SESSION['uToken_BE']));
}