mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 21:34:38 +03:00
when removing an address, remove it as member from aliases
unless the address is the last member, then the admin must either remove the alias first, or add new members. we don't want to accidentally remove an alias address. in the admin page for removing addresses, we warn the admin that the address will be removed from any aliases.
This commit is contained in:
@ -837,7 +837,9 @@ const account = async (name: string) => {
|
||||
dom.td(
|
||||
dom.clickbutton('Remove', async function click(e: MouseEvent) {
|
||||
e.preventDefault()
|
||||
if (!window.confirm('Are you sure you want to remove this address?')) {
|
||||
const aliases = (config.Aliases || []).filter(aa => aa.SubscriptionAddress === k).map(aa => aa.Alias.LocalpartStr+"@"+domainName(aa.Alias.Domain))
|
||||
const aliasmsg = aliases.length > 0 ? ' Address will be removed from alias(es): '+aliases.join(', ') : ''
|
||||
if (!window.confirm('Are you sure you want to remove this address?'+aliasmsg)) {
|
||||
return
|
||||
}
|
||||
await check(e.target! as HTMLButtonElement, client.AddressRemove(k))
|
||||
@ -1273,7 +1275,7 @@ const domain = async (d: string) => {
|
||||
dom.td(
|
||||
dom.clickbutton('Remove', async function click(e: MouseEvent) {
|
||||
e.preventDefault()
|
||||
if (!window.confirm('Are you sure you want to remove this address?')) {
|
||||
if (!window.confirm('Are you sure you want to remove this address? If it is a member of an alias, it will be removed from the alias.')) {
|
||||
return
|
||||
}
|
||||
await check(e.target! as HTMLButtonElement, client.AddressRemove(t[0] + '@' + d))
|
||||
|
Reference in New Issue
Block a user