From 15ac0f9c05e00f28a8d251bb4d21c7822d258c2a Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 18 Jun 2024 11:20:33 +0530 Subject: [PATCH 1/3] remove blacklisted domain check --- lib/Service/RecoveryEmailService.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Service/RecoveryEmailService.php b/lib/Service/RecoveryEmailService.php index 1b01bd6..7033bf2 100644 --- a/lib/Service/RecoveryEmailService.php +++ b/lib/Service/RecoveryEmailService.php @@ -237,8 +237,14 @@ class RecoveryEmailService { public function isBlacklistedEmail(string $email): bool { // Get the blacklisted domains from configuration $blacklistedDomainsInJson = $this->config->getAppValue('ecloud-accounts', 'blacklisted_domains'); + if (empty($blacklistedDomainsInJson)) { + return false; + } $blacklistedDomains = json_decode($blacklistedDomainsInJson, true); + if (empty($blacklistedDomains)) { + return false; + } // Split the email address into parts using explode $emailParts = explode('@', $email); -- GitLab From 6a6eb66e2586106640118e8920805db64b0b8bfe Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 18 Jun 2024 11:22:09 +0530 Subject: [PATCH 2/3] Bump version --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 5b8030f..39b37f5 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Email Recovery Email Recovery App - 6.0.1 + 6.0.2 agpl MURENA SAS EmailRecovery -- GitLab From 1c51328e2701fc3b050415cbcbd5df2e4519baba Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 18 Jun 2024 11:28:36 +0530 Subject: [PATCH 3/3] Lint fix --- lib/AppInfo/Application.php | 10 +++++----- lib/BackgroundJob/WeeklyRecoveryNotificationJob.php | 12 ++++++------ lib/Controller/EmailRecoveryController.php | 2 +- lib/Listeners/UserConfigChangedListener.php | 2 +- lib/Notification/Notifier.php | 4 ++-- lib/Service/RecoveryEmailService.php | 2 +- lib/Settings/RecoveryEmailSettings.php | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index d98ff3a..332e94a 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -26,16 +26,16 @@ declare(strict_types=1); namespace OCA\EmailRecovery\AppInfo; +use OCA\EmailRecovery\Listeners\BeforeTemplateRenderedListener; +use OCA\EmailRecovery\Listeners\UserConfigChangedListener; +use OCA\EmailRecovery\Notification\Notifier; use OCP\AppFramework\App; +use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCA\EmailRecovery\Listeners\UserConfigChangedListener; -use OCA\EmailRecovery\Listeners\BeforeTemplateRenderedListener; -use OCP\User\Events\UserConfigChangedEvent; -use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; use OCP\Notification\IManager as INotificationManager; -use OCA\EmailRecovery\Notification\Notifier; +use OCP\User\Events\UserConfigChangedEvent; class Application extends App implements IBootstrap { public const APP_ID = 'email-recovery'; diff --git a/lib/BackgroundJob/WeeklyRecoveryNotificationJob.php b/lib/BackgroundJob/WeeklyRecoveryNotificationJob.php index 3f4b94a..6e128f0 100644 --- a/lib/BackgroundJob/WeeklyRecoveryNotificationJob.php +++ b/lib/BackgroundJob/WeeklyRecoveryNotificationJob.php @@ -24,19 +24,19 @@ declare(strict_types=1); namespace OCA\EmailRecovery\BackgroundJob; +use OCA\EmailRecovery\AppInfo\Application; +use OCA\EmailRecovery\Service\NotificationService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; use OCP\IConfig; +use OCP\IURLGenerator; +use OCP\IUser; use OCP\IUserManager; use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; -use Psr\Log\LoggerInterface; -use OCA\EmailRecovery\AppInfo\Application; -use OCA\EmailRecovery\Service\NotificationService; -use OCP\IUser; -use OCP\Notification\INotification; use OCP\Notification\IManager as INotificationManager; -use OCP\IURLGenerator; +use OCP\Notification\INotification; +use Psr\Log\LoggerInterface; class WeeklyRecoveryNotificationJob extends TimedJob { private IConfig $config; diff --git a/lib/Controller/EmailRecoveryController.php b/lib/Controller/EmailRecoveryController.php index cded6cd..776fd43 100644 --- a/lib/Controller/EmailRecoveryController.php +++ b/lib/Controller/EmailRecoveryController.php @@ -25,11 +25,11 @@ namespace OCA\EmailRecovery\Controller; use Exception; +use OCA\EmailRecovery\Exception\BlacklistedEmailException; use OCA\EmailRecovery\Exception\InvalidRecoveryEmailException; use OCA\EmailRecovery\Exception\MurenaDomainDisallowedException; use OCA\EmailRecovery\Exception\RecoveryEmailAlreadyFoundException; use OCA\EmailRecovery\Exception\SameRecoveryEmailAsEmailException; -use OCA\EmailRecovery\Exception\BlacklistedEmailException; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; diff --git a/lib/Listeners/UserConfigChangedListener.php b/lib/Listeners/UserConfigChangedListener.php index 446257b..70e620e 100644 --- a/lib/Listeners/UserConfigChangedListener.php +++ b/lib/Listeners/UserConfigChangedListener.php @@ -8,8 +8,8 @@ use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\ILogger; -use OCP\User\Events\UserConfigChangedEvent; use OCP\IUserManager; +use OCP\User\Events\UserConfigChangedEvent; class UserConfigChangedListener implements IEventListener { private $logger; diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index d71d5d9..15acaec 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -25,12 +25,12 @@ declare(strict_types=1); namespace OCA\EmailRecovery\Notification; +use OCA\EmailRecovery\AppInfo\Application; +use OCA\EmailRecovery\Service\NotificationService; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; -use OCA\EmailRecovery\AppInfo\Application; use Psr\Log\LoggerInterface; -use OCA\EmailRecovery\Service\NotificationService; class Notifier implements INotifier { /** @var IFactory */ diff --git a/lib/Service/RecoveryEmailService.php b/lib/Service/RecoveryEmailService.php index 7033bf2..96a27b3 100644 --- a/lib/Service/RecoveryEmailService.php +++ b/lib/Service/RecoveryEmailService.php @@ -242,7 +242,7 @@ class RecoveryEmailService { } $blacklistedDomains = json_decode($blacklistedDomainsInJson, true); - if (empty($blacklistedDomains)) { + if (empty($blacklistedDomains)) { return false; } // Split the email address into parts using explode diff --git a/lib/Settings/RecoveryEmailSettings.php b/lib/Settings/RecoveryEmailSettings.php index d509046..407b7ba 100644 --- a/lib/Settings/RecoveryEmailSettings.php +++ b/lib/Settings/RecoveryEmailSettings.php @@ -26,11 +26,11 @@ declare(strict_types=1); namespace OCA\EmailRecovery\Settings; +use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; use OCP\IUserSession; use OCP\Settings\ISettings; -use OCP\AppFramework\Services\IInitialState; -use OCA\EmailRecovery\Service\RecoveryEmailService; class RecoveryEmailSettings implements ISettings { private string $appName; -- GitLab