From c1a98c5ff6d8a9844d7d4791532bf8ffd61743b1 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Thu, 30 Mar 2023 10:15:35 -0700 Subject: [PATCH] fix routing for vmail mapping --- panel/classes/Panel/Vmail/AliasesAdd.php | 7 ++++++- panel/classes/Panel/Vmail/AliasesDelete.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/panel/classes/Panel/Vmail/AliasesAdd.php b/panel/classes/Panel/Vmail/AliasesAdd.php index 57c39d4..d15c504 100644 --- a/panel/classes/Panel/Vmail/AliasesAdd.php +++ b/panel/classes/Panel/Vmail/AliasesAdd.php @@ -48,7 +48,12 @@ class AliasesAdd extends \Panel\Vmail { if ($result_code == 0) { $messages[] = "Success: Email alias $alias@$domain added."; $f3->set('SESSION.messages', $messages); - $f3->reroute("/Email/$domain/Accounts/$mbox/Aliases"); + $mapping = $f3->get('NAV.mapping'); + if ($mapping == 'vmail') { + $f3->reroute("/Accounts/$mbox/Aliases"); + } else { + $f3->reroute("/Email/$domain/Accounts/$mbox/Aliases"); + } } else { /* failure, set error messages */ if (count($output) > 0) { diff --git a/panel/classes/Panel/Vmail/AliasesDelete.php b/panel/classes/Panel/Vmail/AliasesDelete.php index 233459e..596974c 100644 --- a/panel/classes/Panel/Vmail/AliasesDelete.php +++ b/panel/classes/Panel/Vmail/AliasesDelete.php @@ -42,7 +42,12 @@ class AliasesDelete extends \Panel\Vmail { $messages[] = "Error deleting alias '$alias@$domain'."; } $f3->set('SESSION.messages', $messages); - $f3->reroute("/Email/$domain/Aliases"); + $mapping = $f3->get('NAV.mapping'); + if ($mapping == 'vmail') { + $f3->reroute("/Aliases"); + } else { + $f3->reroute("/Email/$domain/Aliases"); + } }