SpreadQuiz/main.php
2024-03-05 16:07:47 +01:00

51 lines
1.8 KiB
PHP

<?php
require_once "globals.php";
require_once "usermgr.php";
require_once "autologin.php";
// if not logged in, then redirect to login page
$logged_in = get_autologin_state();
if (!$logged_in) {
header("Location: " . LOGIN_URL);
}
$user_data = get_autologin_user_data();
$privilege = $user_data["privilege"];
?>
<?php if ($logged_in) { ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SpreadQuiz</title>
<script src="js/req.js"></script>
<script src="js/spreadquiz.js"></script>
<link rel="stylesheet" href="style/spreadquiz.css"/>
</head>
<body>
<section id="screen_panel">
<section id="content_pane">
<iframe id="content_frame" src="default_frame.php"></iframe>
</section>
<section id="info_pane">
<section id="user_info" class="info-pane-element"><?= $user_data["nickname"]; ?></section>
<?php if ($privilege != PRIVILEGE_PLAYER) { ?>
<section id="action_panel" class="info-pane-element">
<?php if (($privilege === PRIVILEGE_CREATOR) || ($privilege === PRIVILEGE_QUIZMASTER)) { ?>
<input type="button" value="Tartalmak kezelése" onclick="open_in_content_frame('game_manager_frame.php')">
<?php } ?>
<?php if ($privilege === PRIVILEGE_QUIZMASTER) { ?>
<input type="button" value="Felhasználók kezelése" onclick="open_in_content_frame('user_manager_frame.php')">
<input type="button" value="Csoportok kezelése" onclick="open_in_content_frame('group_manager_frame.php')">
<?php } ?>
</section>
<?php } ?>
</section>
</section>
</body>
</html>
<?php } ?>