Refactored, no more redirects. Improved error messaging system

This commit is contained in:
2023-03-06 19:25:21 +01:00
parent 7cfcaeb9d7
commit 78b97c5094
87 changed files with 1801 additions and 2633 deletions

View File

@@ -10,7 +10,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
include("includes.php");
if (($_SESSION['suser_role_admin'] == 0) and ($_SESSION['suser_role_manage'] == 0)) {
header_location('comments.php?comments=accessdenied');
$g_error->add('Access denied!');
$action = ACT_ERR_DENIED;
}
if (isset($_REQUEST['id'])) {
@@ -170,6 +171,14 @@ $smarty->assign("user", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("userdel.tpl");
elseif ($action == ACT_ERR_DENIED):
// ========== ERROR ACCESS TO PAGE DENIED =====================================
if (isset($_SERVER['HTTP_REFERER'])) {
echo '<p"><a href="', $_SERVER['HTTP_REFERER'], '">', "Back to last page</a></p>\n";
}
echo "<p></p>";
else:
// ========== ERROR UNKNOWN VARIANT ===========================================