diff --git a/admin/js/app.ts b/admin/js/app.ts index bbd4ec0931..b92d603280 100644 --- a/admin/js/app.ts +++ b/admin/js/app.ts @@ -20,6 +20,7 @@ import {egwAction, egwActionObject} from '../../api/js/egw_action/egw_action'; import {LitElement} from "@lion/core"; import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch"; import {et2_DOMWidget} from "../../api/js/etemplate/et2_core_DOMWidget"; +import {Et2SelectAccount} from "../../api/js/etemplate/Et2Select/Et2SelectAccount"; /** * UI for Admin @@ -1367,6 +1368,28 @@ class AdminApp extends EgwApp if (use_default) use_default.set_value(false); } + /** + * onchange callback for mail account account_id (valid for) + * + * @param {object} _event + * @param {et2_widget} _widget + */ + warnMailAccountForAllChanged(_event : Event, _widget : Et2SelectAccount) + { + const account_id = _widget.value; + const old_account_id = this.et2.getArrayMgr('content').getEntry('account_id'); + + // this is (no longer) an account for all + if ((Array.isArray(account_id) ? account_id.length : account_id) && + // but this was an account for all + !(Array.isArray(old_account_id) ? old_account_id.length : old_account_id)) + { + _widget.blur(); + Et2Dialog.alert(this.egw.lang('By selecting a user or group you effectively delete the mail account for all other users!\n\nAre you really sure you want to do that?'), + this.egw.lang('This is a mail account for ALL users!'), Et2Dialog.WARNING_MESSAGE); + } + } + /** * default onExecute for admin actions * diff --git a/admin/lang/egw_de.lang b/admin/lang/egw_de.lang index 52755350b7..8f5d52223f 100644 --- a/admin/lang/egw_de.lang +++ b/admin/lang/egw_de.lang @@ -188,6 +188,7 @@ blocking after wrong password admin de Blockierung nach falschem Passwort bottom admin de unten bulk password reset admin de Rücksetzen mehrerer Passwörter by admin de Von +by selecting a user or group you effectively delete the mail account for all other users!\n\nare you really sure you want to do that? admin de Durch die Auswahl eines Benutzer oder Gruppe löschen Sie das Mailkonto für alle anderen Benutzer!\n\nSind Sie wirklich sicher, dass Sie das wollen? calculate next run admin de nächste Ausführung berechnen calendar recurrence horizont in days (default 1000) admin de Kalender Wiederholungs-Bereich in Tagen (Vorgabe sind 1000) can be used by application admin de Kann von folgender Anwendung verwendet werden @@ -920,6 +921,7 @@ this application is current admin de Diese Anwendung ist aktuell this application requires an upgrade admin de Diese Anwendung benötigt ein Upgrade this category is currently being used by applications as a parent category admin de Diese Kategorie wird gegenwärtig als übergeordnete Kategorie benutzt. this controls exports and merging. admin de Steuert den Export und den Merge Print von Dokumenten +this is a mail account for all users! admin de Das ist ein Mailkonto für ALLE Benutzer! this is not a personal mail account!\n\naccount will be deleted for all users!\n\nare you really sure you want to do that? admin de Das ist KEIN persönliches Mail-Konto!\n\nDas Konto wird für ALLE Benutzer gelöscht!\n\nSind Sie wirklich sicher, dass Sie das wollen? this key used in the html code your site serves to users. admin de Dieser Schlüssel steht im HTML Code den Ihre Website ausliefert. this php has no imap support compiled in!! admin de Dieses PHP hat keine IMAP Unterstützung!!! diff --git a/admin/lang/egw_en.lang b/admin/lang/egw_en.lang index cf3d5479e3..114664785c 100644 --- a/admin/lang/egw_en.lang +++ b/admin/lang/egw_en.lang @@ -188,6 +188,7 @@ blocking after wrong password admin en Blocking after wrong password bottom admin en Bottom bulk password reset admin en Bulk password reset by admin en By +by selecting a user or group you effectively delete the mail account for all other users!\n\nare you really sure you want to do that? admin en By selecting a user or group you effectively delete the mail account for all other users!\n\nAre you really sure you want to do that? calculate next run admin en Calculate next run calendar recurrence horizont in days (default 1000) admin en Calendar recurrence horizon in days. Default = 1000. can be used by application admin en Can be used by application @@ -923,6 +924,7 @@ this application is current admin en This application is current. this application requires an upgrade admin en This application requires an upgrade. this category is currently being used by applications as a parent category admin en This category is currently being used by applications as a parent category. this controls exports and merging. admin en This controls exports and merge prints. +this is a mail account for all users! admin en This is a mail account for ALL users! this is not a personal mail account!\n\naccount will be deleted for all users!\n\nare you really sure you want to do that? admin en This is NOT a personal mail account!\n\nAccount will be deleted for ALL users!\n\nAre you really sure you want to do that? this key used in the html code your site serves to users. admin en This key used in the HTML code your site serves to users. this php has no imap support compiled in!! admin en This PHP has no IMAP support compiled in!! diff --git a/admin/templates/default/mailaccount.xet b/admin/templates/default/mailaccount.xet index a7dee94980..839ff35758 100644 --- a/admin/templates/default/mailaccount.xet +++ b/admin/templates/default/mailaccount.xet @@ -341,7 +341,7 @@ - + diff --git a/api/src/Mail/Account.php b/api/src/Mail/Account.php index f1fb4392af..e8448fa310 100644 --- a/api/src/Mail/Account.php +++ b/api/src/Mail/Account.php @@ -1300,7 +1300,7 @@ class Account implements \ArrayAccess { $old_account_ids[] = $row['account_id']; } - if ($data['account_id'] && ($ids_to_remove = array_diff($old_account_ids, (array)$data['account_id']))) + if (($ids_to_remove = array_diff($old_account_ids, (array)$data['account_id']))) { self::$db->delete(self::VALID_TABLE, $where+array( 'account_id' => $ids_to_remove,