|
@@ -9,6 +9,7 @@
|
|
|
<script type="application/javascript" src="../../script/jquery.min.js"></script>
|
|
<script type="application/javascript" src="../../script/jquery.min.js"></script>
|
|
|
<script type="application/javascript" src="../../script/ao_module.js"></script>
|
|
<script type="application/javascript" src="../../script/ao_module.js"></script>
|
|
|
<script type="application/javascript" src="../../script/semantic/semantic.js"></script>
|
|
<script type="application/javascript" src="../../script/semantic/semantic.js"></script>
|
|
|
|
|
+ <script type="text/javascript" src="../../script/applocale.js"></script>
|
|
|
<style>
|
|
<style>
|
|
|
body{
|
|
body{
|
|
|
background-color: rgb(240, 240, 240);
|
|
background-color: rgb(240, 240, 240);
|
|
@@ -36,9 +37,9 @@
|
|
|
<div class="ui container" align="center">
|
|
<div class="ui container" align="center">
|
|
|
<div class="ui segment" style="max-width:400px;" align="left">
|
|
<div class="ui segment" style="max-width:400px;" align="left">
|
|
|
<!-- Current In Use Account -->
|
|
<!-- Current In Use Account -->
|
|
|
- <p>Current account</p>
|
|
|
|
|
|
|
+ <p locale="desc/currentAccount">Current account</p>
|
|
|
<div class="ui small basic right floated button" onclick="logout();">
|
|
<div class="ui small basic right floated button" onclick="logout();">
|
|
|
- <i class="log out icon"></i> <span locale="quickAccess/logout">Logout</span>
|
|
|
|
|
|
|
+ <i class="log out icon"></i> <span locale="button/logout">Logout</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="ui header">
|
|
<div class="ui header">
|
|
|
<img id="currentUserIcon" src="/images/icons/plugin.png">
|
|
<img id="currentUserIcon" src="/images/icons/plugin.png">
|
|
@@ -49,30 +50,30 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui divider"></div>
|
|
<div class="ui divider"></div>
|
|
|
- <p>Saved accounts on this browser</p>
|
|
|
|
|
|
|
+ <p locale="desc/savedAccount">Saved accounts on this browser</p>
|
|
|
<div id="alternativeAccountList">
|
|
<div id="alternativeAccountList">
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
<div style="margin-top: 1em !important;">
|
|
<div style="margin-top: 1em !important;">
|
|
|
- <div id="signoutAllButton" class="ui fluid small black basic button" onclick="logoutAllAccounts();"><i class="log out icon icon"></i> Sign-out all accounts</div>
|
|
|
|
|
|
|
+ <div id="signoutAllButton" class="ui fluid small black basic button" onclick="logoutAllAccounts();"><i class="log out icon icon"></i> <span locale="desc/signoutAll">Sign-out all accounts</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="ui divider"></div>
|
|
<div class="ui divider"></div>
|
|
|
- <p>Sign-in to new account</p>
|
|
|
|
|
|
|
+ <p locale="desc/sign-in-new">Sign-in to new account</p>
|
|
|
<form class="ui form" onsubmit="handleFormSubmit(event, this);">
|
|
<form class="ui form" onsubmit="handleFormSubmit(event, this);">
|
|
|
<div class="field">
|
|
<div class="field">
|
|
|
- <label>Username</label>
|
|
|
|
|
|
|
+ <label locale="desc/username">Username</label>
|
|
|
<input id="username" type="text" name="username" value="">
|
|
<input id="username" type="text" name="username" value="">
|
|
|
</div>
|
|
</div>
|
|
|
<div class="field">
|
|
<div class="field">
|
|
|
- <label>Password</label>
|
|
|
|
|
|
|
+ <label locale="desc/password">Password</label>
|
|
|
<input id="magic" type="password" name="magic">
|
|
<input id="magic" type="password" name="magic">
|
|
|
</div>
|
|
</div>
|
|
|
- <button id="submitbtn" class="ui basic button"><i class="ui green sign in icon"></i> Login</button>
|
|
|
|
|
|
|
+ <button id="submitbtn" class="ui basic button"><i class="ui green sign in icon"></i> <span locale="desc/addAccount">Add Local Account</span></button>
|
|
|
</form>
|
|
</form>
|
|
|
<div id="restoreSessionMessage" class="ui blue inverted segment" style="display:none;">
|
|
<div id="restoreSessionMessage" class="ui blue inverted segment" style="display:none;">
|
|
|
- <span>Enter password to resume session</span>
|
|
|
|
|
|
|
+ <span locale="desc/enterPassword">Enter password to resume session</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div id="errmsg" class="ui red inverted segment" style="display:none;">
|
|
<div id="errmsg" class="ui red inverted segment" style="display:none;">
|
|
|
<i class="remove icon"></i> <span id="errtext">Internal Server Error</span>
|
|
<i class="remove icon"></i> <span id="errtext">Internal Server Error</span>
|
|
@@ -88,6 +89,26 @@
|
|
|
let currentUserInfo = {};
|
|
let currentUserInfo = {};
|
|
|
let browserAccountPoolUUID = localStorage.getItem("ao_acc");
|
|
let browserAccountPoolUUID = localStorage.getItem("ao_acc");
|
|
|
|
|
|
|
|
|
|
+ //Initalized localization
|
|
|
|
|
+ if (typeof(applocale) != "undefined"){
|
|
|
|
|
+ applocale.init("../../SystemAO/locale/switchAccount.json", function(){
|
|
|
|
|
+ applocale.translate();
|
|
|
|
|
+ initCurrentAccountInfo(function(){
|
|
|
|
|
+ listAllStoredAccounts();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //Applocale not found
|
|
|
|
|
+ var applocale = {};
|
|
|
|
|
+ applocale.getString = function(key, defaultString){
|
|
|
|
|
+ return defaultString;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ initCurrentAccountInfo(function(){
|
|
|
|
|
+ listAllStoredAccounts();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function handleFormSubmit(event, form){
|
|
function handleFormSubmit(event, form){
|
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
|
|
|
|
|
@@ -164,7 +185,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function logoutAllAccounts(){
|
|
function logoutAllAccounts(){
|
|
|
- if (confirm("This will logout all other accounts from this browser. Confirm?")){
|
|
|
|
|
|
|
+ if (confirm(applocale.getString("msg/logout/confirm", "This will logout all other accounts from this browser. Confirm?"))){
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: "/system/auth/u/logoutAll",
|
|
url: "/system/auth/u/logoutAll",
|
|
|
data: {pid: browserAccountPoolUUID},
|
|
data: {pid: browserAccountPoolUUID},
|
|
@@ -200,7 +221,7 @@
|
|
|
if (browserAccountPoolUUID == undefined){
|
|
if (browserAccountPoolUUID == undefined){
|
|
|
//Empty or no stored accounts
|
|
//Empty or no stored accounts
|
|
|
$("#alternativeAccountList").append(`<div class="ui message">
|
|
$("#alternativeAccountList").append(`<div class="ui message">
|
|
|
- <i class="ui green check circle icon"></i> No other account stored on this browser
|
|
|
|
|
|
|
+ <i class="ui green check circle icon"></i> ${applocale.getString("desc/noAlternative", "No other account stored on this browser")}
|
|
|
</div>`);
|
|
</div>`);
|
|
|
$("#signoutAllButton").addClass('disabled');
|
|
$("#signoutAllButton").addClass('disabled');
|
|
|
return;
|
|
return;
|
|
@@ -228,7 +249,7 @@
|
|
|
<img class="usericon" src="${userIcon}">
|
|
<img class="usericon" src="${userIcon}">
|
|
|
<div class="content" style="font-size: 95% !important;">
|
|
<div class="content" style="font-size: 95% !important;">
|
|
|
<span class="username">${account.Username}</span> ${(data.IsAdmin)?'<i style="margin-left: 0.4em; color: rgb(38, 50, 56);" title="Admin" class="small shield alternate icon themed text"></i>':""}
|
|
<span class="username">${account.Username}</span> ${(data.IsAdmin)?'<i style="margin-left: 0.4em; color: rgb(38, 50, 56);" title="Admin" class="small shield alternate icon themed text"></i>':""}
|
|
|
- <div class="sub header usergroup">${!account.IsExpired?"<i class='ui green check circle icon' style='margin-right: 0px;'></i> Session Valid":"<i class='ui red times circle icon' style='margin-right: 0px;'></i> Session Expired"}</div>
|
|
|
|
|
|
|
+ <div class="sub header usergroup">${!account.IsExpired?"<i class='ui green check circle icon' style='margin-right: 0px;'></i> " + applocale.getString("desc/sessionValid", "Session Valid"):"<i class='ui red times circle icon' style='margin-right: 0px;'></i> " + applocale.getString("desc/sessionExpired", "Session Expired")}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -239,7 +260,7 @@
|
|
|
}else{
|
|
}else{
|
|
|
$("#signoutAllButton").addClass('disabled');
|
|
$("#signoutAllButton").addClass('disabled');
|
|
|
$("#alternativeAccountList").append(`<div class="ui message">
|
|
$("#alternativeAccountList").append(`<div class="ui message">
|
|
|
- <i class="ui green check circle icon"></i> No other account stored on this browser
|
|
|
|
|
|
|
+ <i class="ui green check circle icon"></i> ${applocale.getString("desc/noAlternative", "No other account stored on this browser")}
|
|
|
</div>`);
|
|
</div>`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -282,13 +303,9 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- initCurrentAccountInfo(function(){
|
|
|
|
|
- listAllStoredAccounts();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
function logout() {
|
|
function logout() {
|
|
|
loggingOut = true;
|
|
loggingOut = true;
|
|
|
- if (confirm("Exiting Session. Confirm?")){
|
|
|
|
|
|
|
+ if (confirm(applocale.getString("msg/logout/thisAcConfirm", "Exiting Session. Confirm?"))){
|
|
|
$.get("../../system/auth/logout", function() {
|
|
$.get("../../system/auth/logout", function() {
|
|
|
window.location.href = "./";
|
|
window.location.href = "./";
|
|
|
});
|
|
});
|