Add simple login button & indicator to navbar

This commit is contained in:
Markus Wang Halvorsen 2017-10-28 17:19:40 +02:00
parent 7e3d256f93
commit 446d966e80
10 changed files with 159 additions and 11 deletions

View File

@ -5,6 +5,10 @@ setlocale(LC_ALL, 'no_NO');
error_reporting(E_ALL);
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);
$customActivity = new \pvv\side\DBActivity($pdo);
@ -40,12 +44,24 @@ $events = array_values(array_filter(
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
<nav><ul>
<nav>
<ul>
<li class="active"><a href="index.php">hjem</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">Aktivitets&shy;administrasjon</header>

View File

@ -1,10 +1,17 @@
<?php
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$attrs = $as->getAttributes();
?>
<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">
<nav><ul>
<nav>
<ul>
<li><a href="../">hjem</a></li>
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
<li><a href="../kalender/">kalender</a></li>
@ -12,6 +19,17 @@
<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>

View File

@ -5,6 +5,10 @@ setlocale(LC_ALL, 'no_NO');
error_reporting(E_ALL);
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);
$projectManager = new \pvv\side\ProjectManager($pdo);
@ -48,6 +52,16 @@ $projects = array_values(array_filter(
<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">Prosjekt&shy;administrasjon</header>

View File

@ -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>

View File

@ -14,7 +14,7 @@ nav li {
line-height: 3em;
margin: auto 1em;
}
nav li a {
nav a {
display: inline-block;
margin: auto;
color: gray;
@ -23,6 +23,14 @@ nav li a {
nav li.active a {
color: #048;
}
nav .login{
position: fixed;
top: .8em;
right: .8em;
margin: auto;
z-index: 3;
color: gray;
}
header {
margin-top: 3rem;
height: 16rem;

View File

@ -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();
$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);
@ -10,7 +14,8 @@ $agenda = new \pvv\side\Agenda([
new \pvv\side\social\NerdepitsaActivity,
new \pvv\side\social\AnimekveldActivity,
new \pvv\side\DBActivity($pdo),
]); ?>
]);
?>
<!DOCTYPE html>
<html lang="no">
<title>Programvareverkstedet</title>
@ -88,7 +93,8 @@ For å bli med i våre prosjekter og komitéer må du søke.
</main>
<nav><ul>
<nav>
<ul>
<li class="active"><a href="index.php">hjem</a></li>
<!--<li><a href="prosjekt/">prosjekter</a></li>-->
<li><a href="kalender/">kalender</a></li>
@ -96,4 +102,15 @@ For å bli med i våre prosjekter og komitéer må du søke.
<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>

View File

@ -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();
use \pvv\side\Agenda;
$months_translations = ['Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'];
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
@ -98,7 +102,8 @@ $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
</main>
<nav><ul>
<nav>
<ul>
<li><a href="../">hjem</a></li>
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
<li class="active"><a href="../kalender/">kalender</a></li>
@ -106,4 +111,15 @@ $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
<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>

View File

@ -4,6 +4,9 @@ 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();
?>
<html lang="no">
<title>Kommunikasjonsverkstedet</title>
@ -36,7 +39,8 @@ Det er også mulig å ta i bruk analog kontakt ved å møte opp <a href="https:/
</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>
@ -44,4 +48,15 @@ Det er også mulig å ta i bruk analog kontakt ved å møte opp <a href="https:/
<li><a href="../prosjekt/">prosjekter</a></li>
<li class="active"><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>

View File

@ -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>

View File

@ -31,13 +31,24 @@ $project = new \pvv\side\Project(
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
<nav><ul>
<nav>
<ul>
<li><a href="../index.php">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
if($attrs){
$uname = $attrs["uid"][0];
echo '<p class="login">logget inn som: ' . $uname . '</p>';
}else{
echo '<a class="login" href="' . $as->getLoginURL() . '">logg inn</a>';
}
?>
</nav>