Fix navbar in adminpanel

This commit is contained in:
Peder Bergebakken Sundt 2017-10-28 20:55:24 +02:00
parent 60ef214e1b
commit 53d97b5ccd
5 changed files with 50 additions and 16 deletions

2
.gitignore vendored
View File

@ -2,4 +2,4 @@
*.sqlite
/test.sql
/vendor/
/www/simplesaml
/www/simplesaml

View File

@ -5,6 +5,9 @@ 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);
@ -47,11 +50,25 @@ if($new == 0){
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
<nav><ul>
<li class="active"><a href="index.php">hjem</a></li>
<li><a href="aktiviteter/">aktiviteter</a></li>
<li><a href="kontakt">kontakt</a></li>
<li><a href="pvv/">wiki</a></li>
<nav>
<ul>
<li><a href="../">hjem</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">Aktivitets&shy;administrasjon</header>
@ -98,4 +115,4 @@ if($new == 0){
<p>
</article>
</main>
</main>

View File

@ -46,11 +46,12 @@ $events = array_values(array_filter(
<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>
<li><a href="../../index.php">hjem</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
@ -139,4 +140,4 @@ $events = array_values(array_filter(
</div>
</article>
</main>
</main>

View File

@ -5,6 +5,9 @@ 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);
$projectManager = new \pvv\side\ProjectManager($pdo);
$projects = $projectManager->getAll();
@ -41,11 +44,24 @@ if($new == 0){
<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">Prosjekt&shy;administrasjon</header>
@ -86,4 +102,4 @@ if($new == 0){
<p>
</article>
</main>
</main>

View File

@ -135,4 +135,4 @@ $projects = array_values(array_filter(
</div>
</article>
</main>
</main>