mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Redirect to login page when auto-refreshing a (part of a) page while being logged out (#5951)
This commit is contained in:
@@ -80,9 +80,17 @@
|
||||
}
|
||||
|
||||
loadXmlHttp.prototype.stateChanged=function () {
|
||||
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
||||
//this.el.innerHTML = this.xmlHttp.responseText;
|
||||
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
|
||||
var url = new URL(this.xmlHttp.responseURL);
|
||||
if (/login\.php$/.test(url.pathname)) {
|
||||
// You are logged out. Stop refresh!
|
||||
url.searchParams.set('path', '<?php echo $_SERVER['REQUEST_URI']; ?>');
|
||||
window.location.href = url.href;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
||||
//this.el.innerHTML = this.xmlHttp.responseText;
|
||||
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
|
||||
}
|
||||
|
||||
var requestTime = function() {
|
||||
|
||||
Reference in New Issue
Block a user