You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
fix sqlite query for mailbox password_expiry
This commit is contained in:
@@ -2248,7 +2248,12 @@ function gen_show_status($show_alias) {
|
|||||||
|
|
||||||
// Expired CHECK
|
// Expired CHECK
|
||||||
if ( $CONF['show_expired'] == 'YES' ) {
|
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) {
|
if ($stat_result['rows'] == 1) {
|
||||||
$stat_string .= "<span style='background-color:" . $CONF['show_expired_color'] . "'>" . $CONF['show_status_text'] . "</span> ";
|
$stat_string .= "<span style='background-color:" . $CONF['show_expired_color'] . "'>" . $CONF['show_status_text'] . "</span> ";
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user