Skip to content

Commit

Permalink
Version 75:
Browse files Browse the repository at this point in the history
* The login page should no longer automatically log in if you just closed UI3 less than 5 seconds ago.
  • Loading branch information
bp2008 committed May 30, 2019
1 parent 192a8a9 commit fd08820
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
7 changes: 6 additions & 1 deletion login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Blue Iris Login</title>
<script type="text/javascript">
var login_version = "19";
var login_version = "20";
var bi_version = "%%VERSION%%";
var combined_version = login_version + "-" + bi_version;
</script>
Expand Down Expand Up @@ -166,6 +166,11 @@ <h1>%%SYSNAME%%</h1>
{
SetPersistedValue("bi_override_disable_auto_login_once", "0");
}
var lastUnload = GetPersistedValue("bi_lastunload");
if (lastUnload > Date.now())
SetPersistedValue("bi_lastunload", 0);
else if (!skipAutoLogin)
skipAutoLogin = Date.now() - lastUnload < 5000;
clearTimeout(showLoadingMessageTimeout);
$("#loginLoading").hide();
$("#login").show();
Expand Down
2 changes: 1 addition & 1 deletion ui3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
};
</script>
<script type="text/javascript">
var ui_version = "74";
var ui_version = "75";
var bi_version = "%%VERSION%%";
var combined_version = ui_version + "-" + bi_version;
//if (!!navigator.userAgent.match(/ Android /))
Expand Down
15 changes: 12 additions & 3 deletions ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ var defaultSettings =
key: "bi_password"
, value: ""
}
, {
key: "bi_lastunload"
, value: 0
}
, {
key: "ui3_webcasting_disabled_dontShowAgain"
, value: "0"
Expand Down Expand Up @@ -2183,6 +2187,11 @@ $(function ()
$(window).resize(resized);
$('.topbar_tab[name="' + currentPrimaryTab + '"]').click(); // this calls resized()

window.addEventListener("beforeunload", function ()
{
settings.bi_lastunload = Date.now();
});

BI_CustomEvent.Invoke("UI_Loading_End");
});
function ValidateTabName(tabName)
Expand Down Expand Up @@ -3688,7 +3697,7 @@ function PtzButtons()
}
}
// PTZ Actions //
window.onbeforeunload = function ()
window.addEventListener("beforeunload", function ()
{
if (unsafePtzActionNeedsStopped)
{
Expand All @@ -3698,7 +3707,7 @@ function PtzButtons()
self.PTZ_unsafe_sync_guarantee(currentPtzCamId, currentPtz, 1);
}
return;
}
});
this.SendOrQueuePtzCommand = function (ptzCamId, ptzCmd, isStopCommand)
{
ptzCmd = parseInt(ptzCmd);
Expand Down Expand Up @@ -20193,7 +20202,7 @@ function UISettingsPanel()
if (s.category != category)
continue;
var key = s.key;
if (!key || key === "bi_rememberMe" || key === "bi_username" || key === "bi_password")
if (!key || key === "bi_rememberMe" || key === "bi_username" || key === "bi_password" || key === "bi_lastunload")
continue; // Don't write these to the file!
var value = settings.getItem(key);
sb.Append('OverrideDefaultSetting(');
Expand Down

0 comments on commit fd08820

Please sign in to comment.