Skip to content

Commit

Permalink
Merge pull request #5724 from q16marvin/master
Browse files Browse the repository at this point in the history
show last sso login in mailbox table
  • Loading branch information
FreddleSpl0it authored Sep 5, 2024
2 parents 0d704a5 + 19deda3 commit b1368d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions data/web/inc/functions.mailbox.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4546,6 +4546,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
}
else if ($SaslLogs['service'] == 'pop3') {
$last_pop3_login = strtotime($SaslLogs['datetime']);
}
else if ($SaslLogs['service'] == 'SSO') {
$last_sso_login = strtotime($SaslLogs['datetime']);
}
}
if (!isset($last_imap_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
Expand All @@ -4556,10 +4559,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
}
if (!isset($last_pop3_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
$last_pop3_login = 0;
}
if (!isset($last_sso_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
$last_sso_login = 0;
}
$mailboxdata['last_imap_login'] = $last_imap_login;
$mailboxdata['last_smtp_login'] = $last_smtp_login;
$mailboxdata['last_pop3_login'] = $last_pop3_login;
$mailboxdata['last_sso_login'] = $last_sso_login;

if (!isset($_extra) || $_extra != 'reduced') {
$rl = ratelimit('get', 'mailbox', $_data);
Expand Down
5 changes: 3 additions & 2 deletions data/web/js/site/mailbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ jQuery(function($){
item.quota.value = humanFileSize(item.quota_used) + "/" + item.quota.value;

item.max_quota_for_mbox = humanFileSize(item.max_quota_for_mbox);
item.last_mail_login = item.last_imap_login + '/' + item.last_pop3_login + '/' + item.last_smtp_login;
item.last_mail_login = item.last_imap_login + '/' + item.last_pop3_login + '/' + item.last_smtp_login + '/' + item.last_sso_login;
/*
if (!item.rl) {
item.rl = '∞';
Expand Down Expand Up @@ -1015,7 +1015,8 @@ jQuery(function($){
res = data.split("/");
return '<div class="badge bg-info mb-2">IMAP @ ' + unix_time_format(Number(res[0])) + '</div><br>' +
'<div class="badge bg-info mb-2">POP3 @ ' + unix_time_format(Number(res[1])) + '</div><br>' +
'<div class="badge bg-info">SMTP @ ' + unix_time_format(Number(res[2])) + '</div>';
'<div class="badge bg-info">SMTP @ ' + unix_time_format(Number(res[2])) + '</div><br>' +
'<div class="badge bg-info">SSO @ ' + unix_time_format(Number(res[3])) + '</div>';
}
},
{
Expand Down

0 comments on commit b1368d2

Please sign in to comment.