[BS5] add whats new modal after update

This commit is contained in:
FreddleSpl0it
2022-07-08 15:47:21 +02:00
parent d3cd21956a
commit 8987ebca36
8 changed files with 81 additions and 7 deletions

View File

@@ -27,7 +27,11 @@ if (is_array($alertbox_log_parser)) {
$globalVariables = [
'mailcow_info' => array(
'version_tag' => $GLOBALS['MAILCOW_GIT_VERSION'],
'git_project_url' => $GLOBALS['MAILCOW_GIT_URL']
'last_version_tag' => $GLOBALS['MAILCOW_LAST_GIT_VERSION'],
'project_url' => $GLOBALS['MAILCOW_GIT_URL'],
'project_owner' => $GLOBALS['MAILCOW_GIT_OWNER'],
'project_repo' => $GLOBALS['MAILCOW_GIT_REPO'],
'updatedAt' => $GLOBALS['MAILCOW_UPDATEDAT']
),
'js_path' => '/cache/'.basename($JSPath),
'pending_tfa_method' => @$_SESSION['pending_tfa_method'],

View File

@@ -251,7 +251,7 @@ function password_check($password1, $password2) {
return true;
}
function last_login($action, $username, $sasl_limit_days = 7) {
function last_login($action, $username, $sasl_limit_days = 7, $ui_offset = 1) {
global $pdo;
global $redis;
$sasl_limit_days = intval($sasl_limit_days);
@@ -319,8 +319,11 @@ function last_login($action, $username, $sasl_limit_days = 7) {
$stmt = $pdo->prepare('SELECT `remote`, `time` FROM `logs`
WHERE JSON_EXTRACT(`call`, "$[0]") = "check_login"
AND JSON_EXTRACT(`call`, "$[1]") = :username
AND `type` = "success" ORDER BY `time` DESC LIMIT 1 OFFSET 1');
$stmt->execute(array(':username' => $username));
AND `type` = "success" ORDER BY `time` DESC LIMIT 1 OFFSET :offset');
$stmt->execute(array(
':username' => $username,
':offset' => $ui_offset
));
$ui = $stmt->fetch(PDO::FETCH_ASSOC);
}
else {