BasicAuth Login/Logout eingebaut
This commit is contained in:
@ -124,6 +124,7 @@ mark {
|
||||
<li id="btnPreviewpage"><a href="#" onclick="PreviewPage()">Preview</a></li>
|
||||
<li id="btnSavepage"><a href="#" onclick="SavePage()">Save</a></li>
|
||||
<li id="btnPDFgen"><a href="#" onclick="PDFGen()">PDF</a></li>
|
||||
<li id="btnPDFgen"><a href="#" onclick="Logout()">Logout</a></li>
|
||||
</ul>
|
||||
<form class="navbar-form nav navbar-nav navbar-right" role="search">
|
||||
<div class="input-group">
|
||||
@ -370,6 +371,27 @@ mark {
|
||||
});
|
||||
}
|
||||
|
||||
function Logout(){
|
||||
try {
|
||||
// Hack for Firefox/Chrome
|
||||
$.ajax({
|
||||
url: "/",
|
||||
username: 'reset',
|
||||
password: 'reset',
|
||||
// If the return is 401, refresh the page to request new details.
|
||||
statusCode: { 401: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (exception) {
|
||||
// Hack for IE only
|
||||
if (!document.execCommand("ClearAuthenticationCache")) {
|
||||
document.location = "http://reset:reset@" + document.location.hostname + document.location.pathname;
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
//--------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user