59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php /* Name: template_admin.php
|
|
Beschreibung: Grundstruktur einer PHP-Seite für Administratoren */
|
|
|
|
// Initialisierung
|
|
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/general_files/initialise.php';
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="de" dir="ltr">
|
|
<head>
|
|
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/html_head.php'; ?>
|
|
</head>
|
|
<body>
|
|
|
|
<?php // Besondere Admin-Rechte checken
|
|
// Fetch user details
|
|
$sql = "SELECT * FROM user_permissions up INNER JOIN user_general_information ugi ON up.user_id = ugi.user_id WHERE up.user_id = {$_SESSION["user_id"]}";
|
|
$result = $pdo->query($sql);
|
|
$isAdmin = $result->fetch(PDO::FETCH_ASSOC);
|
|
|
|
// Check if the user has admin access (Admin = 1)
|
|
if ($isAdmin["Admin"] == 1) {
|
|
$sql_groups = "SELECT * FROM user_permissions";
|
|
$stmt = $pdo->prepare($sql_groups);
|
|
$stmt->execute();
|
|
$groups = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
} else {
|
|
header("Location: {$g_httpHomePath}");
|
|
exit();
|
|
}
|
|
?>
|
|
|
|
<div class="header_title" id="header_title">
|
|
<span class="header_title_text">DUMMY-TITEL FÜR ADMIN-SEITE</span>
|
|
</div>
|
|
|
|
<div class="content" id="base">
|
|
<div class="content_panel">
|
|
|
|
<?php
|
|
if (isset($_SESSION["user_id"])):
|
|
?>
|
|
|
|
<form class="display_within" style="border:none"method="post" action="">
|
|
</form>
|
|
|
|
|
|
<?php else:
|
|
header("Location: $g_httpLoginPath");
|
|
exit();
|
|
endif; ?>
|
|
|
|
</div> <!-- EOD: content_panel -->
|
|
</div> <!-- EOD: content -->
|
|
|
|
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/projects/_central/php/footer.php'; ?>
|
|
|
|
</body>
|
|
</html>
|