From 1dfb03ea327a8f9876ad8a5f5fa68a6faee0847b Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 28 Dec 2018 19:54:25 +0000 Subject: [PATCH] fix sqlite query for mailbox password_expiry --- functions.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions.inc.php b/functions.inc.php index a78e722b..c54b6a34 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -2248,7 +2248,12 @@ function gen_show_status($show_alias) { // Expired CHECK if ( $CONF['show_expired'] == 'YES' ) { - $stat_result = db_query("SELECT * FROM ". $CONF['database_tables']['mailbox'] ." WHERE username = '" . $show_alias . "' AND password_expiry <= now()"); + $now = ' now() '; + if (db_sqlite()) { + $now = "datetime('now')"; + } + + $stat_result = db_query("SELECT /* crapquery */ * FROM ". $CONF['database_tables']['mailbox'] ." WHERE username = '" . $show_alias . "' AND password_expiry <= $now "); if ($stat_result['rows'] == 1) { $stat_string .= "" . $CONF['show_status_text'] . " "; } else {