-
Notifications
You must be signed in to change notification settings - Fork 338
/
header.php
executable file
·51 lines (41 loc) · 2.22 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<link rel="icon" type="image/png" href="/xvwa/img/xvwa-logo-1.png" />
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/xvwa/">XVWA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav pull-right navbar-nav">
<li class="dropdown" id="menuLogin">
<?php
include('config.php');
if(isset($_SESSION['user'])){
echo "<a href='#' class='dropdown-toggle' data-toggle='dropdown'> " . ucfirst(($_SESSION['user'])) . " <b class='caret'></b></a>";
echo "<ul class='dropdown-menu'>";
echo "<li><a href='".$XVWA_WEBROOT."/xvwa/logout.php'>Logout</a></li>";
echo "</ul>";
}else{
echo "<a class='dropdown-toggle' href='#' data-toggle='dropdown' id='navLogin'>Login</a>";
echo "<div class='dropdown-menu' style='padding:17px;'>";
echo "<form class='form' method='POST' id='formLogin' action='".$XVWA_WEBROOT."/xvwa/login.php'>";
echo "<input name='username' id='username' placeholder='Username' type='text'><br>";
echo "<input name='password' id='password' placeholder='Password' type='password'><br><br>";
echo "<button type='submit' id='btnLogin' class='btn btn-primary pull-right'>Login</button>";
echo "</form></div>";
}
?>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#myModal">About</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>