Add simple login button & indicator to navbar
This commit is contained in:
@@ -3,6 +3,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();
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
use \pvv\side\Agenda;
|
||||
@@ -22,7 +26,8 @@ $day = (isset($_GET['day']))
|
||||
? $_GET['day']
|
||||
: -1;
|
||||
|
||||
?><!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Aktivitetsverkstedet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
@@ -75,7 +80,8 @@ foreach($events as $event) {
|
||||
|
||||
</main>
|
||||
|
||||
<nav><ul>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="../">hjem</a></li>
|
||||
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
|
||||
<li><a href="../kalender/">kalender</a></li>
|
||||
@@ -83,4 +89,15 @@ foreach($events as $event) {
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user