From 3bd7ef2b0a4bc5ef45aaaaf68d63ef0a1963f6ec Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sat, 13 Jan 2018 18:10:13 +0100 Subject: [PATCH] adjust pgsql $row['v_active'] only if vacation is enabled This avoids an "Undefined index" warning if vacation is disabled. Fixes: https://github.com/postfixadmin/postfixadmin/issues/118 --- list-virtual.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/list-virtual.php b/list-virtual.php index 109d5358..f25d5961 100644 --- a/list-virtual.php +++ b/list-virtual.php @@ -243,10 +243,13 @@ if ($result['rows'] > 0) { $row['modified'] = date('Y-m-d H:i', strtotime($row['modified'])); $row['created'] = date('Y-m-d H:i', strtotime($row['created'])); $row['active']=('t'==$row['active']) ? 1 : 0; - if($row['v_active'] == NULL) { - $row['v_active'] = 'f'; + + if (Config::bool('vacation_control_admin')) { + if($row['v_active'] == NULL) { + $row['v_active'] = 'f'; + } + $row['v_active']=('t'==$row['v_active']) ? 1 : 0; } - $row['v_active']=('t'==$row['v_active']) ? 1 : 0; } $tMailbox[] = $row; }