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

Version 1.1.3. Admin Dashboard

This commit is contained in:
Sebastian
2018-04-18 19:49:12 +02:00
parent c5c84c96bc
commit f8dc7093bf
65 changed files with 3285 additions and 1044 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace Typemill\Middleware;
use Slim\Interfaces\RouterInterface;
use Slim\Http\Request;
use Slim\Http\Response;
class RedirectIfAuthenticated
{
protected $router;
public function __construct(RouterInterface $router)
{
$this->router = $router;
}
public function __invoke(Request $request, Response $response, $next)
{
if(isset($_SESSION['login']))
{
$response = $response->withRedirect($this->router->pathFor('settings.show'));
}
return $next($request, $response);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace Typemill\Middleware;
use Slim\Interfaces\RouterInterface;
use Slim\Http\Request;
use Slim\Http\Response;
class RedirectIfUnauthenticated
{
protected $router;
public function __construct(RouterInterface $router, $flash)
{
$this->router = $router;
}
public function __invoke(Request $request, Response $response, $next)
{
if(!isset($_SESSION['login']))
{
$response = $response->withRedirect($this->router->pathFor('auth.show'));
}
return $next($request, $response);
}
}