RVRNEXT-5 fix audit logger for non-web access

This commit is contained in:
bence committed 2023-04-28 20:58:19 +02:00
1 parent 882b326aca
commit 0b261b6272
2 files changed
+6 -3

No files matched your search

+3 -3
View File
@@ -17,9 +17,9 @@ class Container
static SokoWeb\Interfaces\Database\IConnection $dbConnection; static SokoWeb\Interfaces\Database\IConnection $dbConnection;
static SokoWeb\Interfaces\Database\IAuditLogger $auditLogger; static SokoWeb\Interfaces\Database\IAuditLogger $auditLogger;
static SokoWeb\Interfaces\PersistentData\IPersistentDataManager $persistentDataManager; static SokoWeb\Interfaces\PersistentData\IPersistentDataManager $persistentDataManager;
static SokoWeb\Interfaces\Routing\IRouteCollection $routeCollection; static ?SokoWeb\Interfaces\Routing\IRouteCollection $routeCollection = null;
static SokoWeb\Interfaces\Session\ISessionHandler $sessionHandler; static ?SokoWeb\Interfaces\Session\ISessionHandler $sessionHandler = null;
static SokoWeb\Interfaces\Request\IRequest $request; static ?SokoWeb\Interfaces\Request\IRequest $request = null;
} }
Container::$dbConnection = new SokoWeb\Database\Mysql\Connection($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']); Container::$dbConnection = new SokoWeb\Database\Mysql\Connection($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
+3
View File
@@ -6,6 +6,9 @@ class AuditLogger extends AuditLoggerBase
{ {
protected function getModifierId() protected function getModifierId()
{ {
if (\Container::$request === null) {
return null;
}
$user = \Container::$request->user(); $user = \Container::$request->user();
if ($user === null) { if ($user === null) {
return null; return null;