Bug #21700 ยป logintype-cookie.diff
typo3/sysext/t3skin/resources/login.js (working copy) | ||
---|---|---|
TYPO3BackendLogin.registerEventListeners();
|
||
TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-username'), $('t3-username-clearIcon'));
|
||
TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-password'), $('t3-password-clearIcon'));
|
||
TYPO3BackendLogin.checkForLogintypeCookie();
|
||
},
|
||
preloadImages: function() {
|
||
... | ... | |
if ($('t3-login-interface-section')) {
|
||
$('t3-login-interface-section').hide();
|
||
}
|
||
|
||
TYPO3BackendLogin.setLogintype('openid');
|
||
},
|
||
switchToDefault: function() {
|
||
... | ... | |
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();
|
||
... | ... | |
}
|
||
};
|
||
Event.observe(window, 'load', TYPO3BackendLogin.start);
|
||
Event.observe(window, 'load', TYPO3BackendLogin.start);
|