2017-10-28 17:19:40 +02:00
|
|
|
<?php
|
2018-02-13 19:10:15 +01:00
|
|
|
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
2017-11-11 17:06:56 +01:00
|
|
|
|
|
|
|
$as->requireAuth();
|
2017-10-28 17:19:40 +02:00
|
|
|
$attrs = $as->getAttributes();
|
2017-11-11 17:06:56 +01:00
|
|
|
$uname = $attrs['uid'][0];
|
|
|
|
|
2017-11-11 17:21:04 +01:00
|
|
|
$isAdmin = $userManager->isAdmin($uname);
|
|
|
|
$projectGroup = $userManager->hasGroup($uname, 'prosjekt');
|
|
|
|
$activityGroup = $userManager->hasGroup($uname, 'aktiviteter');
|
|
|
|
|
|
|
|
if(!($isAdmin | $projectGroup | $activityGroup)){
|
2018-02-13 18:30:49 +01:00
|
|
|
header('Content-Type: text/plain', true, 403);
|
|
|
|
echo "Her har du ikke lov't'å'værra!!!\r\n";
|
2017-11-11 17:06:56 +01:00
|
|
|
exit();
|
|
|
|
}
|
2017-10-28 17:19:40 +02:00
|
|
|
?>
|
|
|
|
|
2017-10-08 03:33:42 +02:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
2017-10-07 23:12:10 +02:00
|
|
|
<link rel="stylesheet" href="../css/normalize.css">
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<link rel="stylesheet" href="../css/events.css">
|
|
|
|
<link rel="stylesheet" href="../css/admin.css">
|
|
|
|
|
2017-10-22 17:57:55 +02:00
|
|
|
<header class="admin">Stor-­gutt-­leketøy</header>
|
2017-10-07 23:12:10 +02:00
|
|
|
|
|
|
|
<main>
|
|
|
|
|
|
|
|
<article>
|
|
|
|
<h2>Verktøy</h2>
|
2017-11-11 17:21:04 +01:00
|
|
|
<?php
|
|
|
|
if($isAdmin | $activityGroup){
|
|
|
|
echo '<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if($isAdmin | $projectGroup){
|
|
|
|
echo '<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if($isAdmin){
|
|
|
|
echo '<a class="btn adminbtn" href="brukere/">Brukere</a>';
|
|
|
|
}
|
|
|
|
?>
|
2017-10-07 23:12:10 +02:00
|
|
|
</article>
|
|
|
|
|
2017-10-08 03:33:42 +02:00
|
|
|
</main>
|
2017-11-11 15:20:58 +01:00
|
|
|
|
|
|
|
<nav>
|
|
|
|
<?= navbar(1); ?>
|
2018-02-13 18:30:49 +01:00
|
|
|
<?= loginbar(null, $pdo); ?>
|
2017-11-11 15:20:58 +01:00
|
|
|
</nav>
|