mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
N°2822 - Fix timeout message through AJAX calls in the Portal
This commit is contained in:
@@ -65,6 +65,10 @@ class UserProvider implements ContainerAwareInterface
|
||||
public function onKernelRequest(GetResponseEvent $oGetResponseEvent)
|
||||
{
|
||||
// User pre-checks
|
||||
// Note: The following note and handling of the $iExitMethod were for the old login mechanism
|
||||
// and hasn't been reworked after the introduction of the new one as we saw it too late.
|
||||
// $iExitMethod and $iLogonRes may be useless now as the DoLoginEx method exits directly sometimes.
|
||||
//
|
||||
// Note: At this point the Exception handler is not registered, so we can't use $oApp::abort() method, hence the die().
|
||||
// - Checking user rights and prompt if needed (401 HTTP code returned if XHR request)
|
||||
$iExitMethod = ($oGetResponseEvent->getRequest()->isXmlHttpRequest()) ? LoginWebPage::EXIT_RETURN : LoginWebPage::EXIT_PROMPT;
|
||||
|
||||
@@ -466,6 +466,10 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
{% block pPageReadyScripts %}
|
||||
// Add proprietary header to identify our XHR calls
|
||||
$(document).ajaxSend(function(oEvent, oXHR, oOptions) {
|
||||
oXHR.setRequestHeader('X-Combodo-Ajax', 'true');
|
||||
});
|
||||
// Handle AJAX errors (exceptions (500), logout (401), ...)
|
||||
$(document).ajaxError(function(oEvent, oXHR, oSettings, sError){
|
||||
if(oXHR.status === 401)
|
||||
|
||||
Reference in New Issue
Block a user