* [ADD] Added URI signature for JS and CSS resources

* [MOD] Improved requests handling. It makes them more testing friendly
* [MOD] Code refactoring
This commit is contained in:
nuxsmin
2018-07-08 23:05:30 +02:00
parent 53a2552c05
commit a97b92131f
63 changed files with 914 additions and 618 deletions

View File

@@ -35,6 +35,7 @@ use SP\Core\Context\ContextInterface;
use SP\Core\Context\SessionContext;
use SP\Core\Events\EventDispatcher;
use SP\Core\UI\Theme;
use SP\Http\Request;
use SP\Mvc\Controller\ControllerTrait;
/**
@@ -86,6 +87,10 @@ abstract class SimpleControllerBase
* @var ConfigData
*/
protected $configData;
/**
* @var Request
*/
protected $request;
/**
* SimpleControllerBase constructor.
@@ -109,6 +114,7 @@ abstract class SimpleControllerBase
$this->theme = $this->dic->get(Theme::class);
$this->eventDispatcher = $this->dic->get(EventDispatcher::class);
$this->router = $this->dic->get(Klein::class);
$this->request = $this->dic->get(Request::class);
$this->acl = $this->dic->get(Acl::class);
if (method_exists($this, 'initialize')) {
@@ -121,8 +127,12 @@ abstract class SimpleControllerBase
*/
protected function checks()
{
$this->checkLoggedInSession($this->session, $this->router);
$this->checkSecurityToken($this->session);
$this->checkLoggedInSession($this->session, $this->request, function ($redirect) {
$this->router->response()
->redirect($redirect)
->send(true);
});
$this->checkSecurityToken($this->session, $this->request);
}
/**