1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-31 10:04:20 +03:00

Adds colored indicators for password expired, account disabled and vacation enabled accounts

This commit is contained in:
Damien Martins
2018-08-21 15:57:06 +02:00
parent ab10c9b49a
commit d809e0fbf7
5 changed files with 60 additions and 0 deletions

View File

@ -2201,6 +2201,39 @@ function gen_show_status($show_alias) {
}
}
// Vacation CHECK
if ( $CONF['show_vacation'] == 'YES' ) {
$stat_result = db_query ("SELECT * FROM ". $CONF['database_tables']['vacation'] ." WHERE email = '" . $show_alias . "' AND active = 1");
if ($stat_result['rows'] == 1) {
$stat_string .= "<span style='background-color:" . $CONF['show_vacation_color'] .
"'>" . $CONF['show_status_text'] . "</span>&nbsp;";
} else {
$stat_string .= $CONF['show_status_text'] . "&nbsp;";
}
}
// Disabled CHECK
if ( $CONF['show_disabled'] == 'YES' ) {
$stat_result = db_query ("SELECT * FROM ". $CONF['database_tables']['mailbox'] ." WHERE username = '" . $show_alias . "' AND active = 0");
if ($stat_result['rows'] == 1) {
$stat_string .= "<span style='background-color:" . $CONF['show_disabled_color'] .
"'>" . $CONF['show_status_text'] . "</span>&nbsp;";
} else {
$stat_string .= $CONF['show_status_text'] . "&nbsp;";
}
}
// Expired CHECK
if ( $CONF['show_expired'] == 'YES' ) {
$stat_result = db_query ("SELECT * FROM ". $CONF['database_tables']['mailbox'] ." WHERE username = '" . $show_alias . "' AND pw_expires_on <= now()");
if ($stat_result['rows'] == 1) {
$stat_string .= "<span style='background-color:" . $CONF['show_expired_color'] .
"'>" . $CONF['show_status_text'] . "</span>&nbsp;";
} else {
$stat_string .= $CONF['show_status_text'] . "&nbsp;";
}
}
// POP/IMAP CHECK
if ($CONF['show_popimap'] == 'YES') {
$stat_delimiter = "";