diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 209baa3a..7ac0af58 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -258,7 +258,7 @@ function last_login($action, $username, $sasl_limit_days = 7) { switch ($action) { case 'get': if (filter_var($username, FILTER_VALIDATE_EMAIL) && hasMailboxObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $username)) { - $stmt = $pdo->prepare('SELECT `real_rip`, MAX(`datetime`) as `datetime`, `service`, `app_password` FROM `sasl_log` + $stmt = $pdo->prepare('SELECT `real_rip`, MAX(`datetime`) as `datetime`, `service`, `app_password`, MAX(`app_passwd`.`name`) as `app_password_name` FROM `sasl_log` LEFT OUTER JOIN `app_passwd` on `sasl_log`.`app_password` = `app_passwd`.`id` WHERE `username` = :username AND HOUR(TIMEDIFF(NOW(), `datetime`)) < :sasl_limit_days diff --git a/data/web/js/site/user.js b/data/web/js/site/user.js index f37ae747..fb6de191 100644 --- a/data/web/js/site/user.js +++ b/data/web/js/site/user.js @@ -101,10 +101,11 @@ jQuery(function($){ $.each(data.sasl, function (i, item) { var datetime = new Date(item.datetime.replace(/-/g, "/")); var local_datetime = datetime.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); - item.app_password ? app_password = ' App' : app_password = "", item.location ? ip_location = ' ' : ip_location = ""; - service = '