mirror of
https://github.com/typemill/typemill.git
synced 2025-08-05 05:37:45 +02:00
Version 1.2.19: Modularized Visual Editor
This commit is contained in:
@@ -10,16 +10,19 @@ class RedirectIfAuthenticated
|
||||
{
|
||||
protected $router;
|
||||
|
||||
public function __construct(RouterInterface $router)
|
||||
public function __construct(RouterInterface $router, $settings)
|
||||
{
|
||||
$this->router = $router;
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function __invoke(Request $request, Response $response, $next)
|
||||
{
|
||||
$editor = (isset($this->settings['editor']) && $this->settings['editor'] == 'visual') ? 'visual' : 'raw';
|
||||
|
||||
if(isset($_SESSION['login']))
|
||||
{
|
||||
$response = $response->withRedirect($this->router->pathFor('content.raw'));
|
||||
$response = $response->withRedirect($this->router->pathFor('content.' . $editor));
|
||||
}
|
||||
|
||||
return $next($request, $response);
|
||||
|
Reference in New Issue
Block a user