aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-05-23 11:17:33 -0700
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-02 12:35:22 +0200
commit7f51a020765718e607fe44a634e0bd4855c99837 (patch)
treef0f0290074597d541c1958176d0160cd8e908f2f
parent669e4e713d610e456759d0b912be2812438c88c9 (diff)
downloadnextcloud-server-7f51a020765718e607fe44a634e0bd4855c99837.tar.gz
nextcloud-server-7f51a020765718e607fe44a634e0bd4855c99837.zip
fix: Reset notification email automatically when deleting additonal email
Signed-off-by: Christopher Ng <chrng8@gmail.com>
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php3
-rw-r--r--apps/settings/src/components/PersonalInfo/EmailSection/Email.vue3
2 files changed, 6 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 46773f2f6a5..b0ddd4329af 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -838,6 +838,9 @@ class UsersController extends AUserData {
}
}
$this->accountManager->updateAccount($userAccount);
+ if ($value === '' && $key === $targetUser->getPrimaryEMailAddress()) {
+ $targetUser->setPrimaryEMailAddress('');
+ }
break;
case IAccountManager::COLLECTION_EMAIL . self::SCOPE_SUFFIX:
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
index ecc463c7363..ad9835baed1 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
+++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
@@ -356,6 +356,9 @@ export default {
handleDeleteAdditionalEmail(status) {
if (status === 'ok') {
this.$emit('delete-additional-email')
+ if (this.isNotificationEmail) {
+ this.$emit('update:notification-email', '')
+ }
} else {
this.handleResponse({
errorMessage: t('settings', 'Unable to delete additional email address'),