From c2a1553796c91227f805fd9a7ba7856498977286 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Fri, 16 Aug 2024 14:48:18 +0530 Subject: [PATCH 1/4] email-recovery code added --- appinfo/info.xml | 2 +- css/ecloud-accounts-userregistration.css | 1 + .../EmailRecoveryAppIsEnableCheck.php | 40 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 css/ecloud-accounts-userregistration.css create mode 100644 lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php diff --git a/appinfo/info.xml b/appinfo/info.xml index 6c90f4c9..923f9ade 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ - 8.0.0 + 8.0.1 agpl Murena SAS EcloudAccounts diff --git a/css/ecloud-accounts-userregistration.css b/css/ecloud-accounts-userregistration.css new file mode 100644 index 00000000..f3b67749 --- /dev/null +++ b/css/ecloud-accounts-userregistration.css @@ -0,0 +1 @@ +html{background:var(--color-main-background)}#body-login .warning-messsage{width:100% !important}#body-login .v-align{align-items:flex-start !important;justify-content:flex-start !important}.v-align header{width:100% !important;display:flex !important;align-items:flex-start !important;justify-content:flex-start !important}#header{padding-left:5% !important}.v-align main{width:50% !important;margin:0 auto}#registrationForm .password-group #password{height:62px;margin-left:0;background-color:#fff;color:#000;border:1px solid #e6e8e9}@media only screen and (max-width: 768px){.v-align main{width:100% !important}#body-login .v-align{padding:2vh 0vh !important;max-height:fit-content !important}}#fields-password .Password__strength-meter{margin-bottom:0}#fields-password .Password__strength-meter:before{left:0}#fields-password .Password__strength-meter:after{right:0}#fields-password .Password__strength-meter:after,#fields-password .Password__strength-meter:before{width:100%} diff --git a/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php b/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php new file mode 100644 index 00000000..215d8756 --- /dev/null +++ b/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php @@ -0,0 +1,40 @@ +l10n->t('Email Recovery App Enabled'); + } + + public function run(): SetupResult { + if ($this->appManager->isEnabledForUser('email-recovery')) { + return SetupResult::success($this->l10n->t('Email Recovery app is enabled')); + } + + return SetupResult::error($this->l10n->t('The Email Recovery app is not enabled, but is required for EcloudAccounts to work.')); + } +} \ No newline at end of file -- GitLab From 802648b2a1d0318ea14765db1677f18247d1cf4f Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Fri, 16 Aug 2024 14:50:12 +0530 Subject: [PATCH 2/4] changes --- lib/AppInfo/Application.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 24c5f795..f6288435 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -43,6 +43,7 @@ use OCP\IUserManager; use OCP\User\Events\BeforeUserDeletedEvent; use OCP\User\Events\PasswordUpdatedEvent; use OCP\User\Events\UserChangedEvent; +use OCA\EcloudAccounts\SetupChecks\EmailRecoveryAppIsEnableCheck; class Application extends App implements IBootstrap { public const APP_ID = 'ecloud-accounts'; @@ -59,6 +60,7 @@ class Application extends App implements IBootstrap { $context->registerEventListener(PasswordUpdatedEvent::class, PasswordUpdatedListener::class); $context->registerMiddleware(AccountMiddleware::class); + $context->registerSetupCheck(EmailRecoveryAppIsEnableCheck::class); } public function boot(IBootContext $context): void { -- GitLab From 7c2896a6f0ac4100aed4b328b75b2192e8b6b080 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Fri, 16 Aug 2024 14:50:33 +0530 Subject: [PATCH 3/4] changes --- lib/AppInfo/Application.php | 2 +- lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f6288435..788d046e 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -33,6 +33,7 @@ use OCA\EcloudAccounts\Listeners\TwoFactorStateChangedListener; use OCA\EcloudAccounts\Listeners\UserChangedListener; use OCA\EcloudAccounts\Middleware\AccountMiddleware; use OCA\EcloudAccounts\Service\LDAPConnectionService; +use OCA\EcloudAccounts\SetupChecks\EmailRecoveryAppIsEnableCheck; use OCA\TwoFactorTOTP\Event\StateChanged; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; @@ -43,7 +44,6 @@ use OCP\IUserManager; use OCP\User\Events\BeforeUserDeletedEvent; use OCP\User\Events\PasswordUpdatedEvent; use OCP\User\Events\UserChangedEvent; -use OCA\EcloudAccounts\SetupChecks\EmailRecoveryAppIsEnableCheck; class Application extends App implements IBootstrap { public const APP_ID = 'ecloud-accounts'; diff --git a/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php b/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php index 215d8756..20648a5b 100644 --- a/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php +++ b/lib/SetupChecks/EmailRecoveryAppIsEnableCheck.php @@ -37,4 +37,4 @@ class EmailRecoveryAppIsEnableCheck implements ISetupCheck { return SetupResult::error($this->l10n->t('The Email Recovery app is not enabled, but is required for EcloudAccounts to work.')); } -} \ No newline at end of file +} -- GitLab From 1aa70959d61a956f4b01baa1462d893d420ac78b Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Fri, 16 Aug 2024 14:51:31 +0530 Subject: [PATCH 4/4] changes --- css/ecloud-accounts-userregistration.css | 1 - 1 file changed, 1 deletion(-) delete mode 100644 css/ecloud-accounts-userregistration.css diff --git a/css/ecloud-accounts-userregistration.css b/css/ecloud-accounts-userregistration.css deleted file mode 100644 index f3b67749..00000000 --- a/css/ecloud-accounts-userregistration.css +++ /dev/null @@ -1 +0,0 @@ -html{background:var(--color-main-background)}#body-login .warning-messsage{width:100% !important}#body-login .v-align{align-items:flex-start !important;justify-content:flex-start !important}.v-align header{width:100% !important;display:flex !important;align-items:flex-start !important;justify-content:flex-start !important}#header{padding-left:5% !important}.v-align main{width:50% !important;margin:0 auto}#registrationForm .password-group #password{height:62px;margin-left:0;background-color:#fff;color:#000;border:1px solid #e6e8e9}@media only screen and (max-width: 768px){.v-align main{width:100% !important}#body-login .v-align{padding:2vh 0vh !important;max-height:fit-content !important}}#fields-password .Password__strength-meter{margin-bottom:0}#fields-password .Password__strength-meter:before{left:0}#fields-password .Password__strength-meter:after{right:0}#fields-password .Password__strength-meter:after,#fields-password .Password__strength-meter:before{width:100%} -- GitLab