summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2018-02-12 18:51:41 +0100
committerRoland Stigge <stigge@antcom.de>2018-02-12 18:51:41 +0100
commit5d54b83e1b9a74489970855e42d27691b471d900 (patch)
treec1a0b5235d6e194b0b25d94d96919df47815fe02
parent8b5da54e7df46a8cc54b6e448b94048ccd2b8df8 (diff)
Logout function only if logged in
-rw-r--r--html/index.html2
-rw-r--r--html/webbox.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/html/index.html b/html/index.html
index 80fa1d8..d33d678 100644
--- a/html/index.html
+++ b/html/index.html
@@ -47,7 +47,7 @@
<tr class="writecommand"><td class="entry" onclick="hideMenu(); rename();">Rename</td></tr>
<tr><td class="entry" onclick="hideMenu(); info();">Info</td></tr>
<tr><td class="entry" onclick="hideMenu(); selectAll();">Select/Unselect All</td></tr>
- <tr><td class="entry" onclick="hideMenu(); logout();">Logout</td></tr>
+ <tr id="logoutcommand" hidden><td class="entry" onclick="hideMenu(); logout();">Logout</td></tr>
<tr><td class="entry" onclick="hideMenu();">Close Menu</td></tr>
</table>
</div>
diff --git a/html/webbox.js b/html/webbox.js
index a564859..17ec25a 100644
--- a/html/webbox.js
+++ b/html/webbox.js
@@ -306,6 +306,10 @@ function initMainpage() {
if (authheader.startsWith("SR_Basic realm=\"") && authheader.endsWith("\"")) {
title = authheader.substr(16, authheader.length - 17);
}
+
+ // enable logout function if logging in
+ document.getElementById("logoutcommand").style.display = "table-row";
+
login(title);
return;
} else