diff --git a/appinfo/info.xml b/appinfo/info.xml
index d54d53e40af32de4265b95d223752dcfc296fc24..f880a30c3600c3ff07d231e6f905c35cb0375511 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -10,14 +10,14 @@
- 12.0.1
+ 13.0.0
agpl
Murena SAS
EcloudAccounts
tools
https://gitlab.e.foundation/e/management/issues
-
+
OCA\EcloudAccounts\Settings\DeleteShopAccountSetting
diff --git a/lib/Command/MapActiveAttributetoLDAP.php b/lib/Command/MapActiveAttributetoLDAP.php
index 6d918d928e27626d981efd1dd418983a6c8283b7..073ee9c065c8c6bfbf97b8d92ecf417b1443f7d3 100644
--- a/lib/Command/MapActiveAttributetoLDAP.php
+++ b/lib/Command/MapActiveAttributetoLDAP.php
@@ -7,9 +7,9 @@ namespace OCA\EcloudAccounts\Command;
use Exception;
use OCA\EcloudAccounts\AppInfo\Application;
use OCA\EcloudAccounts\Service\UserService;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -18,9 +18,9 @@ class MapActiveAttributetoLDAP extends Command {
private OutputInterface $commandOutput;
private IUserManager $userManager;
private $userService;
- private $logger;
+ private LoggerInterface $logger;
- public function __construct(IUserManager $userManager, ILogger $logger, UserService $userService) {
+ public function __construct(IUserManager $userManager, LoggerInterface $logger, UserService $userService) {
$this->userManager = $userManager;
$this->userService = $userService;
$this->logger = $logger;
@@ -42,7 +42,7 @@ class MapActiveAttributetoLDAP extends Command {
try {
$this->userService->mapActiveAttributesInLDAP($username, $isEnabled);
} catch (Exception $e) {
- $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]);
+ $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]);
}
}
});
diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php
index 8b23dad6166f5ae6b1d76e9fc91c1215eaa239b2..b9e0d16b38a64e1db4195aecabe2906a50847d0e 100644
--- a/lib/Controller/AccountController.php
+++ b/lib/Controller/AccountController.php
@@ -22,12 +22,12 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Files\IAppData;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\L10N\IFactory;
+use Psr\Log\LoggerInterface;
class AccountController extends Controller {
protected $appName;
@@ -53,7 +53,7 @@ class AccountController extends Controller {
private const HCAPTCHA_DOMAINS = ['https://hcaptcha.com', 'https://*.hcaptcha.com'];
private const BLACKLISTED_USERNAMES_FILE_NAME = 'blacklisted_usernames';
- private ILogger $logger;
+ private LoggerInterface $logger;
public function __construct(
$AppName,
IRequest $request,
@@ -66,7 +66,7 @@ class AccountController extends Controller {
IURLGenerator $urlGenerator,
ISession $session,
IConfig $config,
- ILogger $logger,
+ LoggerInterface $logger,
IInitialState $initialState,
IAppData $appData,
) {
@@ -199,7 +199,7 @@ class AccountController extends Controller {
$ipAddress = $this->request->getRemoteAddress();
$this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail);
} catch (\Throwable $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
}
$this->userService->setAccountDataLocally($username, $userEmail);
$this->userService->createHMEAlias($username, $userEmail);
@@ -222,15 +222,15 @@ class AccountController extends Controller {
$response->setData(['success' => true]);
} catch (LDAPUserCreationException | Error $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
$response->setData(['message' => 'A server-side error occurred while processing your request! Please try again later.', 'success' => false]);
$response->setStatus(500);
} catch (RecoveryEmailValidationException $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
$response->setData(['message' => $e->getMessage(), 'success' => false]);
$response->setStatus(400);
} catch (Exception $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
$response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]);
$response->setStatus(500);
}
@@ -330,7 +330,7 @@ class AccountController extends Controller {
$response->setData(['message' => 'Username is already taken.', 'field' => 'username', 'success' => false]);
}
} catch (Exception $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID ]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
$response->setStatus(500);
}
diff --git a/lib/Controller/ShopAccountController.php b/lib/Controller/ShopAccountController.php
index bba48631614b02c3ea6703ac062224775d6c2725..fcaf91596a53cbddd1b5aff2622be523e8edf239 100644
--- a/lib/Controller/ShopAccountController.php
+++ b/lib/Controller/ShopAccountController.php
@@ -8,18 +8,18 @@ use Exception;
use OCA\EcloudAccounts\Service\ShopAccountService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\IUserSession;
+use Psr\Log\LoggerInterface;
class ShopAccountController extends Controller {
private ShopAccountService $shopAccountService;
private IUserSession $userSession;
- private ILogger $logger;
+ private LoggerInterface $logger;
- public function __construct($appName, IRequest $request, IUserSession $userSession, ShopAccountService $shopAccountService, ILogger $logger) {
+ public function __construct($appName, IRequest $request, IUserSession $userSession, ShopAccountService $shopAccountService, LoggerInterface $logger) {
parent::__construct($appName, $request);
$this->shopAccountService = $shopAccountService;
$this->userSession = $userSession;
diff --git a/lib/Controller/UserController.php b/lib/Controller/UserController.php
index 9871ba506647b8c17edd80d8f6c81013569b75d9..1fd0d683e973122d3d9a561515b42a100c3fd6db 100644
--- a/lib/Controller/UserController.php
+++ b/lib/Controller/UserController.php
@@ -10,9 +10,9 @@ use OCA\EcloudAccounts\Service\UserService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\L10N\IFactory;
+use Psr\Log\LoggerInterface;
class UserController extends ApiController {
/** @var UserService */
@@ -20,11 +20,11 @@ class UserController extends ApiController {
private $mailUsageMapper;
- private $logger;
+ private LoggerInterface $logger;
private $config;
protected $l10nFactory;
- public function __construct($appName, IRequest $request, ILogger $logger, IConfig $config, UserService $userService, MailUsageMapper $mailUsageMapper, IFactory $l10nFactory) {
+ public function __construct($appName, IRequest $request, LoggerInterface $logger, IConfig $config, UserService $userService, MailUsageMapper $mailUsageMapper, IFactory $l10nFactory) {
parent::__construct($appName, $request);
$this->userService = $userService;
$this->mailUsageMapper = $mailUsageMapper;
diff --git a/lib/Cron/TwoFactorStateChangeJob.php b/lib/Cron/TwoFactorStateChangeJob.php
index dbdd32ae31ce0717e82af3a53c4e2835b4861c2f..06dede5fb4aeba7dc76de5d0dc9d57dfa6e577fa 100644
--- a/lib/Cron/TwoFactorStateChangeJob.php
+++ b/lib/Cron/TwoFactorStateChangeJob.php
@@ -9,7 +9,7 @@ use OCA\EcloudAccounts\Service\SSOService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\QueuedJob;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
// This class retry 2FA state sync with SSO provider.
// It is called from TwoFactorStateChangedListerner when it faced exception on its try.
@@ -24,9 +24,9 @@ class TwoFactorStateChangeJob extends QueuedJob {
private SSOService $ssoService;
private IJobList $jobList;
- private ILogger $logger;
+ private LoggerInterface $logger;
- public function __construct(ITimeFactory $time, IJobList $jobList, SSOService $ssoService, ILogger $logger) {
+ public function __construct(ITimeFactory $time, IJobList $jobList, SSOService $ssoService, LoggerInterface $logger) {
parent::__construct($time);
$this->jobList = $jobList;
@@ -45,7 +45,7 @@ class TwoFactorStateChangeJob extends QueuedJob {
$this->ssoService->handle2FAStateChange($enabled, $username);
} catch (Exception $e) {
if ($tryCount > 2) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
return;
}
diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php
index 8b2da108881107b7cbbb15d03f5d82ca645df223..31dee63fdf70b91edbea920d13a8cdeff5f891af 100644
--- a/lib/Db/MailUsageMapper.php
+++ b/lib/Db/MailUsageMapper.php
@@ -5,14 +5,14 @@ namespace OCA\EcloudAccounts\Db;
use Exception;
use OCP\IConfig;
use OCP\IDBConnection;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class MailUsageMapper {
private $db;
private $config;
- private $logger;
+ private LoggerInterface $logger;
- public function __construct(IDBConnection $db, IConfig $config, ILogger $logger) {
+ public function __construct(IDBConnection $db, IConfig $config, LoggerInterface $logger) {
$this->db = $db;
$this->config = $config;
$this->logger = $logger;
diff --git a/lib/Db/MailboxMapper.php b/lib/Db/MailboxMapper.php
index ff74ab5d5411f3f437eaff6d6c5b285c16e8e786..abaeee0f457f1b8e07c83a1735190b4b4ea2978b 100644
--- a/lib/Db/MailboxMapper.php
+++ b/lib/Db/MailboxMapper.php
@@ -5,15 +5,15 @@ namespace OCA\EcloudAccounts\Db;
use Doctrine\DBAL\DriverManager;
use OCA\EcloudAccounts\Exception\DbConnectionParamsException;
use OCP\IConfig;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Throwable;
class MailboxMapper {
private $config;
private $conn;
- private $logger;
+ private LoggerInterface $logger;
- public function __construct(IConfig $config, ILogger $logger) {
+ public function __construct(IConfig $config, LoggerInterface $logger) {
$this->config = $config;
$this->logger = $logger;
$this->initConnection();
diff --git a/lib/Db/WebmailMapper.php b/lib/Db/WebmailMapper.php
index 67e6b3c92bc16e9e8cea6fe1e226460336d4b679..fdc3bbd807376b265b96da112b45b10597e5fc10 100644
--- a/lib/Db/WebmailMapper.php
+++ b/lib/Db/WebmailMapper.php
@@ -9,9 +9,9 @@ use OCA\EcloudAccounts\Exception\DbConnectionParamsException;
use OCA\SnappyMail\Util\SnappyMailHelper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use RainLoop\Providers\AddressBook\PdoAddressBook;
use Sabre\VObject\UUIDUtil;
@@ -19,7 +19,7 @@ use Throwable;
class WebmailMapper {
private IConfig $config;
- private ILogger $logger;
+ private LoggerInterface $logger;
private Connection $conn;
private CardDavBackend $cardDavBackend;
private IUserManager $userManager;
@@ -28,7 +28,7 @@ class WebmailMapper {
private const WEBMAIL_DB_CONFIG_KEY = 'webmail_db';
private const USERS_TABLE = 'rainloop_users';
- public function __construct(IConfig $config, ILogger $logger, CardDavBackend $cardDavBackend, IUserManager $userManager) {
+ public function __construct(IConfig $config, LoggerInterface $logger, CardDavBackend $cardDavBackend, IUserManager $userManager) {
$this->config = $config;
$this->logger = $logger;
$this->cardDavBackend = $cardDavBackend;
diff --git a/lib/Listeners/BeforeUserDeletedListener.php b/lib/Listeners/BeforeUserDeletedListener.php
index a2ab50073b85a40c9f0b1ece4a7cacbb5bc8014f..a33c760f16ae4cbf10281a7bba464ac67b5de7b5 100644
--- a/lib/Listeners/BeforeUserDeletedListener.php
+++ b/lib/Listeners/BeforeUserDeletedListener.php
@@ -12,17 +12,17 @@ use OCA\EcloudAccounts\Service\UserService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\User\Events\BeforeUserDeletedEvent;
+use Psr\Log\LoggerInterface;
class BeforeUserDeletedListener implements IEventListener {
- private $logger;
+ private LoggerInterface $logger;
private $config;
private $LDAPConnectionService;
private $shopAccountService;
private $userService;
- public function __construct(ILogger $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, UserService $userService, ShopAccountService $shopAccountService) {
+ public function __construct(LoggerInterface $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, UserService $userService, ShopAccountService $shopAccountService) {
$this->logger = $logger;
$this->config = $config;
$this->LDAPConnectionService = $LDAPConnectionService;
diff --git a/lib/Listeners/PasswordUpdatedListener.php b/lib/Listeners/PasswordUpdatedListener.php
index 85b260ee85d094e08ee078f066b40a13e6644cc2..9338907096761286adbc22931a0be9cbcf9d8369 100644
--- a/lib/Listeners/PasswordUpdatedListener.php
+++ b/lib/Listeners/PasswordUpdatedListener.php
@@ -10,16 +10,16 @@ use OCA\EcloudAccounts\AppInfo\Application;
use OCA\EcloudAccounts\Service\SSOService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
-use OCP\ILogger;
use OCP\ISession;
use OCP\IUserSession;
use OCP\User\Events\PasswordUpdatedEvent;
+use Psr\Log\LoggerInterface;
class PasswordUpdatedListener implements IEventListener {
private SSOService $ssoService;
- private ILogger $logger;
+ private LoggerInterface $logger;
private ISession $session;
private IUserSession $userSession;
private TokenProvider $tokenProvider;
@@ -47,7 +47,7 @@ class PasswordUpdatedListener implements IEventListener {
try {
$this->ssoService->logout($username);
} catch (Exception $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
}
// Remove all Nextcloud sessions/tokens for the user (invalidate cache + storage)
diff --git a/lib/Listeners/TwoFactorStateChangedListener.php b/lib/Listeners/TwoFactorStateChangedListener.php
index 0ae5e8e340024d645e5f5e0d78d9613ef4e852ef..7c1011fc52725cd7aeb23f26da064905b24c34c1 100644
--- a/lib/Listeners/TwoFactorStateChangedListener.php
+++ b/lib/Listeners/TwoFactorStateChangedListener.php
@@ -12,17 +12,17 @@ use OCP\App\IAppManager;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class TwoFactorStateChangedListener implements IEventListener {
private IAppManager $appManager;
private SSOService $ssoService;
private IJobList $jobList;
- private ILogger $logger;
+ private LoggerInterface $logger;
private const TWOFACTOR_APP_ID = 'twofactor_totp';
- public function __construct(IAppManager $appManager, IJobList $jobList, SSOService $ssoService, ILogger $logger) {
+ public function __construct(IAppManager $appManager, IJobList $jobList, SSOService $ssoService, LoggerInterface $logger) {
$this->appManager = $appManager;
$this->ssoService = $ssoService;
$this->jobList = $jobList;
@@ -41,7 +41,7 @@ class TwoFactorStateChangedListener implements IEventListener {
try {
$this->ssoService->handle2FAStateChange($enabled, $username);
} catch (Exception $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
// faced exception. Initiate BG job to retry again.
$arguments = [
diff --git a/lib/Listeners/UserChangedListener.php b/lib/Listeners/UserChangedListener.php
index d211224ef60b26864d4c942776ebd455a69a4d51..f720dc38ef4ede75d6f3f2e208f2a64ce1ffbae3 100644
--- a/lib/Listeners/UserChangedListener.php
+++ b/lib/Listeners/UserChangedListener.php
@@ -10,9 +10,9 @@ use OCA\EcloudAccounts\Service\LDAPConnectionService;
use OCA\EcloudAccounts\Service\UserService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
-use OCP\ILogger;
use OCP\User\Events\UserChangedEvent;
use OCP\Util;
+use Psr\Log\LoggerInterface;
class UserChangedListener implements IEventListener {
private const QUOTA_FEATURE = 'quota';
@@ -20,14 +20,14 @@ class UserChangedListener implements IEventListener {
private $util;
- private $logger;
+ private LoggerInterface $logger;
private $mailboxMapper;
private $userService;
private $LDAPConnectionService;
- public function __construct(Util $util, ILogger $logger, MailboxMapper $mailboxMapper, UserService $userService, LDAPConnectionService $LDAPConnectionService) {
+ public function __construct(Util $util, LoggerInterface $logger, MailboxMapper $mailboxMapper, UserService $userService, LDAPConnectionService $LDAPConnectionService) {
$this->util = $util;
$this->mailboxMapper = $mailboxMapper;
$this->logger = $logger;
@@ -57,7 +57,7 @@ class UserChangedListener implements IEventListener {
try {
$this->userService->mapActiveAttributesInLDAP($username, $newValue);
} catch (Exception $e) {
- $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]);
+ $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]);
}
}
}
diff --git a/lib/Service/NewsLetterService.php b/lib/Service/NewsLetterService.php
index e40b432641422bf0c32440e7167b408db8126dbb..3aca33a658e376956b583f615b3263ca59062f80 100644
--- a/lib/Service/NewsLetterService.php
+++ b/lib/Service/NewsLetterService.php
@@ -8,8 +8,8 @@ require __DIR__ . '/../../vendor/autoload.php';
use Exception;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
class NewsLetterService {
/** @var IUserManager */
@@ -18,10 +18,10 @@ class NewsLetterService {
private $config;
/** @var CurlService */
private $curl;
- /** @var ILogger */
- private $logger;
+ /** @var LoggerInterface */
+ private LoggerInterface $logger;
- public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, ILogger $logger) {
+ public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, LoggerInterface $logger) {
$this->userManager = $userManager;
$this->config = $config;
$this->curl = $curlService;
diff --git a/lib/Service/SSOService.php b/lib/Service/SSOService.php
index 03acaf2170c44bb833276b336f300662affd5718..76d77a2965177557e195475608492a0da302567c 100644
--- a/lib/Service/SSOService.php
+++ b/lib/Service/SSOService.php
@@ -9,16 +9,16 @@ use OCA\EcloudAccounts\Exception\SSOAdminAccessTokenException;
use OCA\EcloudAccounts\Exception\SSOAdminAPIException;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Security\ICrypto;
+use Psr\Log\LoggerInterface;
class SSOService {
private IConfig $config;
private string $appName;
private CurlService $curl;
- private ILogger $logger;
+ private LoggerInterface $logger;
private array $ssoConfig = [];
private string $adminAccessToken = '';
private int $adminAccessTokenExpiresAt = 0;
@@ -38,7 +38,7 @@ class SSOService {
private const CREDENTIALS_ENDPOINT = '/users/{USER_ID}/credentials';
private const CLIENTS_CACHE_TTL = 6 * 3600; // 6 hours
- public function __construct($appName, IConfig $config, CurlService $curlService, ICrypto $crypto, IFactory $l10nFactory, IUserManager $userManager, TwoFactorMapper $twoFactorMapper, ILogger $logger, ICacheFactory $cacheFactory) {
+ public function __construct($appName, IConfig $config, CurlService $curlService, ICrypto $crypto, IFactory $l10nFactory, IUserManager $userManager, TwoFactorMapper $twoFactorMapper, LoggerInterface $logger, ICacheFactory $cacheFactory) {
$this->appName = $appName;
$this->config = $config;
diff --git a/lib/Service/ShopAccountService.php b/lib/Service/ShopAccountService.php
index ce601ca974b4ecd1241013380b902456e01c34e3..cb25ac8ff5f1003bc2a6a75c09892da40150713e 100644
--- a/lib/Service/ShopAccountService.php
+++ b/lib/Service/ShopAccountService.php
@@ -6,13 +6,13 @@ namespace OCA\EcloudAccounts\Service;
use Exception;
use OCA\EcloudAccounts\AppInfo\Application;
use OCP\IConfig;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class ShopAccountService {
private IConfig $config;
private string $appName;
private CurlService $curl;
- private ILogger $logger;
+ private LoggerInterface $logger;
private array $shops = [];
private const OIDC_USERS_ENDPOINT = '/wp-json/openid-connect-generic/users/get_by_email';
@@ -21,7 +21,7 @@ class ShopAccountService {
private const MULTISITE_KEY = 'is_multisite';
private const MULTISITE_DELETE_USERS_ENDPOINT = '/wp-json/wp/v2/multisite/users';
- public function __construct($appName, IConfig $config, CurlService $curlService, ILogger $logger) {
+ public function __construct($appName, IConfig $config, CurlService $curlService, LoggerInterface $logger) {
$this->config = $config;
$this->appName = $appName;
@@ -89,7 +89,7 @@ class ShopAccountService {
return $users;
} catch (Exception $e) {
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]);
return null;
}
}
@@ -127,8 +127,7 @@ class ShopAccountService {
throw new Exception('Unknown error while deleting!');
}
} catch (Exception $e) {
- $this->logger->error('Error deleting user at WP with ID ' . $userId);
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error('Error deleting user at WP with ID ' . $userId, ['exception' => $e, 'app' => Application::APP_ID]);
}
}
@@ -148,8 +147,7 @@ class ShopAccountService {
throw new Exception('Unknown error while updating!');
}
} catch (Exception $e) {
- $this->logger->error('Error updating user email at WP with ID ' . $userId . ' and new email ' . $email);
- $this->logger->logException($e, ['app' => Application::APP_ID]);
+ $this->logger->error('Error updating user email at WP with ID ' . $userId . ' and new email ' . $email, ['exception' => $e, 'app' => Application::APP_ID]);
}
}
diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php
index 049664665da0986209da40cda45a11804b19b941..b2962bf10f17f1dd8e07405a86fcf2dd79b122b2 100644
--- a/lib/Service/UserService.php
+++ b/lib/Service/UserService.php
@@ -14,11 +14,11 @@ use OCA\EcloudAccounts\Exception\LDAPUserCreationException;
use OCP\Defaults;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Util;
+use Psr\Log\LoggerInterface;
use Throwable;
use UnexpectedValueException;
@@ -33,8 +33,8 @@ class UserService {
private $curl;
/** @var Defaults */
private $defaults;
- /** @var ILogger */
- private $logger;
+ /** @var LoggerInterface */
+ private LoggerInterface $logger;
/** @var IFactory */
protected $l10nFactory;
/** @var array */
@@ -42,7 +42,7 @@ class UserService {
/** @var LDAPConnectionService */
private $LDAPConnectionService;
private IEventDispatcher $dispatcher;
- public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, ILogger $logger, Defaults $defaults, IFactory $l10nFactory, LDAPConnectionService $LDAPConnectionService, IEventDispatcher $dispatcher) {
+ public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, LoggerInterface $logger, Defaults $defaults, IFactory $l10nFactory, LDAPConnectionService $LDAPConnectionService, IEventDispatcher $dispatcher) {
$this->userManager = $userManager;
$this->config = $config;
$this->appConfig = $this->config->getSystemValue($appName);
diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php
index 2703f87f4b0bb13d55831210c7d55566deffe3d9..4449ecef9eed0230c9742107d2ff0e0be2772af1 100644
--- a/lib/Settings/BetaUserSetting.php
+++ b/lib/Settings/BetaUserSetting.php
@@ -9,12 +9,12 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IGroupManager;
-use OCP\ILogger;
use OCP\Settings\ISettings;
+use Psr\Log\LoggerInterface;
class BetaUserSetting implements ISettings {
protected $groupManager;
- private $logger;
+ private LoggerInterface $logger;
private $initialState;
private $config;
private $appName;
@@ -24,7 +24,7 @@ class BetaUserSetting implements ISettings {
$appName,
IGroupManager $groupManager,
IConfig $config,
- ILogger $logger,
+ LoggerInterface $logger,
IInitialState $initialState,
BetaUserService $betaUserService
) {