* [FIX] Fixed issue when a session is expired and an item view request is performed.

This commit is contained in:
nuxsmin
2017-01-26 12:29:43 +01:00
parent 509978c766
commit 3f2ad7b5d7
2 changed files with 9 additions and 15 deletions

View File

@@ -572,18 +572,6 @@ class ItemShowController extends ControllerBase implements ActionsInterface, Ite
$this->JsonResponse->setStatus(0);
}
/**
* Comprobar si la sesión está activa
*
* @throws \SP\Core\Exceptions\SPException
*/
protected function checkSession()
{
if (!Init::isLoggedIn()) {
Util::logout();
}
}
/**
* Obtener los datos para la vista de archivos de una cuenta
*

View File

@@ -29,7 +29,9 @@ use SP\Core\Messages\LogMessage;
use SP\Core\SessionUtil;
use SP\Http\JsonResponse;
use SP\Http\Request;
use SP\Util\Checks;
use SP\Util\Json;
use SP\Util\Util;
/**
* Class RequestControllerTrait
@@ -119,9 +121,13 @@ trait RequestControllerTrait
protected function checkSession()
{
if (!Init::isLoggedIn()) {
$this->JsonResponse->setDescription(__('La sesión no se ha iniciado o ha caducado', false));
$this->JsonResponse->setStatus(10);
Json::returnJson($this->JsonResponse);
if (Checks::isJson()) {
$this->JsonResponse->setDescription(__('La sesión no se ha iniciado o ha caducado', false));
$this->JsonResponse->setStatus(10);
Json::returnJson($this->JsonResponse);
} else {
Util::logout();
}
}
}
}