Index: typo3/sysext/t3skin/resources/login.js =================================================================== --- typo3/sysext/t3skin/resources/login.js (revision 6549) +++ typo3/sysext/t3skin/resources/login.js (working copy) @@ -6,6 +6,7 @@ TYPO3BackendLogin.registerEventListeners(); TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-username'), $('t3-username-clearIcon')); TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-password'), $('t3-password-clearIcon')); + TYPO3BackendLogin.checkForLogintypeCookie(); }, preloadImages: function() { @@ -94,6 +95,8 @@ if ($('t3-login-interface-section')) { $('t3-login-interface-section').hide(); } + + TYPO3BackendLogin.setLogintype('openid'); }, switchToDefault: function() { @@ -108,8 +111,28 @@ if ($('t3-login-interface-section')) { $('t3-login-interface-section').show(); } + + TYPO3BackendLogin.setLogintype('username'); }, + setLogintype: function(type) { + var expires = new Date(); + expires = new Date(expires.getTime() +1000*60*60*24*14); // 14 Days + document.cookie = 'logintype='+type+'; expires='+expires.toGMTString()+';'; + }, + + checkForLogintypeCookie: function() { + var nameEQ = 'logintype='; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0 && c.substring(nameEQ.length,c.length) == 'openid'){ + TYPO3BackendLogin.switchToOpenId(); + } + } + }, + showLoginProcess: function() { if ($('t3-login-error')) { $('t3-login-error').hide(); @@ -121,4 +144,4 @@ } }; -Event.observe(window, 'load', TYPO3BackendLogin.start); +Event.observe(window, 'load', TYPO3BackendLogin.start); \ No newline at end of file