41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
require_once __DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php';
|
|
|
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
$userManager = new \pvv\admin\UserManager($pdo);
|
|
|
|
$as = new SimpleSAML_Auth_Simple('default-sp');
|
|
$as->requireAuth();
|
|
$attrs = $as->getAttributes();
|
|
$uname = $attrs['uid'][0];
|
|
|
|
if(!($userManager->isAdmin($uname) | $userManager->hasGroup($uname, 'prosjekt') | $userManager->hasGroup($uname, 'aktiviteter'))){
|
|
echo 'Ingen tilgang';
|
|
exit();
|
|
}
|
|
?>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<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">
|
|
|
|
<header class="admin">Stor-­gutt-­leketøy</header>
|
|
|
|
<main>
|
|
|
|
<article>
|
|
<h2>Verktøy</h2>
|
|
<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>
|
|
<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>
|
|
</article>
|
|
|
|
</main>
|
|
|
|
<nav>
|
|
<?= navbar(1); ?>
|
|
<?= loginbar(); ?>
|
|
</nav>
|