diff --git a/frontend/delta/js/Clipperz/PM/PIN.js b/frontend/delta/js/Clipperz/PM/PIN.js index e2bcb52..f54285e 100644 --- a/frontend/delta/js/Clipperz/PM/PIN.js +++ b/frontend/delta/js/Clipperz/PM/PIN.js @@ -125,6 +125,21 @@ MochiKit.Base.update(Clipperz.PM.PIN, { localStorage.removeItem(this.FAILURE_COUNT); }, + 'isLocalStorageSupported': function() { + var result; + + var test = 'test'; + try { + localStorage.setItem(test, test); + localStorage.removeItem(test); + result = true; + } catch(e) { + result = false; + } + + return result; + }, + //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js b/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js index 84003f9..1269c1c 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Pages/LoginPage.js @@ -110,10 +110,10 @@ Clipperz.PM.UI.Components.Pages.LoginPageClass = React.createClass({ }, loginForm: function () { - return React.DOM.form({'key':'form', 'className':'loginForm credentials', 'autoComplete':'off', 'onChange':this.handleChange, 'onSubmit':this.handleCredentialSubmit}, [ + return React.DOM.form({'key':'form', 'className':'loginForm credentials', 'autoComplete':'off', 'autoCorrect':'off', 'autoCapitalize':'off', 'onChange':this.handleChange, 'onSubmit':this.handleCredentialSubmit}, [ React.DOM.div({'key':'fields'},[ React.DOM.label({'key':'username-label', 'htmlFor' :'name'}, "username"), - React.DOM.input({'key':'username', 'type':'text', 'name':'name', 'ref':'username', 'placeholder':"username", 'autoCapitalize':'none'}), + React.DOM.input({'key':'username', 'type':'text', 'name':'name', 'ref':'username', 'placeholder':"username", 'autoComplete':'off', 'autoCorrect':'off', 'autoCapitalize':'off', 'spellCheck': false}), React.DOM.label({'key':'passphrase-label', 'htmlFor' :'passphrase'}, "passphrase"), React.DOM.input({'key':'passphrase', 'type':'password', 'name':'passphrase', 'ref':'passphrase', 'placeholder':"passphrase"}) ]), diff --git a/frontend/delta/js/Clipperz/PM/UI/MainController.js b/frontend/delta/js/Clipperz/PM/UI/MainController.js index 5267e62..c1fc13e 100644 --- a/frontend/delta/js/Clipperz/PM/UI/MainController.js +++ b/frontend/delta/js/Clipperz/PM/UI/MainController.js @@ -154,7 +154,7 @@ MochiKit.Base.update(Clipperz.PM.UI.MainController.prototype, { // PIN is set using this command: // Clipperz.PM.PIN.setCredentialsWithPIN('1234', {'username':'joe', 'passphrase':'clipperz'}); - return Clipperz.PM.PIN.isSet() ? 'PIN' : 'CREDENTIALS'; + return (Clipperz.PM.PIN.isLocalStorageSupported() && Clipperz.PM.PIN.isSet()) ? 'PIN' : 'CREDENTIALS'; }, //========================================================================= @@ -351,7 +351,9 @@ console.log("THE BROWSER IS OFFLINE"); deferredResult.addCallback(MochiKit.Async.wait, 0.1); deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); deferredResult.addMethod(user, 'login'); - deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); + if (Clipperz.PM.PIN.isLocalStorageSupported()) { + deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); + } deferredResult.addMethod(this, 'setUser', user); deferredResult.addMethod(this, 'runApplication'); deferredResult.addMethod(this.overlay(), 'done', "", 1);