Date: Thu, 14 Dec 2023 12:03:33 +0100
Subject: [PATCH 11/27] code cleanUp
---
src/Database/AlpdeskcoreMigration.php | 2 +-
.../AlpdeskcoreDatabasemanagerWidget.php | 32 +++++++++++++++++--
2 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/src/Database/AlpdeskcoreMigration.php b/src/Database/AlpdeskcoreMigration.php
index 64f21cf..89de058 100644
--- a/src/Database/AlpdeskcoreMigration.php
+++ b/src/Database/AlpdeskcoreMigration.php
@@ -40,7 +40,7 @@ public function executeMigrations(array $commands): void
public function showMigrations(): array
{
$schemaManager = $this->connection->createSchemaManager();
- $fromSchema = $schemaManager->createSchema();
+ $fromSchema = $schemaManager->introspectSchema();
return (new Comparator())->compareSchemas($fromSchema, $this->parseSql())->toSql($this->connection->getDatabasePlatform());
diff --git a/src/Widget/AlpdeskcoreDatabasemanagerWidget.php b/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
index 4029a62..d5b7d62 100644
--- a/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
+++ b/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
@@ -35,10 +35,14 @@ public function generate(): string
$username = $this->activeRecord->username;
$password = $this->activeRecord->password;
$database = $this->activeRecord->database;
- if ($host !== '' && $username !== '' && $password !== '' && $database !== '') {
+
+ if ($host !== '' && $username !== '' && $password !== '' && $database !== '' && $port > 0) {
+
$outputValue = $GLOBALS['TL_LANG']['tl_alpdeskcore_databasemanager']['valid_parameters'] . '
';
$connection = AlpdeskcoreDatabasemanagerModel::connectionById($id);
+
try {
+
if ($connection !== null) {
$migrations = $this->checkMigrations($connection, $this->activeRecord->databasemodel);
@@ -50,34 +54,51 @@ public function generate(): string
AlpdeskcoreDatabasemanagerModel::destroy($id);
$outputValue .= $GLOBALS['TL_LANG']['tl_alpdeskcore_databasemanager']['valid_connection'] . '
';
$outputValue .= '
';
+
foreach ($structure as $key => $value) {
+
$outputValue .= '';
}
} else {
$outputValue .= $GLOBALS['TL_LANG']['tl_alpdeskcore_databasemanager']['invalid_connection'] . '
';
}
+
} catch (\Exception $ex) {
$outputValue .= $ex->getMessage() . '
';
}
+
} else {
$outputValue .= $GLOBALS['TL_LANG']['tl_alpdeskcore_databasemanager']['invalid_parameters'] . '
';
}
+
}
+
return $migrationOutput . '' . $outputValue . '
';
+
}
+ /**
+ * @param Connection $connection
+ * @param mixed $modelUuid
+ * @return string
+ */
private function checkMigrations(Connection $connection, mixed $modelUuid): string
{
$migrations = '';
@@ -92,7 +113,7 @@ private function checkMigrations(Connection $connection, mixed $modelUuid): stri
$jsonFile = new File($jsonModelFile->path);
if ($jsonFile->exists()) {
- $jsonModel = \json_decode($jsonFile->getContent(), true);
+ $jsonModel = \json_decode($jsonFile->getContent(), true, 512, JSON_THROW_ON_ERROR);
if (\count($jsonModel) > 0) {
@@ -121,14 +142,21 @@ private function checkMigrations(Connection $connection, mixed $modelUuid): stri
} else {
$migrations .= '' . $GLOBALS['TL_LANG']['tl_alpdeskcore_databasemanager']['nomigrations'] . '
';
}
+
}
+
}
+
}
+
}
+
} catch (\Exception $ex) {
$migrations = $ex->getMessage();
}
return $migrations;
+
}
+
}
From b8a929c5023adb2a9c312e311f5445e254633dbc Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:20:05 +0100
Subject: [PATCH 12/27] code cleanUp
---
src/Database/AlpdeskcoreMigration.php | 124 ++++++++++++++++----------
1 file changed, 75 insertions(+), 49 deletions(-)
diff --git a/src/Database/AlpdeskcoreMigration.php b/src/Database/AlpdeskcoreMigration.php
index 89de058..ccd71f5 100644
--- a/src/Database/AlpdeskcoreMigration.php
+++ b/src/Database/AlpdeskcoreMigration.php
@@ -6,6 +6,7 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaConfig;
@@ -24,7 +25,7 @@ public function __construct(Connection $connection, array $model)
/**
* @param array $commands
- * @throws \Doctrine\DBAL\Exception
+ * @throws \Exception
*/
public function executeMigrations(array $commands): void
{
@@ -42,7 +43,13 @@ public function showMigrations(): array
$schemaManager = $this->connection->createSchemaManager();
$fromSchema = $schemaManager->introspectSchema();
- return (new Comparator())->compareSchemas($fromSchema, $this->parseSql())->toSql($this->connection->getDatabasePlatform());
+ $databasePlatForm = $this->connection->getDatabasePlatform();
+
+ if (!$databasePlatForm instanceof AbstractPlatform) {
+ throw new \Exception('invalid DatabasePlatform');
+ }
+
+ return $databasePlatForm->getAlterSchemaSQL((new Comparator())->compareSchemas($fromSchema, $this->parseSql()));
}
@@ -79,83 +86,93 @@ private function parseSql(): Schema
$table = $schema->createTable($currentTable['table']);
if (\array_key_exists('fields', $currentTable)) {
+
foreach ($currentTable['fields'] as $field => $fieldattributes) {
if (\is_array($fieldattributes)) {
$this->parseField($table, $field, $fieldattributes);
}
}
+
}
- if (\array_key_exists('primary', $currentTable)) {
- if (\is_array($currentTable['primary'])) {
- $table->setPrimaryKey($currentTable['primary']);
- }
+ if (\array_key_exists('primary', $currentTable) && \is_array($currentTable['primary'])) {
+ $table->setPrimaryKey($currentTable['primary']);
}
- if (\array_key_exists('index', $currentTable)) {
- if (\is_array($currentTable['index'])) {
- foreach ($currentTable['index'] as $indexname => $indexfields) {
+ if (\array_key_exists('index', $currentTable) && \is_array($currentTable['index'])) {
- if (\is_array($indexfields)) {
- $table->addIndex($indexfields, $indexname);
- }
+ foreach ($currentTable['index'] as $indexname => $indexfields) {
+
+ if (\is_array($indexfields)) {
+ $table->addIndex($indexfields, $indexname);
}
+
}
+
}
- if (\array_key_exists('foreignKeys', $currentTable)) {
- if (\is_array($currentTable['foreignKeys'])) {
+ if (\array_key_exists('foreignKeys', $currentTable) && \is_array($currentTable['foreignKeys'])) {
- foreach ($currentTable['foreignKeys'] as $foreignTable => $columnMatching) {
+ foreach ($currentTable['foreignKeys'] as $foreignTable => $columnMatching) {
- if (\is_array($columnMatching) && \count($columnMatching) > 0) {
+ if (\is_array($columnMatching) && \count($columnMatching) > 0) {
- // avalible RESTRICT, CASCADE, NO ACTION
- $options = [
- 'onDelete' => 'RESTRICT',
- 'onUpdate' => 'RESTRICT'
- ];
+ // avalible RESTRICT, CASCADE, NO ACTION
+ $options = [
+ 'onDelete' => 'RESTRICT',
+ 'onUpdate' => 'RESTRICT'
+ ];
- if (\array_key_exists('onDelete', $columnMatching)) {
- $options['onDelete'] = $columnMatching['onDelete'];
- }
+ if (\array_key_exists('onDelete', $columnMatching)) {
+ $options['onDelete'] = $columnMatching['onDelete'];
+ }
- if (\array_key_exists('onUpdate', $columnMatching)) {
- $options['onUpdate'] = $columnMatching['onUpdate'];
- }
+ if (\array_key_exists('onUpdate', $columnMatching)) {
+ $options['onUpdate'] = $columnMatching['onUpdate'];
+ }
- if (\array_key_exists('constraint', $columnMatching) && \is_array($columnMatching['constraint']) && \count($columnMatching['constraint']) > 0) {
+ if (
+ \array_key_exists('constraint', $columnMatching) &&
+ \is_array($columnMatching['constraint']) && \count($columnMatching['constraint']) > 0
+ ) {
- // Only one per Table // Maybe @TODO
- foreach ($columnMatching['constraint'] as $localColumn => $foreignColumn) {
+ // Only one per Table // Maybe @TODO
+ $cCounter = 0;
+ foreach ($columnMatching['constraint'] as $localColumn => $foreignColumn) {
- $table->addForeignKeyConstraint($foreignTable, [$localColumn], [$foreignColumn], $options);
- break;
+ $table->addForeignKeyConstraint($foreignTable, [$localColumn], [$foreignColumn], $options);
+ $cCounter++;
+ if ($cCounter > 0) {
+ break;
}
}
}
+
}
+
}
+
}
- if (\array_key_exists('unique', $currentTable)) {
- if (\is_array($currentTable['unique'])) {
+ if (\array_key_exists('unique', $currentTable) && \is_array($currentTable['unique'])) {
- $uniqueValueArray = $currentTable['unique'];
- foreach ($uniqueValueArray as $uValue) {
+ $uniqueValueArray = $currentTable['unique'];
+ foreach ($uniqueValueArray as $uValue) {
- if (\is_array($uValue)) {
- $table->addUniqueIndex($uValue);
- }
+ if (\is_array($uValue)) {
+ $table->addUniqueIndex($uValue);
}
}
+
}
+
}
+
}
return $schema;
@@ -170,7 +187,7 @@ private function parseSql(): Schema
* @param Table $table
* @param string $field
* @param array $fieldattributes
- * @throws \Doctrine\DBAL\Exception
+ * @throws \Exception
*/
private function parseField(Table $table, string $field, array $fieldattributes): void
{
@@ -187,30 +204,36 @@ private function parseField(Table $table, string $field, array $fieldattributes)
$precision = null;
$unsigned = false;
- if (\array_key_exists('unsigned', $fieldattributes)) {
- if ($fieldattributes['unsigned'] === true && \in_array(strtolower($fieldattributes['type']), array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'))) {
- $unsigned = true;
- }
+ if (
+ \array_key_exists('unsigned', $fieldattributes) &&
+ $fieldattributes['unsigned'] === true &&
+ \in_array(strtolower($fieldattributes['type']), array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'))
+ ) {
+ $unsigned = true;
}
$autoincrement = false;
- if (\array_key_exists('autoincrement', $fieldattributes)) {
- if ($fieldattributes['autoincrement'] === true) {
- $autoincrement = true;
- }
+ if (\array_key_exists('autoincrement', $fieldattributes) && $fieldattributes['autoincrement'] === true) {
+ $autoincrement = true;
}
$default = null;
if (\array_key_exists('default', $fieldattributes)) {
+
$default = $fieldattributes['default'];
if ($autoincrement === true || $default === 'NULL') {
$default = null;
}
+
}
$this->setLengthAndPrecisionByType($fieldattributes['type'], $dbType, $length, $scale, $precision, $fixed);
- $type = $this->connection->getDatabasePlatform()->getDoctrineTypeMapping($fieldattributes['type']);
+ $type = $this->connection->getDatabasePlatform()?->getDoctrineTypeMapping($fieldattributes['type']);
+ if ($type === null) {
+ throw new \Exception('invalid type for ' . $fieldattributes['type']);
+ }
+
if (0 === $length) {
$length = null;
}
@@ -235,8 +258,10 @@ private function parseField(Table $table, string $field, array $fieldattributes)
];
if (null !== $scale && null !== $precision) {
+
$options['scale'] = $scale;
$options['precision'] = $precision;
+
}
$platformOptions = [];
@@ -257,6 +282,7 @@ private function parseField(Table $table, string $field, array $fieldattributes)
}
$table->addColumn($field, $type, $options);
+
}
private function setLengthAndPrecisionByType(string $type, string $dbType, ?int &$length, ?int &$scale, ?int &$precision, bool &$fixed): void
From 476a80471625b6b889edaf0546e25eb6cb2cb8ea Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:25:08 +0100
Subject: [PATCH 13/27] code cleanUp
---
src/Events/Listener/AlpdeskCoreBackendMenuListener.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Events/Listener/AlpdeskCoreBackendMenuListener.php b/src/Events/Listener/AlpdeskCoreBackendMenuListener.php
index 7602cdf..d1bc539 100644
--- a/src/Events/Listener/AlpdeskCoreBackendMenuListener.php
+++ b/src/Events/Listener/AlpdeskCoreBackendMenuListener.php
@@ -5,8 +5,8 @@
namespace Alpdesk\AlpdeskCore\Events\Listener;
use Alpdesk\AlpdeskCore\Utils\Utils;
-use Symfony\Component\Security\Core\Security;
use Contao\CoreBundle\Event\MenuEvent;
+use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\RouterInterface;
use Contao\BackendUser;
From 7de0b1f626af9fa2a06cc94531c4120a8649454c Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:28:59 +0100
Subject: [PATCH 14/27] code cleanUp
---
src/Events/Callbacks/DcaCallbacks.php | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/Events/Callbacks/DcaCallbacks.php b/src/Events/Callbacks/DcaCallbacks.php
index 847a238..f53bd08 100644
--- a/src/Events/Callbacks/DcaCallbacks.php
+++ b/src/Events/Callbacks/DcaCallbacks.php
@@ -170,7 +170,7 @@ public function getCrudTables(?DataContainer $dc): array
try {
$schemaManager = $this->connection->createSchemaManager();
- $tables = $schemaManager->createSchema()->getTables();
+ $tables = $schemaManager->introspectSchema()->getTables();
$preparedTables = [];
foreach ($tables as $table) {
@@ -183,8 +183,7 @@ public function getCrudTables(?DataContainer $dc): array
return $preparedTables;
-
- } catch (\Throwable $tr) {
+ } catch (\Throwable) {
return [];
}
From 4b53314786b97eb1de846d94b06736ec0354fa21 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:31:30 +0100
Subject: [PATCH 15/27] code cleanUp
---
src/Jwt/JwtToken.php | 6 +++---
src/Logging/AlpdeskcoreLogger.php | 32 +++++++++++++++++++++++++++++--
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/Jwt/JwtToken.php b/src/Jwt/JwtToken.php
index 637a5e6..1e1c920 100644
--- a/src/Jwt/JwtToken.php
+++ b/src/Jwt/JwtToken.php
@@ -93,14 +93,14 @@ public static function getClaim(string $token, string $name): mixed
try {
$tokenObject = self::parse($token);
-
+
if (!$tokenObject instanceof UnencryptedToken) {
throw new \Exception('invalid token instance');
}
$value = $tokenObject->claims()->get($name);
- } catch (\Exception $ex) {
+ } catch (\Exception) {
$value = null;
}
@@ -136,7 +136,7 @@ public static function validateAndVerify(string $token, string $jti): bool
$value = !$tokenObject->isExpired($now);
}
- } catch (\Exception $ex) {
+ } catch (\Exception) {
$value = false;
}
diff --git a/src/Logging/AlpdeskcoreLogger.php b/src/Logging/AlpdeskcoreLogger.php
index 667de73..6342dfa 100644
--- a/src/Logging/AlpdeskcoreLogger.php
+++ b/src/Logging/AlpdeskcoreLogger.php
@@ -3,7 +3,6 @@
namespace Alpdesk\AlpdeskCore\Logging;
use Contao\Config;
-use DateTimeZone;
use Monolog\Formatter\LineFormatter;
use Monolog\Logger;
use Monolog\Handler\RotatingFileHandler;
@@ -26,6 +25,10 @@ public function __construct(ContaoFramework $framework, string $rootDir, string
$this->environment = $environment;
}
+ /**
+ * @return void
+ * @throws \Exception
+ */
private function initialize(): void
{
if ($this->initialized === false) {
@@ -37,7 +40,7 @@ private function initialize(): void
$this->logger = new Logger('alpdeskcorelogger');
$timeZone = Config::get('timeZone');
- $this->logger->setTimezone(new DateTimeZone($timeZone));
+ $this->logger->setTimezone(new \DateTimeZone($timeZone));
$handler = new RotatingFileHandler($this->rootDir . '/var/logs/' . $this->environment . '-alpdesk.log', 0, ($this->environment === 'dev' ? Logger::DEBUG : Logger::WARNING));
@@ -54,27 +57,52 @@ private function initialize(): void
}
+ /**
+ * @param mixed $strText
+ * @param mixed $strFunction
+ * @return void
+ * @throws \Exception
+ */
public function info(mixed $strText, mixed $strFunction): void
{
$this->initialize();
$this->logger->info($strFunction . ' => ' . $strText);
}
+ /**
+ * @param mixed $strText
+ * @param mixed $strFunction
+ * @return void
+ * @throws \Exception
+ */
public function debug(mixed $strText, mixed $strFunction): void
{
$this->initialize();
$this->logger->debug($strFunction . ' => ' . $strText);
}
+ /**
+ * @param mixed $strText
+ * @param mixed $strFunction
+ * @return void
+ * @throws \Exception
+ */
public function warning(mixed $strText, mixed $strFunction): void
{
$this->initialize();
$this->logger->warning($strFunction . ' => ' . $strText);
}
+ /**
+ * @param mixed $strText
+ * @param mixed $strFunction
+ * @return void
+ * @throws \Exception
+ */
public function error(mixed $strText, mixed $strFunction): void
{
$this->initialize();
$this->logger->error($strFunction . ' => ' . $strText);
}
+
}
From d9302c696d0e967857f1f0ef96399c5d3a17611d Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:38:35 +0100
Subject: [PATCH 16/27] code cleanUp
---
.../AlpdeskcoreDatabasemanagerModel.php | 54 ++++++++-----------
1 file changed, 21 insertions(+), 33 deletions(-)
diff --git a/src/Model/Database/AlpdeskcoreDatabasemanagerModel.php b/src/Model/Database/AlpdeskcoreDatabasemanagerModel.php
index 113b205..52f9bcd 100644
--- a/src/Model/Database/AlpdeskcoreDatabasemanagerModel.php
+++ b/src/Model/Database/AlpdeskcoreDatabasemanagerModel.php
@@ -18,16 +18,12 @@ class AlpdeskcoreDatabasemanagerModel extends Model
private static function create(int $id, string $host, int $port, string $username, string $password, string $database): ?Connection
{
- if (\count(self::$connectionsTable) > 0 && \array_key_exists($id, self::$connectionsTable)) {
-
- if (self::$connectionsTable[$id] instanceof Connection) {
-
- if (self::$connectionsTable[$id] !== null && self::$connectionsTable[$id]->isConnected()) {
- return self::$connectionsTable[$id];
- }
-
- }
-
+ if (
+ \array_key_exists($id, self::$connectionsTable) &&
+ self::$connectionsTable[$id] instanceof Connection &&
+ self::$connectionsTable[$id]->isConnected()
+ ) {
+ return self::$connectionsTable[$id];
}
$params = [
@@ -50,7 +46,7 @@ private static function create(int $id, string $host, int $port, string $usernam
return self::$connectionsTable[$id];
- } catch (\Exception $e) {
+ } catch (\Throwable) {
}
@@ -59,18 +55,13 @@ private static function create(int $id, string $host, int $port, string $usernam
public static function destroy(int $id): void
{
- if (\array_key_exists($id, self::$connectionsTable)) {
-
- if (self::$connectionsTable[$id] instanceof Connection) {
-
- if (self::$connectionsTable[$id] !== null) {
-
- self::$connectionsTable[$id]->close();
- self::$connectionsTable[$id] = null;
+ if (
+ \array_key_exists($id, self::$connectionsTable) &&
+ self::$connectionsTable[$id] instanceof Connection
+ ) {
- }
-
- }
+ self::$connectionsTable[$id]->close();
+ self::$connectionsTable[$id] = null;
}
}
@@ -93,7 +84,7 @@ public static function listTables(int $id, ?string $name): array
try {
- $tables = self::$connectionsTable[$id]->createSchemaManager()->createSchema()->getTables();
+ $tables = self::$connectionsTable[$id]->createSchemaManager()->introspectSchema()->getTables();
$structure = array();
foreach ($tables as $table) {
@@ -222,16 +213,12 @@ public static function listTables(int $id, ?string $name): array
*/
public static function connectionById(int $id): ?Connection
{
- if (\count(self::$connectionsTable) > 0 && \array_key_exists($id, self::$connectionsTable)) {
-
- if (self::$connectionsTable[$id] instanceof Connection) {
-
- if (self::$connectionsTable[$id] !== null && self::$connectionsTable[$id]->isConnected()) {
- return self::$connectionsTable[$id];
- }
-
- }
-
+ if (
+ \array_key_exists($id, self::$connectionsTable) &&
+ self::$connectionsTable[$id] instanceof Connection &&
+ self::$connectionsTable[$id]->isConnected()
+ ) {
+ return self::$connectionsTable[$id];
}
$result = self::findByPk($id);
@@ -247,4 +234,5 @@ public static function connectionById(int $id): ?Connection
return null;
}
+
}
From 239f37187d266a686e165b18b0c5998090cf939b Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:45:30 +0100
Subject: [PATCH 17/27] code cleanUp
---
src/Logging/AlpdeskcoreLogger.php | 8 --------
src/Security/AlpdeskcoreUserProvider.php | 9 +++++----
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/Logging/AlpdeskcoreLogger.php b/src/Logging/AlpdeskcoreLogger.php
index 6342dfa..c8443cc 100644
--- a/src/Logging/AlpdeskcoreLogger.php
+++ b/src/Logging/AlpdeskcoreLogger.php
@@ -25,10 +25,6 @@ public function __construct(ContaoFramework $framework, string $rootDir, string
$this->environment = $environment;
}
- /**
- * @return void
- * @throws \Exception
- */
private function initialize(): void
{
if ($this->initialized === false) {
@@ -61,7 +57,6 @@ private function initialize(): void
* @param mixed $strText
* @param mixed $strFunction
* @return void
- * @throws \Exception
*/
public function info(mixed $strText, mixed $strFunction): void
{
@@ -73,7 +68,6 @@ public function info(mixed $strText, mixed $strFunction): void
* @param mixed $strText
* @param mixed $strFunction
* @return void
- * @throws \Exception
*/
public function debug(mixed $strText, mixed $strFunction): void
{
@@ -85,7 +79,6 @@ public function debug(mixed $strText, mixed $strFunction): void
* @param mixed $strText
* @param mixed $strFunction
* @return void
- * @throws \Exception
*/
public function warning(mixed $strText, mixed $strFunction): void
{
@@ -97,7 +90,6 @@ public function warning(mixed $strText, mixed $strFunction): void
* @param mixed $strText
* @param mixed $strFunction
* @return void
- * @throws \Exception
*/
public function error(mixed $strText, mixed $strFunction): void
{
diff --git a/src/Security/AlpdeskcoreUserProvider.php b/src/Security/AlpdeskcoreUserProvider.php
index d22ce13..600e8e5 100644
--- a/src/Security/AlpdeskcoreUserProvider.php
+++ b/src/Security/AlpdeskcoreUserProvider.php
@@ -83,10 +83,11 @@ public function loadUserByUsername(string $username): AlpdeskcoreUser
$alpdeskUser = AlpdeskcoreMandantModel::findByUsername($username);
$sessionModel = AlpdeskcoreSessionsModel::findByUsername($alpdeskUser->getUsername());
- if ($sessionModel !== null) {
- if (self::validateAndVerifyToken($sessionModel->token, $alpdeskUser->getUsername())) {
- $alpdeskUser->setToken($sessionModel->token);
- }
+ if (
+ $sessionModel !== null &&
+ self::validateAndVerifyToken($sessionModel->token, $alpdeskUser->getUsername())
+ ) {
+ $alpdeskUser->setToken($sessionModel->token);
}
return $alpdeskUser;
From 076a0340d8ec56abe3c7ee9ed626bbeea1c51276 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:46:44 +0100
Subject: [PATCH 18/27] code cleanUp
---
src/Utils/Utils.php | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php
index 70d75cc..be5c6c0 100644
--- a/src/Utils/Utils.php
+++ b/src/Utils/Utils.php
@@ -25,16 +25,17 @@ public static function mergeUserGroupPermissions(UserInterface $backendUser): vo
$time = Date::floorToMinute();
foreach ((array)$backendUser->groups as $id) {
+
$objGroup = Database::getInstance()->prepare("SELECT alpdeskcorelogs_enabled FROM tl_user_group WHERE id=? AND disable!='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')")->limit(1)->execute($id);
- if ($objGroup->numRows > 0) {
- if ((int)$backendUser->alpdeskcorelogs_enabled === 0) {
- $backendUser->alpdeskcorelogs_enabled = $objGroup->alpdeskcorelogs_enabled;
- }
+ if ($objGroup->numRows > 0 && (int)$backendUser->alpdeskcorelogs_enabled === 0) {
+ $backendUser->alpdeskcorelogs_enabled = $objGroup->alpdeskcorelogs_enabled;
}
}
+
}
}
+
}
/**
@@ -54,7 +55,7 @@ public static function replaceInsertTags($strBuffer, bool $blnCache = true): str
return $parser->replaceInline((string)$strBuffer);
- } catch (\Exception $ex) {
+ } catch (\Exception) {
return (string)$strBuffer;
}
From d81926c9a44ae30aeeb0e47ae70c83db9d2326cd Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:55:20 +0100
Subject: [PATCH 19/27] code cleanUp
---
src/Library/Auth/AlpdeskCoreAuthToken.php | 2 +-
src/Library/Backend/AlpdeskCoreDcaUtils.php | 6 +++---
src/Library/Database/CrudModel.php | 5 ++---
src/Library/Mandant/AlpdeskCoreMandant.php | 24 ++++++++++-----------
4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/src/Library/Auth/AlpdeskCoreAuthToken.php b/src/Library/Auth/AlpdeskCoreAuthToken.php
index 91d1aad..100b85c 100644
--- a/src/Library/Auth/AlpdeskCoreAuthToken.php
+++ b/src/Library/Auth/AlpdeskCoreAuthToken.php
@@ -180,7 +180,7 @@ public function invalidToken(AlpdeskcoreUser $user): AlpdeskCoreAuthResponse
try {
$this->invalidTokenData($response->getUsername(), $response->getAlpdesk_token());
$response->setInvalid(true);
- } catch (AlpdeskCoreAuthException $ex) {
+ } catch (AlpdeskCoreAuthException) {
$response->setInvalid(false);
}
diff --git a/src/Library/Backend/AlpdeskCoreDcaUtils.php b/src/Library/Backend/AlpdeskCoreDcaUtils.php
index 0b41037..b838b49 100644
--- a/src/Library/Backend/AlpdeskCoreDcaUtils.php
+++ b/src/Library/Backend/AlpdeskCoreDcaUtils.php
@@ -28,7 +28,7 @@ public function showSessionValid($row, $label, $dc, $args): array
{
try {
$validateAndVerify = JwtToken::validateAndVerify($args[1], AlpdeskcoreUserProvider::createJti($args[0]));
- } catch (\Exception $ex) {
+ } catch (\Exception) {
$validateAndVerify = false;
}
@@ -110,12 +110,12 @@ public function pdfElementsloadCallback(DataContainer $dc): void
try {
(new AlpdeskCorePDFCreator())->generateById((int)Input::get('pdfid'), "files/tmp", time() . ".pdf");
- } catch (\Exception $ex) {
-
+ } catch (\Exception) {
}
Controller::redirect('contao?do=' . Input::get('do') . '&table=' . Input::get('table') . '&id=' . Input::get('id') . '&rt=' . Input::get('rt'));
}
+
}
/**
diff --git a/src/Library/Database/CrudModel.php b/src/Library/Database/CrudModel.php
index 54c6e89..0b8caf8 100644
--- a/src/Library/Database/CrudModel.php
+++ b/src/Library/Database/CrudModel.php
@@ -51,7 +51,7 @@ public function getSchemaManager(): AbstractSchemaManager
public function getSchema(): Schema
{
if ($this->schema === null) {
- $this->schema = $this->getSchemaManager()->createSchema();
+ $this->schema = $this->getSchemaManager()->introspectSchema();
}
return $this->schema;
@@ -151,8 +151,7 @@ private function getSQLErrorMessage(string $exMessage): string
$message = \end($lastMessage);
}
- } catch (\Exception $ex) {
-
+ } catch (\Exception) {
}
return \trim($message);
diff --git a/src/Library/Mandant/AlpdeskCoreMandant.php b/src/Library/Mandant/AlpdeskCoreMandant.php
index 5abb659..8e3ef11 100644
--- a/src/Library/Mandant/AlpdeskCoreMandant.php
+++ b/src/Library/Mandant/AlpdeskCoreMandant.php
@@ -48,17 +48,16 @@ private function getPlugins(int $mandantPid, array $invalidElements): array
foreach ($plugins as $pluginElement) {
$type = (string)$pluginElement->type;
- if (!\in_array($type, $invalidElements, true)) {
-
- if (isset($pluginData[$type]) && isset($pluginInfo[$type])) {
-
- $data[] = array(
- 'value' => $pluginElement->type,
- 'label' => $pluginData[$type],
- 'customTemplate' => ($pluginInfo[$type]['customTemplate'] ?? false)
- );
-
- }
+ if (
+ isset($pluginData[$type], $pluginInfo[$type]) &&
+ !\in_array($type, $invalidElements, true)
+ ) {
+
+ $data[] = array(
+ 'value' => $pluginElement->type,
+ 'label' => $pluginData[$type],
+ 'customTemplate' => ($pluginInfo[$type]['customTemplate'] ?? false)
+ );
}
}
@@ -83,8 +82,7 @@ private function getData(int $mandantPid): array
$data = $mData->row();
- unset($data['id']);
- unset($data['tstamp']);
+ unset($data['id'], $data['tstamp']);
$returnData = array();
From ecaa26cff92b5c32b01326995706ca80cd713777 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 12:59:12 +0100
Subject: [PATCH 20/27] code cleanUp
---
src/Library/PDF/AlpdeskCorePDFCreator.php | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/Library/PDF/AlpdeskCorePDFCreator.php b/src/Library/PDF/AlpdeskCorePDFCreator.php
index a0eaa9e..8700da5 100644
--- a/src/Library/PDF/AlpdeskCorePDFCreator.php
+++ b/src/Library/PDF/AlpdeskCorePDFCreator.php
@@ -52,7 +52,7 @@ class AlpdeskCorePDFCreator extends \TCPDF
public function __construct()
{
- parent::__construct(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
+ parent::__construct(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT);
}
public function setFootersesstingsarray(array $footersesstingsarray): void
@@ -230,7 +230,11 @@ public function generate($text, $filename, $path, $settingsarray): string
$l['a_meta_dir'] = 'ltr';
$l['a_meta_charset'] = Config::get('characterSet');
- $locale = System::getContainer()->get('request_stack')->getCurrentRequest()->getLocale();
+ $locale = System::getContainer()->get('request_stack')->getCurrentRequest()?->getLocale();
+ if ($locale === null) {
+ $locale = 'de';
+ }
+
$l['a_meta_language'] = $locale;
$l['w_page'] = 'page';
@@ -299,16 +303,16 @@ public function generate($text, $filename, $path, $settingsarray): string
$pageCount = \count($pageSplit);
if ($pageCount > 1) {
- $this->writeHTML($pageSplit[0], true, false, true, false);
+ $this->writeHTML($pageSplit[0], true, false, true);
for ($i = 1; $i < $pageCount; $i++) {
$this->AddPage();
- $this->writeHTML($pageSplit[$i], true, false, true, false);
+ $this->writeHTML($pageSplit[$i], true, false, true);
}
} else {
- $this->writeHTML($html, true, false, true, false);
+ $this->writeHTML($html, true, false, true);
}
$this->lastPage();
@@ -329,12 +333,11 @@ public function generate($text, $filename, $path, $settingsarray): string
$resultPath = $path . '/' . $filename;
$finalResultFile = new File($resultPath);
- if ($finalResultFile->exists()) {
- if (Dbafs::shouldBeSynchronized($finalResultFile->path)) {
- Dbafs::addResource($finalResultFile->path);
- }
+ if ($finalResultFile->exists() && Dbafs::shouldBeSynchronized($finalResultFile->path)) {
+ Dbafs::addResource($finalResultFile->path);
}
return $resultPath;
+
}
}
From fe34e1871730ea2bf9c050404f67d70c1174337b Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 13:46:56 +0100
Subject: [PATCH 21/27] fix tests
---
.idea/php-test-framework.xml | 1 +
tests/Jwt/JwtTokenTest.php | 10 +++++-----
tests/Library/Cryption/CryptionTest.php | 8 ++++----
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/.idea/php-test-framework.xml b/.idea/php-test-framework.xml
index 1d85f19..7b6eaba 100644
--- a/.idea/php-test-framework.xml
+++ b/.idea/php-test-framework.xml
@@ -6,6 +6,7 @@
+
diff --git a/tests/Jwt/JwtTokenTest.php b/tests/Jwt/JwtTokenTest.php
index 51de731..ba58e1d 100644
--- a/tests/Jwt/JwtTokenTest.php
+++ b/tests/Jwt/JwtTokenTest.php
@@ -19,13 +19,13 @@ public function set(string $id, ?object $service): void
}
/**
- * @param $id
+ * @param string $id
* @param int $invalidBehavior
- * @return object|void|null
+ * @return object|null
*/
- public function get($id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+ public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
{
- // TODO: Implement get() method.
+ return null;
}
/**
@@ -95,7 +95,7 @@ protected function assertPreConditions(): void
$this->assertNotEmpty(System::getContainer()->getParameter('kernel.secret'));
}
- private function nullParameter(\DateTimeImmutable $d): void
+ private function nullParameter(?\DateTimeImmutable $d): void
{
}
diff --git a/tests/Library/Cryption/CryptionTest.php b/tests/Library/Cryption/CryptionTest.php
index fe5cc32..d5cdafa 100644
--- a/tests/Library/Cryption/CryptionTest.php
+++ b/tests/Library/Cryption/CryptionTest.php
@@ -22,13 +22,13 @@ public function set(string $id, ?object $service): void
}
/**
- * @param $id
+ * @param string $id
* @param int $invalidBehavior
- * @return object|void|null
+ * @return object|null
*/
- public function get($id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+ public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
{
- // TODO: Implement get() method.
+ return null;
}
/**
From 717b8cd6eaaa501d81d40b1f169df91075d52fda Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 13:51:02 +0100
Subject: [PATCH 22/27] fix tests
---
.github/workflows/ci_pr.yaml | 2 +-
tests/Jwt/JwtTokenTest.php | 4 ++--
tests/Library/Cryption/CryptionTest.php | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci_pr.yaml b/.github/workflows/ci_pr.yaml
index a35737a..33e86c6 100644
--- a/.github/workflows/ci_pr.yaml
+++ b/.github/workflows/ci_pr.yaml
@@ -23,4 +23,4 @@ jobs:
run: composer install --no-interaction --no-progress
- name: Run the unit tests
- run: vendor/bin/phpunit --colors=always
\ No newline at end of file
+ run: vendor/bin/phpunit --no-configuration ./tests
\ No newline at end of file
diff --git a/tests/Jwt/JwtTokenTest.php b/tests/Jwt/JwtTokenTest.php
index ba58e1d..e791392 100644
--- a/tests/Jwt/JwtTokenTest.php
+++ b/tests/Jwt/JwtTokenTest.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Alpdesk\AlpdeskCoreTest\Jwt;
+namespace Jwt;
use Alpdesk\AlpdeskCore\Jwt\JwtToken;
use Contao\System;
@@ -50,7 +50,7 @@ public function initialized(string $id): bool
* @param string $name
* @return array|bool|float|int|mixed|string|null
*/
- public function getParameter(string $name)
+ public function getParameter(string $name): mixed
{
return $this->params[$name];
}
diff --git a/tests/Library/Cryption/CryptionTest.php b/tests/Library/Cryption/CryptionTest.php
index d5cdafa..b8f584c 100644
--- a/tests/Library/Cryption/CryptionTest.php
+++ b/tests/Library/Cryption/CryptionTest.php
@@ -53,7 +53,7 @@ public function initialized(string $id): bool
* @param string $name
* @return array|bool|float|int|mixed|string|null
*/
- public function getParameter(string $name)
+ public function getParameter(string $name): mixed
{
return $this->params[$name];
}
From 50d5ee418d3446c30daa4198180d9059ce20484b Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 14:17:00 +0100
Subject: [PATCH 23/27] bugfix memberData
---
.../Auth/AlpdeskCoreAuthController.php | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/Controller/Auth/AlpdeskCoreAuthController.php b/src/Controller/Auth/AlpdeskCoreAuthController.php
index c86a794..e8b8332 100644
--- a/src/Controller/Auth/AlpdeskCoreAuthController.php
+++ b/src/Controller/Auth/AlpdeskCoreAuthController.php
@@ -201,7 +201,23 @@ public function member(Request $request, UserInterface $user): JsonResponse
$this->framework->initialize();
- $memberData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
+ $memberData = [];
+
+ try {
+
+ // Request could be empty
+ $memberRequest = $request->getContent();
+ if (\is_string($memberRequest) && $memberRequest !== '') {
+
+ $memberDataT = \json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
+ if (\is_array($memberDataT)) {
+ $memberData = $memberDataT;
+ }
+
+ }
+
+ } catch (\Exception) {
+ }
if (\array_key_exists('mandantid', $memberData) && $user->getIsAdmin() === true) {
@@ -255,8 +271,10 @@ public function member(Request $request, UserInterface $user): JsonResponse
return (new JsonResponse($event->getResultData()->getData(), AlpdeskCoreConstants::$STATUSCODE_OK));
} catch (\Exception $exception) {
+
$this->logger->error($exception->getMessage(), __METHOD__);
return $this->outputError($exception->getMessage(), $exception->getCode(), AlpdeskCoreConstants::$STATUSCODE_COMMONERROR);
+
}
}
From a5676b5c0078fd15b5fbafe5c6e1461a2a39b035 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 14:20:33 +0100
Subject: [PATCH 24/27] bugfix
---
src/Controller/Plugin/AlpdeskCorePluginController.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Controller/Plugin/AlpdeskCorePluginController.php b/src/Controller/Plugin/AlpdeskCorePluginController.php
index cb83157..062cc0b 100644
--- a/src/Controller/Plugin/AlpdeskCorePluginController.php
+++ b/src/Controller/Plugin/AlpdeskCorePluginController.php
@@ -83,6 +83,7 @@ public function call(Request $request, UserInterface $user): JsonResponse
$this->framework->initialize();
+ // $request->getContent() must always be a valid JSON
$pluginData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$response = (new AlpdeskCorePlugin($this->rootDir))->call($user, $pluginData);
@@ -94,7 +95,7 @@ public function call(Request $request, UserInterface $user): JsonResponse
return $this->output($event->getResultData(), AlpdeskCoreConstants::$STATUSCODE_OK);
- } catch (\Exception $exception) {
+ } catch (\Throwable $exception) {
$this->logger->error($exception->getMessage(), __METHOD__);
return $this->outputError($exception->getMessage(), $exception->getCode(), AlpdeskCoreConstants::$STATUSCODE_COMMONERROR);
From f1552e78383ddf8c024d6ad45c1a0d1d3dc38e91 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 14:25:59 +0100
Subject: [PATCH 25/27] bugfix
---
.idea/inspectionProfiles/Project_Default.xml | 1 +
src/Controller/Auth/AlpdeskCoreAuthController.php | 2 ++
.../Filemanagement/AlpdeskCoreFilemanagementController.php | 2 ++
src/Controller/Plugin/AlpdeskCorePluginController.php | 2 +-
src/Widget/AlpdeskcoreDatabasemanagerWidget.php | 1 +
5 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index ba9dc57..9dacadb 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -68,6 +68,7 @@
+
diff --git a/src/Controller/Auth/AlpdeskCoreAuthController.php b/src/Controller/Auth/AlpdeskCoreAuthController.php
index e8b8332..8d5c0af 100644
--- a/src/Controller/Auth/AlpdeskCoreAuthController.php
+++ b/src/Controller/Auth/AlpdeskCoreAuthController.php
@@ -89,6 +89,7 @@ public function auth(Request $request): JsonResponse
$this->framework->initialize();
+ // $request->getContent() must always be a valid JSON
$authData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$response = (new AlpdeskCoreAuthToken($this->passwordHasherFactory))->generateToken($authData);
@@ -164,6 +165,7 @@ public function refresh(Request $request, UserInterface $user): JsonResponse
$this->framework->initialize();
+ // $request->getContent() must always be a valid JSON
$refreshData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$response = (new AlpdeskCoreAuthToken($this->passwordHasherFactory))->refreshToken($refreshData, $user);
diff --git a/src/Controller/Filemanagement/AlpdeskCoreFilemanagementController.php b/src/Controller/Filemanagement/AlpdeskCoreFilemanagementController.php
index feb0db0..6db467b 100644
--- a/src/Controller/Filemanagement/AlpdeskCoreFilemanagementController.php
+++ b/src/Controller/Filemanagement/AlpdeskCoreFilemanagementController.php
@@ -125,6 +125,7 @@ public function download(Request $request, UserInterface $user): BinaryFileRespo
$this->framework->initialize();
+ // $request->getContent() must always be a valid JSON
$downloadData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$file = (new AlpdeskCoreFilemanagement($this->rootDir, $this->eventService))->download($user, $downloadData);
@@ -155,6 +156,7 @@ public function finder(Request $request, UserInterface $user): JsonResponse
$this->framework->initialize();
+ // $request->getContent() must always be a valid JSON
$finderData = (array)\json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);
$response = (new AlpdeskCoreFilemanagement($this->rootDir, $this->eventService))->finder($user, $finderData);
diff --git a/src/Controller/Plugin/AlpdeskCorePluginController.php b/src/Controller/Plugin/AlpdeskCorePluginController.php
index 062cc0b..8f33551 100644
--- a/src/Controller/Plugin/AlpdeskCorePluginController.php
+++ b/src/Controller/Plugin/AlpdeskCorePluginController.php
@@ -95,7 +95,7 @@ public function call(Request $request, UserInterface $user): JsonResponse
return $this->output($event->getResultData(), AlpdeskCoreConstants::$STATUSCODE_OK);
- } catch (\Throwable $exception) {
+ } catch (\Exception $exception) {
$this->logger->error($exception->getMessage(), __METHOD__);
return $this->outputError($exception->getMessage(), $exception->getCode(), AlpdeskCoreConstants::$STATUSCODE_COMMONERROR);
diff --git a/src/Widget/AlpdeskcoreDatabasemanagerWidget.php b/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
index d5b7d62..82eddfa 100644
--- a/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
+++ b/src/Widget/AlpdeskcoreDatabasemanagerWidget.php
@@ -113,6 +113,7 @@ private function checkMigrations(Connection $connection, mixed $modelUuid): stri
$jsonFile = new File($jsonModelFile->path);
if ($jsonFile->exists()) {
+ // $jsonFile->getContent() must always be a valid JSON
$jsonModel = \json_decode($jsonFile->getContent(), true, 512, JSON_THROW_ON_ERROR);
if (\count($jsonModel) > 0) {
From 70b735acbdeb8b121dfc400f2601ef3bef9303a9 Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 14:37:52 +0100
Subject: [PATCH 26/27] bugfix
---
src/Library/Auth/AlpdeskCoreAuthToken.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Library/Auth/AlpdeskCoreAuthToken.php b/src/Library/Auth/AlpdeskCoreAuthToken.php
index 100b85c..55d5fb7 100644
--- a/src/Library/Auth/AlpdeskCoreAuthToken.php
+++ b/src/Library/Auth/AlpdeskCoreAuthToken.php
@@ -80,6 +80,9 @@ public function generateToken(array $authdata): AlpdeskCoreAuthResponse
$username = (string)AlpdeskcoreInputSecurity::secureValue($authdata['username']);
$password = (string)AlpdeskcoreInputSecurity::secureValue($authdata['password']);
+ // Trim username because of trailing and leading whitespace
+ $username = \trim($username);
+
try {
(new AlpdeskCoreMandantAuth($this->passwordHasherFactory))->login($username, $password);
} catch (AlpdeskCoreAuthException $ex) {
From 8faee5c23722f5822650daec2cdf88dc3a4b7ede Mon Sep 17 00:00:00 2001
From: xprojects-de
Date: Thu, 14 Dec 2023 14:46:11 +0100
Subject: [PATCH 27/27] bugfix
---
.idea/inspectionProfiles/Project_Default.xml | 5 +++++
src/Library/Auth/AlpdeskCoreAuthToken.php | 9 +++------
src/Library/Auth/AlpdeskCoreMandantAuth.php | 8 +++++++-
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 9dacadb..26a7ada 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -1,6 +1,11 @@
+
+
+
+
+