Add simple login button & indicator to navbar
This commit is contained in:
@@ -5,6 +5,10 @@ date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
require __DIR__ . '/../../src/_autoload.php';
|
||||
require __DIR__ . '/../../sql_config.php';
|
||||
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$attrs = $as->getAttributes();
|
||||
|
||||
$translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned'];
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
@@ -63,11 +67,23 @@ $projects = $projectManager->getAll();
|
||||
|
||||
</main>
|
||||
|
||||
<nav><ul>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="../">hjem</a></li>
|
||||
<li><a href="../kalender/">kalender</a></li>
|
||||
<li><a href="../aktiviteter/">aktiviteter</a></li>
|
||||
<li class="active"><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>
|
Reference in New Issue
Block a user