More fixes following merge

This commit is contained in:
Aaron Moses 2019-12-22 23:38:30 +00:00
parent 8d4b8c91d7
commit a0e0870f1a
3 changed files with 4 additions and 15 deletions

View File

@ -5,12 +5,6 @@ use \Grocy\Middleware\SessionAuthMiddleware;
use \Grocy\Middleware\ApiKeyAuthMiddleware; use \Grocy\Middleware\ApiKeyAuthMiddleware;
use \Tuupola\Middleware\CorsMiddleware; use \Tuupola\Middleware\CorsMiddleware;
$main_route_time_start = microtime(true);
$session_cookie_name = $appContainer->LoginControllerInstance->GetSessionCookieName();
$session_auth_middelware = new SessionAuthMiddleware($appContainer, $session_cookie_name);
$app->group('', function() $app->group('', function()
{ {
@ -127,9 +121,7 @@ $app->group('', function()
$this->get('/api', '\Grocy\Controllers\OpenApiController:DocumentationUi'); $this->get('/api', '\Grocy\Controllers\OpenApiController:DocumentationUi');
$this->get('/manageapikeys', '\Grocy\Controllers\OpenApiController:ApiKeysList'); $this->get('/manageapikeys', '\Grocy\Controllers\OpenApiController:ApiKeysList');
$this->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey'); $this->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey');
})->add(new SessionAuthMiddleware($appContainer, $appContainer->LoginControllerInstance->GetSessionCookieName()));
})->add($session_auth_middelware);
$app->group('/api', function() $app->group('/api', function()
{ {

View File

@ -6,11 +6,6 @@ class ApplicationService extends BaseService
{ {
private $InstalledVersion; private $InstalledVersion;
#private function __construct()
#{
# parent::__construct();
#}
public function GetInstalledVersion() public function GetInstalledVersion()
{ {
if ($this->InstalledVersion == null) if ($this->InstalledVersion == null)

View File

@ -9,9 +9,11 @@ class DemoDataGeneratorService extends BaseService
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->getLocalizationService() = new LocalizationService(GROCY_CULTURE); $this->LocalizationService = new LocalizationService(GROCY_CULTURE);
} }
protected $LocalizationService;
public function PopulateDemoData() public function PopulateDemoData()
{ {
$rowCount = $this->getDatabaseService()->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = -1')->fetchColumn(); $rowCount = $this->getDatabaseService()->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = -1')->fetchColumn();