From 6f35c552e275a1f9fdc44e90f9defe0804c2a012 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 31 Jan 2022 13:18:00 -0700 Subject: [PATCH] Fix the show all on the email_queue. --- app/email_logs/email_logs.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/email_logs/email_logs.php b/app/email_logs/email_logs.php index e3bbbfe0b6..e7bb35be97 100644 --- a/app/email_logs/email_logs.php +++ b/app/email_logs/email_logs.php @@ -78,9 +78,11 @@ //prepare to page the results $sql = "select count(*) from v_email_logs "; - $sql .= "where true "; - if ($_REQUEST['show'] != 'all' && !permission_exists('email_log_all')) { - $sql .= "and domain_uuid = :domain_uuid "; + if ($_REQUEST['show'] == 'all' && permission_exists('email_log_all')) { + $sql .= "where true "; + } + else { + $sql .= "where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; } if (strlen($search) > 0) { @@ -106,10 +108,12 @@ $offset = $rows_per_page * $page; //get the list - $sql = "select count(*) from v_email_logs "; - $sql .= "where true "; - if ($_REQUEST['show'] != 'all' && !permission_exists('email_log_all')) { - $sql .= "and domain_uuid = :domain_uuid "; + $sql = "select * from v_email_logs "; + if ($_REQUEST['show'] == 'all' && permission_exists('email_log_all')) { + $sql .= "where true "; + } + else { + $sql .= "where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; } if (strlen($search) > 0) {