Revize 57c95610
Přidáno uživatelem Ondřej Drtina před více než 3 roky(ů)
application/view/menu.php | ||
---|---|---|
3 | 3 |
<a class="px-4 py-1 <?php echo (strstr($_SERVER['PHP_SELF'], '/index.php') ? 'active' : '');?>" href="index.php">Úvodní info</a> |
4 | 4 |
<a class="px-4 py-1 <?php echo (strstr($_SERVER['PHP_SELF'],'/search.php') ? 'active' : '');?>" href="search.php">Vyhledávání</a> |
5 | 5 |
<a class="px-4 py-1 <?php echo (strstr($_SERVER['PHP_SELF'],'/manual.php') ? 'active' : '');?>" href="manual.php">Manuál</a> |
6 |
<a class="px-4 py-1 <?php echo (strstr($_SERVER['PHP_SELF'],'/login.php') ? 'active' : '');?>" href="#" data-toggle="modal" data-target="#login-modal">Přihlášení</a> |
|
6 |
<!-- show login button when user logged out OR show logout button when user logged in - START --> |
|
7 |
<?php |
|
8 |
if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true){ |
|
9 |
echo "<a class=\" px-4 py-1 "; |
|
10 |
echo (strstr($_SERVER['PHP_SELF'],'/login.php') ? 'active\"' : '\"'); |
|
11 |
echo "href=\"users.php\">Logout</a>"; |
|
12 |
}else{ |
|
13 |
echo "<a class=\" px-4 py-1 "; |
|
14 |
echo (strstr($_SERVER['PHP_SELF'],'/login.php') ? 'active\"' : '\"'); |
|
15 |
echo "href=\"#\" data-toggle=\"modal\" data-target=\"#login-modal\">Přihlášení</a>"; |
|
16 |
} |
|
17 |
?> |
|
18 |
<!-- show login button when user logged out OR show logout button when user logged in - END --> |
|
7 | 19 |
<?php |
8 | 20 |
if (isset($_SESSION['role']) && $_SESSION['role'] == "admin") { |
9 | 21 |
echo "<a class=\" px-4 py-1 "; |
Také k dispozici: Unified diff
#8643 - login, logout se mění, průběžný commit, TBD