summaryrefslogtreecommitdiffstats
path: root/management-interface/views
diff options
context:
space:
mode:
authorNils Schwabe2014-05-19 16:54:33 +0200
committerNils Schwabe2014-05-19 16:54:33 +0200
commitcf58c1bf8213221545e9ec55b651189117fdfc17 (patch)
tree20eaa13fa8c72607409dbc565ffcba82b4b3c71a /management-interface/views
parentAdd new webinterface with f3 (framework) (diff)
downloadmasterserver-cf58c1bf8213221545e9ec55b651189117fdfc17.tar.gz
masterserver-cf58c1bf8213221545e9ec55b651189117fdfc17.tar.xz
masterserver-cf58c1bf8213221545e9ec55b651189117fdfc17.zip
Add login functionallity
Diffstat (limited to 'management-interface/views')
-rw-r--r--management-interface/views/home.htm2
-rw-r--r--management-interface/views/login.htm22
-rw-r--r--management-interface/views/menu.php19
-rw-r--r--management-interface/views/template.htm8
4 files changed, 47 insertions, 4 deletions
diff --git a/management-interface/views/home.htm b/management-interface/views/home.htm
index f9c8ac6..229e427 100644
--- a/management-interface/views/home.htm
+++ b/management-interface/views/home.htm
@@ -2,7 +2,7 @@
<div class="jumbotron">
<h1>{{ strtoupper(@_module) }}</h1>
- <p><p>
+ <p>Hello {{ @username }}<p>
</div>
</div> <!-- /container -->
diff --git a/management-interface/views/login.htm b/management-interface/views/login.htm
new file mode 100644
index 0000000..f447cb8
--- /dev/null
+++ b/management-interface/views/login.htm
@@ -0,0 +1,22 @@
+<check if="{{ @loggedin }}">
+<true>
+<div class="container">
+ <div class="jumbotron">
+ <h1>Already logged in.</h1>
+ </div>
+</div>
+</true>
+<false>
+<div class="container">
+ <form class="form-signin" action="{{ @hostname }}do/login" method="post">
+ <h2 class="form-signin-heading">Login</h2>
+ <input type="text" name="user" class="form-control" placeholder="Username" autofocus>
+ <input type="password" name="pass" class="form-control" placeholder="Password">
+ <label class="checkbox">
+ <input type="checkbox" name="remember" value="remember-me">Remember me</input>
+ </label>
+ <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
+ </form>
+</div>
+</false>
+</check>
diff --git a/management-interface/views/menu.php b/management-interface/views/menu.php
index b6af1be..9ef4068 100644
--- a/management-interface/views/menu.php
+++ b/management-interface/views/menu.php
@@ -8,7 +8,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="#">Project name</a>
+ <a class="navbar-brand" href="#"><?= $_title ?></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@@ -17,13 +17,26 @@
echo '<li';
echo ($value === $_module)? ' class="active"':'';
echo '>';
- echo '<a href="'.$value.'">';
- echo strtoupper($value);
+ echo '<a href="'.$hostname.$value.'">';
+ echo Util::firstcap($value);
echo '</a>';
echo '</li>';
}
?>
</ul>
+ <ul class="nav navbar-nav navbar-right">
+ <?php
+ if (!isset($_SESSION['username'])) {
+ echo '<li';
+ echo ('login' === $_module)? ' class="active"':'';
+ echo '>';
+ echo '<a href="'.$hostname.'login">Login</a></li>';
+ } else {
+ echo '<li>';
+ echo '<a href="'.$hostname.'logout">Logout</a></li>';
+ }
+ ?>
+ </ul>
</div><!--/.nav-collapse -->
</div>
</div>
diff --git a/management-interface/views/template.htm b/management-interface/views/template.htm
new file mode 100644
index 0000000..27affb5
--- /dev/null
+++ b/management-interface/views/template.htm
@@ -0,0 +1,8 @@
+ <div class="container">
+
+ <div class="jumbotron">
+ <h1>{{ strtoupper(@_module) }}</h1>
+ <p>Please fill this with content.</p>
+ </div>
+
+ </div> <!-- /container -->