From e2b0f096929e822d7e473187bb09361bb0f1610c Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 4 Nov 2007 19:46:37 +0000 Subject: [PATCH] search.php: remove dead code, fix for pgsql git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@193 a1433add-5e2c-0410-b055-b7f2511e0802 --- search.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/search.php b/search.php index c5559ee1..181a3199 100644 --- a/search.php +++ b/search.php @@ -89,23 +89,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") } -/* - - */ - if ($CONF['vacation_control_admin'] == 'YES') + if ($CONF['vacation_control_admin'] == 'YES' && $CONF['vacation'] == 'YES') { $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - # TODO: special query for pgsql needed? + echo $query; } else { $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; - /* TODO: special query for pgsql really needed? - if ('pgsql'==$CONF['database_type']) - { - $query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; - } - */ } $result = db_query ($query); @@ -117,15 +108,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { if ('pgsql'==$CONF['database_type']) { - $row['created']=gmstrftime('%c %Z',$row['created']); - $row['modified']=gmstrftime('%c %Z',$row['modified']); - # TODO: code from admin/search.php - # $row['created']=gmstrftime('%c %Z',$row['uts_created']); - # $row['modified']=gmstrftime('%c %Z',$row['uts_modified']); + $row['created']=gmstrftime('%c %Z',strtotime($row['created'])); + $row['modified']=gmstrftime('%c %Z',strtotime($row['modified'])); $row['active']=('t'==$row['active']) ? 1 : 0; - # TODO: code from admin/search.php - # unset($row['uts_created']); - # unset($row['uts_modified']); } $tMailbox[] = $row; }