fix sqlite display of password expired check for mailboxes

pull/229/head
David Goodwin 6 years ago
parent 1dfb03ea32
commit 20b1eb842e

@ -516,7 +516,7 @@ $CONF['show_undeliverable']='YES';
$CONF['show_undeliverable_color']='tomato';
// mails to these domains will never be flagged as undeliverable
$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext");
// show mailboxes with expired password
// show mailboxes with expired password; requires password_expiration to be enabled
$CONF['show_expired']='YES';
$CONF['show_expired_color']='orange';
// show vacation enabled mailboxes

@ -1948,7 +1948,6 @@ function db_update_q($table, $where, $values, $timestamp = array('modified')) {
if (Config::bool('password_expiration')) {
if ($table == 'mailbox') {
error_log("db_update_q : " . json_Encode($where));
$where_type = explode('=', $where);
$email = ($where_type[1]);
$domain_dirty = explode('@',$email)[1];
@ -2247,13 +2246,14 @@ function gen_show_status($show_alias) {
}
// Expired CHECK
if ( $CONF['show_expired'] == 'YES' ) {
$now = ' now() ';
if ( Config::bool('password_expiration') && Config::bool('show_expired') ) {
$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 ");
$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 .= "<span style='background-color:" . $CONF['show_expired_color'] . "'>" . $CONF['show_status_text'] . "</span>&nbsp;";
} else {

@ -163,7 +163,6 @@ $pagebrowser_alias = $handler->getPagebrowser($search_alias, array());
$tAlias = $handler->result();
#
# mailboxes
#

Loading…
Cancel
Save