aboutsummaryrefslogtreecommitdiff
path: root/radicale_infcloud/web/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'radicale_infcloud/web/main.js')
-rw-r--r--radicale_infcloud/web/main.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/radicale_infcloud/web/main.js b/radicale_infcloud/web/main.js
index 6a8acda..5ef2763 100644
--- a/radicale_infcloud/web/main.js
+++ b/radicale_infcloud/web/main.js
@@ -588,6 +588,17 @@ function getLoggedUser()
function login()
{
$('#LoginLoader').fadeTo(1200, 1, function(){
+ /* Load localStorage values for automatic login
+ * No mechanism is currently provided for saving these values. The user must use Developer Tools
+ to run localStorage.setItem("pass","value") and so on.
+ */
+ if(localStorage.getItem("pass")!=null && localStorage.getItem("user")!=null){
+ $('#LoginPage').find('[data-type="system_username"]').val(localStorage.getItem("user"));
+ $('#LoginPage').find('[data-type="system_password"]').val(localStorage.getItem("pass"));
+ if(localStorage.getItem("locale")!=null){
+ $('#LoginPage').find('[data-type="language"]').val(localStorage.getItem("locale")).change();
+ }
+ }
globalLoginUsername=$('#LoginPage').find('[data-type="system_username"]').val();
globalLoginPassword=$('#LoginPage').find('[data-type="system_password"]').val();
loadConfig();
@@ -1066,6 +1077,10 @@ function globalMain()
mainSettings();
init();
+ /* Automatically log in if using localStorage */
+ if(localStorage.getItem("pass")!=null){
+ $('#LoginPage').find('[data-type="system_login"]').click();
+ }
}
function saveSettings(isFormSave)
bgstack15