mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53: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:
@@ -85,9 +85,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;
|
||||
|
||||
//link table rows (except the last - the list_control_icons cell) on a table with a class of 'tr_hover', according to the href attribute of the <tr> tag
|
||||
$('.tr_hover tr,.list tr').each(function(i,e) {
|
||||
|
||||
Reference in New Issue
Block a user