1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-08 23:26:34 +02:00

Version 1.2.9: Some preparations

This commit is contained in:
Sebastian
2018-12-06 18:07:50 +01:00
parent 39d59df52a
commit 423e52271f
20 changed files with 338 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
use Typemill\Events\OnSettingsLoaded;
use Typemill\Events\OnPluginsLoaded;
use Typemill\Events\OnSessionSegmentsLoaded;
/****************************
* CREATE EVENT DISPATCHER *
@@ -103,13 +104,18 @@ $container['assets'] = function($c)
* DECIDE FOR SESSION *
************************/
$session_segments = array('setup', 'tm/', 'api/', '/setup', '/tm/', '/api/');
$path = $container['request']->getUri()->getPath();
$container['flash'] = false;
$container['csrf'] = false;
$session_segments = array('setup', 'tm/', 'api/', '/setup', '/tm/', '/api/');
# let plugins add own segments for session, eg. to enable csrf for forms
$client_segments = $dispatcher->dispatch('onSessionSegmentsLoaded', new OnSessionSegmentsLoaded([]))->getData();
$session_segments = array_merge($session_segments, $client_segments);
$path = $container['request']->getUri()->getPath();
$container['flash'] = false;
$container['csrf'] = false;
foreach($session_segments as $segment)
{
{
if(substr( $path, 0, strlen($segment) ) === $segment)
{
// configure session