list-virtual.php:

- fix displaying of 'modified' column for aliases when using postgres
  (bugreport mailed by Dominic, neocoretech @SF)
- drop MySQL variant of the alias query, the fixed postgres variant works for
  both
- fixed wrong position of $sql_where (search string) - must be outside 
  the sub-query
- escape search string in page browser - even if it is unlikely that enough
  mail adresses contain funny chars to let the pagebrowser appear ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@874 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent dc4667a4cb
commit e99547a06c

@ -155,24 +155,13 @@ if ($search == "") {
$sql_where = " AND ( address LIKE '%$search%' OR goto LIKE '%$search%' ) ";
}
$query = "SELECT $table_alias.address,
$table_alias.goto,
$table_alias.modified,
$table_alias.active
FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
WHERE ($sql_domain AND $table_mailbox.maildir IS NULL $sql_where)
ORDER BY $table_alias.address LIMIT $fDisplay, $page_size";
if ('pgsql'==$CONF['database_type'])
{
# TODO: is the different query for pgsql really needed? The mailbox query below also works with both...
$query = "SELECT address,
goto,
extract(epoch from modified) as modified,
modified,
active
FROM $table_alias
WHERE $sql_domain AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address $sql_where)
WHERE $sql_domain AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address) $sql_where
ORDER BY address LIMIT $page_size OFFSET $fDisplay";
}
$result = db_query ($query);
if ($result['rows'] > 0)
@ -359,7 +348,7 @@ class cNav_bar
if ($aSearch == "") {
$this->search = "";
} else {
$this->search = "&search=$aSearch";
$this->search = "&search=" . htmlentities($aSearch);
}
$this->url = '';
$this->fInit = false;

Loading…
Cancel
Save