Generalize navigation and PHP configuration

This commit is contained in:
2017-11-11 15:20:58 +01:00
parent 9068042a7e
commit 6574bd576e
17 changed files with 98 additions and 292 deletions

View File

@@ -1,5 +1,5 @@
<?php
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
require_once __DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple('default-sp');
$attrs = $as->getAttributes();
?>
@@ -10,28 +10,6 @@ $attrs = $as->getAttributes();
<link rel="stylesheet" href="../css/events.css">
<link rel="stylesheet" href="../css/admin.css">
<nav>
<ul>
<li><a href="../">hjem</a></li>
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
<li><a href="../kalender/">kalender</a></li>
<li><a href="../aktiviteter/">aktiviteter</a></li>
<li><a href="../prosjekt/">prosjekter</a></li>
<li><a href="../kontakt/">kontakt</a></li>
<li><a href="../pvv/">wiki</a></li>
</ul>
<?php
$attr = $as->getAttributes();
if($attr){
$uname = $attr["uid"][0];
echo '<p class="login">logget inn som: ' . $uname . '</p>';
}else{
echo '<a class="login" href="' . $as->getLoginURL() . '">logg inn</a>';
}
?>
</nav>
<header class="admin">Stor-&shy;gutt-&shy;leketøy</header>
<main>
@@ -43,3 +21,8 @@ $attrs = $as->getAttributes();
</article>
</main>
<nav>
<?= navbar(1); ?>
<?= loginbar(); ?>
</nav>