Reorganize project part 3

This commit is contained in:
Bernd Bestel
2018-04-12 21:13:38 +02:00
parent 7dcd39f82f
commit 5a1d21ef31
86 changed files with 625 additions and 583 deletions

View File

@@ -12,14 +12,15 @@ class CliMiddleware
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
{
$response = $next($request, $response);
if (PHP_SAPI !== 'cli')
{
$response->write('Please call this only from CLI');
return $response->withHeader('Content-Type', 'text/plain')->withStatus(400);
}
return $response->withHeader('Content-Type', 'text/plain');
else
{
$response = $next($request, $response, $next);
return $response->withHeader('Content-Type', 'text/plain');
}
}
}

View File

@@ -2,9 +2,9 @@
namespace Grocy\Middleware;
use Grocy\Services\SessionService;
use \Grocy\Services\SessionService;
class SessionMiddleware
class SessionAuthMiddleware
{
public function __construct(\Slim\Container $container) {
$this->container = $container;