[TASK] Clean up backend login controller Part 1 02/31802/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 25 Jul 2014 11:00:32 +0000 (13:00 +0200)
committerBenjamin Mack <benni@typo3.org>
Fri, 25 Jul 2014 12:55:26 +0000 (14:55 +0200)
To prepare a switch of the backend login view to a fluid rendered
template, the current controller is first simlpfied a bit and some
ancient code is removed.

With t3skin, the default template of ext:backend/.../login.html is
always overloaded by ext:t3skin/.../login.html. The patch overwrites
the content of the ext:backend template with the content from
ext:login and removes the template and overload registration in
ext:login.

The old template in ext:backend was not used for a very long time
but includes some old handling like loginBoxImage_rotationFolder
encapsulated in makeLoginBoxImage(). This code is dropped without
substitution.

References to two ancient login images are dropped with the removal
of makeLoginBoxImage() and can be finally removed along the way.

Change-Id: I057fbe062b138ab4f428e49e511bc46363a8a7ed
Resolves: #60559
Releases: 6.3
Reviewed-on: http://review.typo3.org/31802
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/gfx/loginbox_image_dev.png [deleted file]
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Resources/Private/Templates/login.html
typo3/sysext/backend/Resources/Public/JavaScript/login.js [new file with mode: 0644]
typo3/sysext/t3skin/Resources/Private/Templates/login.html [deleted file]
typo3/sysext/t3skin/Resources/Public/JavaScript/login.js [deleted file]
typo3/sysext/t3skin/ext_tables.php

diff --git a/typo3/gfx/loginbox_image_dev.png b/typo3/gfx/loginbox_image_dev.png
deleted file mode 100644 (file)
index 8471669..0000000
Binary files a/typo3/gfx/loginbox_image_dev.png and /dev/null differ
index 1e00ffc..380be5b 100644 (file)
@@ -321,7 +321,7 @@ class LoginController {
                }
                $markers = array(
                        'LOGO' => $logo,
-                       'LOGINBOX_IMAGE' => $this->makeLoginBoxImage(),
+                       'LOGINBOX_IMAGE' => '',
                        'FORM' => $content,
                        'NEWS' => $this->makeLoginNews(),
                        'COPYRIGHT' => BackendUtility::TYPO3_copyRightNotice($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightShowVersion']),
@@ -470,42 +470,11 @@ class LoginController {
         * Returns the login box image, whether the default or an image from the rotation folder.
         *
         * @return string HTML image tag.
-        * @todo Define visibility
+        * @deprecated since 6.3, will be removed
         */
        public function makeLoginBoxImage() {
-               $loginboxImage = '';
-               // Look for rotation image folder:
-               if ($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder']) {
-                       $absPath = GeneralUtility::resolveBackPath(PATH_typo3 . $GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder']);
-                       // Get rotation folder:
-                       $dir = GeneralUtility::getFileAbsFileName($absPath);
-                       if ($dir && @is_dir($dir)) {
-                               // Get files for rotation into array:
-                               $files = GeneralUtility::getFilesInDir($dir, 'png,jpg,gif');
-                               // Pick random file:
-                               $randImg = array_rand($files, 1);
-                               // Get size of random file:
-                               $imgSize = @getimagesize(($dir . $files[$randImg]));
-                               $imgAuthor = is_array($GLOBALS['TBE_STYLES']['loginBoxImage_author']) && $GLOBALS['TBE_STYLES']['loginBoxImage_author'][$files[$randImg]] ? htmlspecialchars($GLOBALS['TBE_STYLES']['loginBoxImage_author'][$files[$randImg]]) : '';
-                               // Create image tag:
-                               if (is_array($imgSize)) {
-                                       $loginboxImage = '<img src="' . htmlspecialchars(($GLOBALS['TBE_STYLES']['loginBoxImage_rotationFolder'] . $files[$randImg])) . '" ' . $imgSize[3] . ' id="loginbox-image" alt="' . $imgAuthor . '" title="' . $imgAuthor . '" />';
-                               }
-                       }
-               } else {
-                       // If no rotation folder configured, print default image:
-                       // Development version
-                       if (strstr(TYPO3_version, '-dev')) {
-                               $loginImage = 'loginbox_image_dev.png';
-                               $imagecopy = 'You are running a development version of TYPO3 ' . TYPO3_branch;
-                       } else {
-                               $loginImage = 'loginbox_image.jpg';
-                               $imagecopy = 'Photo by J.C. Franca (www.digitalphoto.com.br)';
-                       }
-                       $loginboxImage = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], ('gfx/' . $loginImage), 'width="200" height="133"') . ' id="loginbox-image" alt="' . $imagecopy . '" title="' . $imagecopy . '" />';
-               }
-               // Return image tag:
-               return $loginboxImage;
+               GeneralUtility::logDeprecatedFunction();
+               return '';
        }
 
        /**
index 17f1eb3..468387e 100644 (file)
 <!-- ###PAGE### begin -->
-<table cellspacing="0" cellpadding="0" border="0" id="wrapper">
-       <tr>
-               <td class="c-wrappercell" align="center">
-                       <div id="loginimage">###LOGO###</div>
-                       <table cellspacing="0" cellpadding="0" border="0" id="loginwrapper">
-                               <tr>
-                                       <td ###CSS_ERRORCLASS###>
-                                               ###LOGINBOX_IMAGE###
-                                               ###FORM###
-                                       </td>
-                               </tr>
-                       </table>
-                       ###NEWS###
-                       <div id="copyrightnotice">###COPYRIGHT###</div>
-               </td>
-       </tr>
-</table>
+<div id="t3-login-form" ###CSS_CLASSES###>
+       ###LOGO###
+
+       <div class="shadow">
+               <div class="t3-headline">
+                       <h2>###HEADLINE###</h2>
+               </div>
+
+               <div class="t3-login-box-body">
+                       <noscript>
+                               <div id="t3-noscript-error" class="t3-login-alert t3-login-alert-error">
+                                       <h2>###ERROR_JAVASCRIPT###</h2>
+                               </div>
+                       </noscript>
+                       <div id="t3-nocookies-error" class="t3-login-alert t3-login-alert-warning" style="display:none">
+                               <h2>###ERROR_COOKIES###</h2>
+                               <div id="t3-nocookies-ignore"><a href="#"  onclick="TYPO3BackendLogin.hideCookieWarning()">###ERROR_COOKIES_IGNORE###</a></div>
+                       </div>
+                       <!--[if lte IE 6]>
+                       ###WARNING_BROWSER_INCOMPATIBLE###
+                       <![endif]-->
+                       <div id="t3-login-process" style="display: none">
+                               <h2>###LOGIN_PROCESS###</h2>
+                       </div>
+
+                       ###FORM###
+
+               </div>
+       </div>
+       <script type="text/javascript" src="sysext/backend/Resources/Public/JavaScript/login.js"></script>
+       <script type="text/javascript" src="sysext/backend/Resources/Public/JavaScript/jsfunc.placeholder.js"></script>
+
+       ###NEWS###
+
+       <div id="t3-copyright-notice">
+               ###COPYRIGHT###
+       </div>
+       <div id="t3-meta-links">
+               <a href="http://typo3.org" target="_blank" class="t3-login-link-typo3">TYPO3.org</a>
+               &#124;
+               <a href="http://typo3.org/donate/" target="_blank" class="t3-login-link-donate">###LABEL_DONATELINK###</a>
+       </div>
+</div>
 <!-- ###PAGE### end -->
 
+<!-- ###LOGIN_NEWS### begin -->
+<div id="t3-login-news-outer" class="shadow">
+       <div class="t3-headline">
+               <h2 class="t3-login-news-headline">###NEWS_HEADLINE###</h2>
+       </div>
+       <div class="t3-login-box-body">
+               <dl id="t3-login-news">
+                       <!-- ###NEWS_ITEM### begin -->
+                       <div class="t3-login-news-item###CLASS###">
+                               <dt>
+                                       <span class="t3-news-date">###DATE###: </span>
+                                       <span class="t3-news-title">###HEADER###</span>
+                               </dt>
+                               <dd>
+                                       ###CONTENT###
+                               </dd>
+                       </div>
+                       <!-- ###NEWS_ITEM### end -->
+               </dl>
+       </div>
+</div>
+<div class="t3-login-box-border-bottom"></div>
+<!-- ###LOGIN_NEWS### end -->
 
 <!-- ###LOGIN_FORM### begin -->
-<table cellspacing="0" cellpadding="0" border="0" id="logintable">
-       <tr>
-               <td colspan="2"><h2>###HEADLINE###</h2></td>
-       </tr>
-       <!-- ###LOGIN_ERROR### begin -->
-       <tr class="c-wrong">
-               <td colspan="2"><p class="c-wrong">###ERROR_MESSAGE###</p></td>
-       </tr>
-       <!-- ###LOGIN_ERROR### end -->
-       <tr class="c-username">
-               <td><label for="username" class="c-username">###LABEL_USERNAME###:</label></td>
-               <td><input type="text" id="username" name="username" value="###VALUE_USERNAME###" class="c-username" autofocus="autofocus" /></td>
-       </tr>
-       <tr class="c-password">
-               <td><label for="password" class="c-password">###LABEL_PASSWORD###:</label></td>
-               <td><input type="password" id="password" name="p_field" value="###VALUE_PASSWORD###" class="c-password" /></td>
-       </tr>
-
-       <!-- ###INTERFACE_SELECTOR### begin -->
-       <tr class="c-interfaceselector">
-               <td><label for="interfaceselector" class="c-interfaceselector">###LABEL_INTERFACE###:</label></td>
-               <td>###VALUE_INTERFACE###</td>
-       </tr>
-       <!-- ###INTERFACE_SELECTOR### end -->
-       <tr class="c-submit">
-               <td></td>
-               <td><input type="submit" name="commandLI" value="###VALUE_SUBMIT###" class="c-submit" /></td>
-       </tr>
-       <tr class="c-info">
-               <td colspan="2"><p class="c-info">###INFO###</p></td>
-       </tr>
-</table>
-<!-- ###LOGIN_FORM### end -->
 
+<!-- ###LOGIN_ERROR### begin -->
+<div id="t3-login-error" class="t3-login-alert t3-login-alert-error">
+       <h2>###ERROR_LOGIN_TITLE###</h2>
+       <p>###ERROR_LOGIN_DESCRIPTION###</p>
+</div>
+<!-- ###LOGIN_ERROR### end -->
 
-<!-- ###LOGOUT_FORM### begin -->
-<table cellspacing="0" cellpadding="0" border="0" id="logintable">
-       <tr>
-               <td></td>
-               <td><h2>###HEADLINE###</h2></td>
-       </tr>
-       <tr class="c-username">
-               <td><p class="c-username">###LABEL_USERNAME###:</p></td>
-               <td><p class="c-username-current">###VALUE_USERNAME###</p></td>
-       </tr>
-       <!-- ###INTERFACE_SELECTOR### begin -->
-       <tr class="c-interfaceselector">
-               <td><p class="c-interfaceselector">###LABEL_INTERFACE###:</p></td>
-               <td>###VALUE_INTERFACE###</td>
-       </tr>
-       <!-- ###INTERFACE_SELECTOR### end -->
-       <tr class="c-submit">
-               <td><input type="hidden" name="p_field" value="" /></td>
-               <td><input type="submit" name="commandLO" value="###VALUE_SUBMIT###" class="c-submit" /></td>
-       </tr>
-       <tr class="c-info">
-               <td></td>
-               <td><p class="c-info">###INFO###</p></td>
-       </tr>
-</table>
-<!-- ###LOGOUT_FORM### end -->
+<div id="t3-login-form-fields" class="###CSS_OPENIDCLASS###">
+       <div class="t3-login-field" id="t3-login-username-section">
+               <input type="text" id="t3-username" name="username" value="###VALUE_USERNAME###" placeholder="###LABEL_USERNAME###" class="t3-username" autofocus="autofocus" />
 
-<!-- ###LOGIN_NEWS### begin -->
-       <!-- Login screen news: -->
-       <h2 id="loginNewsTitle">###NEWS_HEADLINE###</h2>
-       <dl id="loginNews">
-        <!-- ###NEWS_ITEM### begin -->
-                               <dt>###HEADER### <span>###DATE###</span></dt>
-                               <dd>###CONTENT###</dd>
-        <!-- ###NEWS_ITEM### end -->
-       </dl>
-<!-- ###LOGIN_NEWS### end -->
\ No newline at end of file
+               <div class="t3-login-clearInputField">
+                       <a id="t3-username-clearIcon" style="display: none;">
+                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
+                       </a>
+               </div>
+               <div class="t3-login-alert-capslock" id="t3-username-alert-capslock" style="display: none">
+                       <img src="sysext/t3skin/icons/login_capslock.gif" alt="###ERROR_CAPSLOCK###" title="###ERROR_CAPSLOCK###" />
+               </div>
+       </div>
+       <div class="t3-login-password t3-login-field" id="t3-login-password-section">
+               <input type="password" id="t3-password" name="p_field" value="###VALUE_PASSWORD###" placeholder="###LABEL_PASSWORD###" class="t3-password" />
+               <div class="t3-login-clearInputField">
+                       <a id="t3-password-clearIcon" style="display: none;">
+                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
+                       </a>
+               </div>
+               <div class="t3-login-alert-capslock" id="t3-password-alert-capslock" style="display: none">
+                       <img src="sysext/t3skin/icons/login_capslock.gif" alt="###ERROR_CAPSLOCK###" title="###ERROR_CAPSLOCK###" />
+               </div>
+       </div>
+       <div class="t3-login-field" id="t3-login-openid_url-section" style="display: none">
+               <input type="text" id="openid_url" name="openid_url" value="###VALUE_OPENID_URL###" placeholder="###LABEL_OPENID###" class="t3-openidurl" />
+
+               <div class="t3-login-clearInputField">
+                       <a id="openid_url-clearIcon" style="display: none;">
+                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
+                       </a>
+               </div>
+       </div>
+       <div class="t3-login-field clearfix">
+               <!-- ###INTERFACE_SELECTOR### begin -->
+               <div class="t3-login-interface" id="t3-login-interface-section">
+                       ###VALUE_INTERFACE###
+                       </div>
+               <!-- ###INTERFACE_SELECTOR### end -->
+
+               <div id="t3-login-openIdLogo" style="display: none">
+                       <img src="sysext/t3skin/icons/logo-openid.png" alt="OpenID" title="OpenID" />
+               </div>
+
+               <input type="submit" name="commandLI" id="t3-login-submit" value="###VALUE_SUBMIT###" class="t3-login-submit" />
+       </div>
+
+       <div class="t3-login-form-footer">
+               <div id="t3-login-form-footer-default">
+                       <a id="t3-login-switchToOpenId" class="switchToOpenId">###LABEL_SWITCHOPENID###</a>
+               </div>
+               <div id="t3-login-form-footer-openId" style="display: none">
+                       <a href="http://openid.net/" id="t3-login-whatIsOpenId" target="_blank" class="switchToOpenId">###LABEL_WHATISOPENID###</a>
+                       &#124;
+                       <a id="t3-login-switchToDefault" class="switchToOpenId">###LABEL_SWITCHDEFAULT###</a>
+               </div>
+       </div>
+</div>
+<!-- ###LOGIN_FORM### end -->
+
+<!-- ###LOGOUT_FORM### begin -->
+<div id="t3-login-form-fields">
+       <div class="t3-login-logout-form">
+               <div class="t3-login-username t3-login-field">
+                       <div class="t3-login-label t3-username">
+                               ###LABEL_USERNAME###
+                       </div>
+                       <div class="t3-username-current">
+                               ###VALUE_USERNAME###
+                       </div>
+               </div>
+               <!-- ###INTERFACE_SELECTOR### begin -->
+               <div class="t3-login-interface t3-login-field">
+                       <div class="t3-login-label t3-interface-selector">
+                               ###LABEL_INTERFACE###
+                       </div>
+                       ###VALUE_INTERFACE###
+                       <!-- ###INTERFACE_SELECTOR### end -->
+               </div>
+               <input type="hidden" name="p_field" value="" /><input type="submit" name="commandLO" value="###VALUE_SUBMIT###" class="t3-login-submit" />
+       </div>
+</div>
+<!-- ###LOGOUT_FORM### end -->
\ No newline at end of file
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/login.js b/typo3/sysext/backend/Resources/Public/JavaScript/login.js
new file mode 100644 (file)
index 0000000..4091e9e
--- /dev/null
@@ -0,0 +1,259 @@
+var isWebKit = document.childNodes && !document.all && !navigator.taintEnabled;
+
+TYPO3BackendLogin = {
+
+       /**
+        *  Initializing the Login Interface
+        */
+       start: function() {
+               TYPO3BackendLogin.preloadImages();
+               TYPO3BackendLogin.registerEventListeners();
+               TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-username'), $('t3-username-clearIcon'));
+               TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-password'), $('t3-password-clearIcon'));
+               TYPO3BackendLogin.checkCookieSupport();
+               TYPO3BackendLogin.checkForLogintypeCookie();
+               TYPO3BackendLogin.checkForInterfaceCookie();
+               $('t3-username').activate();
+       },
+
+       /**
+        * Preload the login process image, so it can show up immediatelly after submitting
+        */
+       preloadImages: function() {
+               var image = new Image();
+               image.src = 'sysext/t3skin/icons/login-submit-progress.gif';
+       },
+
+       /**
+        * Registers listeners for the Login Interface (e.g. to toggle OpenID and Default login)
+        */
+       registerEventListeners: function() {
+               Event.observe(
+                               $('t3-login-switchToOpenId'),
+                               'click',
+                               TYPO3BackendLogin.switchToOpenId
+                       );
+               Event.observe(
+                       $('t3-login-switchToDefault'),
+                       'click',
+                       TYPO3BackendLogin.switchToDefault
+               );
+               Event.observe(
+                       $('t3-login-submit'),
+                       'click',
+                       TYPO3BackendLogin.showLoginProcess
+               );
+
+                       // The Interface selector is not always present, so this check is needed
+               if (Object.isElement($('t3-interfaceselector'))) {
+                       TYPO3BackendLogin.observeEvents(
+                               $('t3-interfaceselector'),
+                               ['change', 'blur'],
+                               TYPO3BackendLogin.interfaceSelectorChanged
+                       );
+               }
+
+               $A(['t3-username', 't3-password', 'openid_url']).each(function(value) {
+                       Event.observe(
+                                       $(value + '-clearIcon'),
+                                       'click',
+                                       function() { TYPO3BackendLogin.clearInputField($(value)); }
+                       );
+                       TYPO3BackendLogin.observeEvents(
+                                       $(value),
+                                       ['focus', 'blur', 'keypress'],
+                                       function() { TYPO3BackendLogin.setVisibilityOfClearIcon($(value), $(value + '-clearIcon')); }
+                       );
+                       if (!isWebKit) {
+                               Event.observe(
+                                       $(value),
+                                       'keypress',
+                                       function(event) { TYPO3BackendLogin.showCapsLockWarning($(value + '-alert-capslock'), event); }
+                               );
+                       }
+               })
+       },
+
+       /**
+        * Wrapper for Event.observe that takes an array with events, instead of only one event
+        */
+       observeEvents: function(element, events, handler) {
+               events.each(function(event) {
+                       Event.observe(
+                               element,
+                               event,
+                               handler
+                       );
+               });
+       },
+
+       /**
+        * Shows up the clear icon for a field which is not empty, and hides it otherwise
+        */
+       setVisibilityOfClearIcon: function(formField, clearIcon) {
+               if (formField.value) {
+                       clearIcon.show();
+               } else {
+                       clearIcon.hide();
+               }
+       },
+
+       /**
+        * To prevent its unintented use when typing the password, the user is warned when Capslock is on
+        */
+       showCapsLockWarning: function(alertIcon, event) {
+               if (isCapslock(event)) {
+                       alertIcon.show();
+               } else {
+                       alertIcon.hide();
+               }
+       },
+
+       /**
+        * Clears an input field and sets focus to it
+        */
+       clearInputField: function(formField) {
+               formField.value = '';
+               formField.focus();
+       },
+
+       /**
+        * Change to Interface for OpenId login and save the selection to a cookie
+        */
+       switchToOpenId: function() {
+               $('t3-login-openIdLogo').show();
+
+               $('t3-login-form-footer-default').hide();
+               $('t3-login-form-footer-openId').show();
+               $('t3-login-username-section').hide();
+               $('t3-login-password-section').hide();
+               $('t3-login-openid_url-section').show();
+
+               if ($('t3-login-interface-section')) {
+                       $('t3-login-interface-section').hide();
+               }
+
+               $('openid_url').activate();
+               if ($('t3-username').getValue() == '') {
+                       $('t3-username').setValue('openid_url');
+               }
+
+               TYPO3BackendLogin.setLogintypeCookie('openid');
+       },
+
+       /**
+        * Change to Interface for default login and save the selection to a cookie
+        */
+       switchToDefault: function() {
+               $('t3-login-openIdLogo').hide();
+
+               if ($('t3-username').getValue() == 'openid_url') {
+                       $('t3-username').setValue('');
+               }
+
+               $('t3-login-form-footer-default').show();
+               $('t3-login-form-footer-openId').hide();
+               $('t3-login-username-section').show();
+               $('t3-login-password-section').show();
+               $('t3-login-openid_url-section').hide();
+
+               if ($('t3-login-interface-section')) {
+                       $('t3-login-interface-section').show();
+               }
+
+               $('t3-username').activate();
+
+               TYPO3BackendLogin.setLogintypeCookie('username');
+       },
+
+       /**
+        * Checks browser's cookie support
+        */
+       checkCookieSupport: function() {
+               Ext.util.Cookies.set('typo3-login-cookiecheck', true);
+               cookieEnabled = Ext.util.Cookies.get('typo3-login-cookiecheck');
+
+               if (!cookieEnabled) {
+                       TYPO3BackendLogin.showCookieWarning()
+               }
+
+               Ext.util.Cookies.set('typo3-login-cookiecheck', '', new Date(0));
+       },
+
+       /**
+        * Hides input fields and shows cookie warning
+        */
+       showCookieWarning: function() {
+               Ext.get('t3-login-form-fields').setVisibilityMode(Ext.Element.DISPLAY).hide();
+               Ext.get('t3-nocookies-error').show();
+       },
+
+       /**
+        * Hides cookie warning and shows input fields
+        */
+       hideCookieWarning: function() {
+               Ext.get('t3-nocookies-error').setVisibilityMode(Ext.Element.DISPLAY).hide();
+               Ext.get('t3-login-form-fields').show();
+       },
+
+       /**
+        * Store a login type in a cookie to save it for future visits
+        * Login type means whether you login by username/password or OpenID
+        */
+       setLogintypeCookie: function(type) {
+               var now = new Date();
+               var expires = new Date(now.getTime() + 1000*60*60*24*365); // cookie expires in one year
+               document.cookie = 'typo3-login-method=' + type + '; expires=' + expires.toGMTString() + ';';
+       },
+
+       /**
+        * Check if a login type was stored in a cookie and change the Interface accordingly
+        */
+       checkForLogintypeCookie: function() {
+               if(document.cookie.indexOf('typo3-login-method=openid') >- 1) {
+                       TYPO3BackendLogin.switchToOpenId();
+               }
+       },
+
+       /**
+        * Store the new selected Interface in a cookie to save it for future visits
+        */
+       interfaceSelectorChanged: function(event) {
+               var now = new Date();
+               var expires = new Date(now.getTime() + 1000*60*60*24*365); // cookie expires in one year
+               document.cookie = 'typo3-login-interface=' + $('t3-interfaceselector').getValue() + '; expires=' + expires.toGMTString() + ';';
+       },
+
+       /**
+        * Check if an interface was stored in a cookie and preselect it in the select box
+        */
+       checkForInterfaceCookie: function() {
+               if (Object.isElement($('t3-interfaceselector'))) {
+                       var posStart = document.cookie.indexOf('typo3-login-interface=');
+                       if (posStart != -1) {
+                               var selectedInterface = document.cookie.substr(posStart + 22);
+                               selectedInterface = selectedInterface.substr(0, selectedInterface.indexOf(';'));
+                       }
+                       $('t3-interfaceselector').setValue(selectedInterface);
+               }
+       },
+
+       /**
+        * Hide all form fields and show a progress message and icon
+        */
+       showLoginProcess: function() {
+               if ($('t3-login-error')) {
+                       $('t3-login-error').hide();
+               }
+
+               $('t3-login-form-fields').hide();
+               $('t3-nocookies-error').hide();
+
+               // setting a fixed height (based on the current, calculated height of the browser) for
+               // the box with the login form, so it doesn't jump around when the spinner is shown
+               var loginBoxHeight = $('t3-login-form-fields').getHeight();
+               $('t3-login-process').setStyle({height: loginBoxHeight + 'px'}).show();
+       }
+};
+
+Ext.onReady(TYPO3BackendLogin.start, TYPO3BackendLogin);
diff --git a/typo3/sysext/t3skin/Resources/Private/Templates/login.html b/typo3/sysext/t3skin/Resources/Private/Templates/login.html
deleted file mode 100644 (file)
index 74602d2..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<!-- ###PAGE### begin -->
-<div id="t3-login-form" ###CSS_CLASSES###>
-       ###LOGO###
-
-       <div class="shadow">
-               <div class="t3-headline">
-                       <h2>###HEADLINE###</h2>
-               </div>
-
-               <div class="t3-login-box-body">
-                       <noscript>
-                               <div id="t3-noscript-error" class="t3-login-alert t3-login-alert-error">
-                                       <h2>###ERROR_JAVASCRIPT###</h2>
-                               </div>
-                       </noscript>
-                       <div id="t3-nocookies-error" class="t3-login-alert t3-login-alert-warning" style="display:none">
-                               <h2>###ERROR_COOKIES###</h2>
-                               <div id="t3-nocookies-ignore"><a href="#"  onclick="TYPO3BackendLogin.hideCookieWarning()">###ERROR_COOKIES_IGNORE###</a></div>
-                       </div>
-                       <!--[if lte IE 6]>
-                       ###WARNING_BROWSER_INCOMPATIBLE###
-                       <![endif]-->
-                       <div id="t3-login-process" style="display: none">
-                               <h2>###LOGIN_PROCESS###</h2>
-                       </div>
-
-                       ###FORM###
-
-               </div>
-       </div>
-       <script type="text/javascript" src="sysext/t3skin/Resources/Public/JavaScript/login.js"></script>
-       <script type="text/javascript" src="sysext/backend/Resources/Public/JavaScript/jsfunc.placeholder.js"></script>
-
-       ###NEWS###
-
-       <div id="t3-copyright-notice">
-               ###COPYRIGHT###
-       </div>
-       <div id="t3-meta-links">
-               <a href="http://typo3.org" target="_blank" class="t3-login-link-typo3">TYPO3.org</a>
-               &#124;
-               <a href="http://typo3.org/donate/" target="_blank" class="t3-login-link-donate">###LABEL_DONATELINK###</a>
-       </div>
-</div>
-<!-- ###PAGE### end -->
-
-<!-- ###LOGIN_NEWS### begin -->
-<div id="t3-login-news-outer" class="shadow">
-       <div class="t3-headline">
-               <h2 class="t3-login-news-headline">###NEWS_HEADLINE###</h2>
-       </div>
-       <div class="t3-login-box-body">
-               <dl id="t3-login-news">
-                       <!-- ###NEWS_ITEM### begin -->
-                       <div class="t3-login-news-item###CLASS###">
-                               <dt>
-                                       <span class="t3-news-date">###DATE###: </span>
-                                       <span class="t3-news-title">###HEADER###</span>
-                               </dt>
-                               <dd>
-                                       ###CONTENT###
-                               </dd>
-                       </div>
-                       <!-- ###NEWS_ITEM### end -->
-               </dl>
-       </div>
-</div>
-<div class="t3-login-box-border-bottom"></div>
-<!-- ###LOGIN_NEWS### end -->
-
-<!-- ###LOGIN_FORM### begin -->
-
-<!-- ###LOGIN_ERROR### begin -->
-<div id="t3-login-error" class="t3-login-alert t3-login-alert-error">
-       <h2>###ERROR_LOGIN_TITLE###</h2>
-       <p>###ERROR_LOGIN_DESCRIPTION###</p>
-</div>
-<!-- ###LOGIN_ERROR### end -->
-
-<div id="t3-login-form-fields" class="###CSS_OPENIDCLASS###">
-       <div class="t3-login-field" id="t3-login-username-section">
-               <input type="text" id="t3-username" name="username" value="###VALUE_USERNAME###" placeholder="###LABEL_USERNAME###" class="t3-username" autofocus="autofocus" />
-
-               <div class="t3-login-clearInputField">
-                       <a id="t3-username-clearIcon" style="display: none;">
-                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
-                       </a>
-               </div>
-               <div class="t3-login-alert-capslock" id="t3-username-alert-capslock" style="display: none">
-                       <img src="sysext/t3skin/icons/login_capslock.gif" alt="###ERROR_CAPSLOCK###" title="###ERROR_CAPSLOCK###" />
-               </div>
-       </div>
-       <div class="t3-login-password t3-login-field" id="t3-login-password-section">
-               <input type="password" id="t3-password" name="p_field" value="###VALUE_PASSWORD###" placeholder="###LABEL_PASSWORD###" class="t3-password" />
-               <div class="t3-login-clearInputField">
-                       <a id="t3-password-clearIcon" style="display: none;">
-                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
-                       </a>
-               </div>
-               <div class="t3-login-alert-capslock" id="t3-password-alert-capslock" style="display: none">
-                       <img src="sysext/t3skin/icons/login_capslock.gif" alt="###ERROR_CAPSLOCK###" title="###ERROR_CAPSLOCK###" />
-               </div>
-       </div>
-       <div class="t3-login-field" id="t3-login-openid_url-section" style="display: none">
-               <input type="text" id="openid_url" name="openid_url" value="###VALUE_OPENID_URL###" placeholder="###LABEL_OPENID###" class="t3-openidurl" />
-
-               <div class="t3-login-clearInputField">
-                       <a id="openid_url-clearIcon" style="display: none;">
-                               <img src="sysext/t3skin/icons/common-input-clear.png" alt="###CLEAR###" title="###CLEAR###" />
-                       </a>
-               </div>
-       </div>
-       <div class="t3-login-field clearfix">
-               <!-- ###INTERFACE_SELECTOR### begin -->
-               <div class="t3-login-interface" id="t3-login-interface-section">
-                       ###VALUE_INTERFACE###
-                       </div>
-               <!-- ###INTERFACE_SELECTOR### end -->
-
-               <div id="t3-login-openIdLogo" style="display: none">
-                       <img src="sysext/t3skin/icons/logo-openid.png" alt="OpenID" title="OpenID" />
-               </div>
-
-               <input type="submit" name="commandLI" id="t3-login-submit" value="###VALUE_SUBMIT###" class="t3-login-submit" />
-       </div>
-
-       <div class="t3-login-form-footer">
-               <div id="t3-login-form-footer-default">
-                       <a id="t3-login-switchToOpenId" class="switchToOpenId">###LABEL_SWITCHOPENID###</a>
-               </div>
-               <div id="t3-login-form-footer-openId" style="display: none">
-                       <a href="http://openid.net/" id="t3-login-whatIsOpenId" target="_blank" class="switchToOpenId">###LABEL_WHATISOPENID###</a>
-                       &#124;
-                       <a id="t3-login-switchToDefault" class="switchToOpenId">###LABEL_SWITCHDEFAULT###</a>
-               </div>
-       </div>
-</div>
-<!-- ###LOGIN_FORM### end -->
-
-<!-- ###LOGOUT_FORM### begin -->
-<div id="t3-login-form-fields">
-       <div class="t3-login-logout-form">
-               <div class="t3-login-username t3-login-field">
-                       <div class="t3-login-label t3-username">
-                               ###LABEL_USERNAME###
-                       </div>
-                       <div class="t3-username-current">
-                               ###VALUE_USERNAME###
-                       </div>
-               </div>
-               <!-- ###INTERFACE_SELECTOR### begin -->
-               <div class="t3-login-interface t3-login-field">
-                       <div class="t3-login-label t3-interface-selector">
-                               ###LABEL_INTERFACE###
-                       </div>
-                       ###VALUE_INTERFACE###
-                       <!-- ###INTERFACE_SELECTOR### end -->
-               </div>
-               <input type="hidden" name="p_field" value="" /><input type="submit" name="commandLO" value="###VALUE_SUBMIT###" class="t3-login-submit" />
-       </div>
-</div>
-<!-- ###LOGOUT_FORM### end -->
\ No newline at end of file
diff --git a/typo3/sysext/t3skin/Resources/Public/JavaScript/login.js b/typo3/sysext/t3skin/Resources/Public/JavaScript/login.js
deleted file mode 100644 (file)
index 4091e9e..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-var isWebKit = document.childNodes && !document.all && !navigator.taintEnabled;
-
-TYPO3BackendLogin = {
-
-       /**
-        *  Initializing the Login Interface
-        */
-       start: function() {
-               TYPO3BackendLogin.preloadImages();
-               TYPO3BackendLogin.registerEventListeners();
-               TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-username'), $('t3-username-clearIcon'));
-               TYPO3BackendLogin.setVisibilityOfClearIcon($('t3-password'), $('t3-password-clearIcon'));
-               TYPO3BackendLogin.checkCookieSupport();
-               TYPO3BackendLogin.checkForLogintypeCookie();
-               TYPO3BackendLogin.checkForInterfaceCookie();
-               $('t3-username').activate();
-       },
-
-       /**
-        * Preload the login process image, so it can show up immediatelly after submitting
-        */
-       preloadImages: function() {
-               var image = new Image();
-               image.src = 'sysext/t3skin/icons/login-submit-progress.gif';
-       },
-
-       /**
-        * Registers listeners for the Login Interface (e.g. to toggle OpenID and Default login)
-        */
-       registerEventListeners: function() {
-               Event.observe(
-                               $('t3-login-switchToOpenId'),
-                               'click',
-                               TYPO3BackendLogin.switchToOpenId
-                       );
-               Event.observe(
-                       $('t3-login-switchToDefault'),
-                       'click',
-                       TYPO3BackendLogin.switchToDefault
-               );
-               Event.observe(
-                       $('t3-login-submit'),
-                       'click',
-                       TYPO3BackendLogin.showLoginProcess
-               );
-
-                       // The Interface selector is not always present, so this check is needed
-               if (Object.isElement($('t3-interfaceselector'))) {
-                       TYPO3BackendLogin.observeEvents(
-                               $('t3-interfaceselector'),
-                               ['change', 'blur'],
-                               TYPO3BackendLogin.interfaceSelectorChanged
-                       );
-               }
-
-               $A(['t3-username', 't3-password', 'openid_url']).each(function(value) {
-                       Event.observe(
-                                       $(value + '-clearIcon'),
-                                       'click',
-                                       function() { TYPO3BackendLogin.clearInputField($(value)); }
-                       );
-                       TYPO3BackendLogin.observeEvents(
-                                       $(value),
-                                       ['focus', 'blur', 'keypress'],
-                                       function() { TYPO3BackendLogin.setVisibilityOfClearIcon($(value), $(value + '-clearIcon')); }
-                       );
-                       if (!isWebKit) {
-                               Event.observe(
-                                       $(value),
-                                       'keypress',
-                                       function(event) { TYPO3BackendLogin.showCapsLockWarning($(value + '-alert-capslock'), event); }
-                               );
-                       }
-               })
-       },
-
-       /**
-        * Wrapper for Event.observe that takes an array with events, instead of only one event
-        */
-       observeEvents: function(element, events, handler) {
-               events.each(function(event) {
-                       Event.observe(
-                               element,
-                               event,
-                               handler
-                       );
-               });
-       },
-
-       /**
-        * Shows up the clear icon for a field which is not empty, and hides it otherwise
-        */
-       setVisibilityOfClearIcon: function(formField, clearIcon) {
-               if (formField.value) {
-                       clearIcon.show();
-               } else {
-                       clearIcon.hide();
-               }
-       },
-
-       /**
-        * To prevent its unintented use when typing the password, the user is warned when Capslock is on
-        */
-       showCapsLockWarning: function(alertIcon, event) {
-               if (isCapslock(event)) {
-                       alertIcon.show();
-               } else {
-                       alertIcon.hide();
-               }
-       },
-
-       /**
-        * Clears an input field and sets focus to it
-        */
-       clearInputField: function(formField) {
-               formField.value = '';
-               formField.focus();
-       },
-
-       /**
-        * Change to Interface for OpenId login and save the selection to a cookie
-        */
-       switchToOpenId: function() {
-               $('t3-login-openIdLogo').show();
-
-               $('t3-login-form-footer-default').hide();
-               $('t3-login-form-footer-openId').show();
-               $('t3-login-username-section').hide();
-               $('t3-login-password-section').hide();
-               $('t3-login-openid_url-section').show();
-
-               if ($('t3-login-interface-section')) {
-                       $('t3-login-interface-section').hide();
-               }
-
-               $('openid_url').activate();
-               if ($('t3-username').getValue() == '') {
-                       $('t3-username').setValue('openid_url');
-               }
-
-               TYPO3BackendLogin.setLogintypeCookie('openid');
-       },
-
-       /**
-        * Change to Interface for default login and save the selection to a cookie
-        */
-       switchToDefault: function() {
-               $('t3-login-openIdLogo').hide();
-
-               if ($('t3-username').getValue() == 'openid_url') {
-                       $('t3-username').setValue('');
-               }
-
-               $('t3-login-form-footer-default').show();
-               $('t3-login-form-footer-openId').hide();
-               $('t3-login-username-section').show();
-               $('t3-login-password-section').show();
-               $('t3-login-openid_url-section').hide();
-
-               if ($('t3-login-interface-section')) {
-                       $('t3-login-interface-section').show();
-               }
-
-               $('t3-username').activate();
-
-               TYPO3BackendLogin.setLogintypeCookie('username');
-       },
-
-       /**
-        * Checks browser's cookie support
-        */
-       checkCookieSupport: function() {
-               Ext.util.Cookies.set('typo3-login-cookiecheck', true);
-               cookieEnabled = Ext.util.Cookies.get('typo3-login-cookiecheck');
-
-               if (!cookieEnabled) {
-                       TYPO3BackendLogin.showCookieWarning()
-               }
-
-               Ext.util.Cookies.set('typo3-login-cookiecheck', '', new Date(0));
-       },
-
-       /**
-        * Hides input fields and shows cookie warning
-        */
-       showCookieWarning: function() {
-               Ext.get('t3-login-form-fields').setVisibilityMode(Ext.Element.DISPLAY).hide();
-               Ext.get('t3-nocookies-error').show();
-       },
-
-       /**
-        * Hides cookie warning and shows input fields
-        */
-       hideCookieWarning: function() {
-               Ext.get('t3-nocookies-error').setVisibilityMode(Ext.Element.DISPLAY).hide();
-               Ext.get('t3-login-form-fields').show();
-       },
-
-       /**
-        * Store a login type in a cookie to save it for future visits
-        * Login type means whether you login by username/password or OpenID
-        */
-       setLogintypeCookie: function(type) {
-               var now = new Date();
-               var expires = new Date(now.getTime() + 1000*60*60*24*365); // cookie expires in one year
-               document.cookie = 'typo3-login-method=' + type + '; expires=' + expires.toGMTString() + ';';
-       },
-
-       /**
-        * Check if a login type was stored in a cookie and change the Interface accordingly
-        */
-       checkForLogintypeCookie: function() {
-               if(document.cookie.indexOf('typo3-login-method=openid') >- 1) {
-                       TYPO3BackendLogin.switchToOpenId();
-               }
-       },
-
-       /**
-        * Store the new selected Interface in a cookie to save it for future visits
-        */
-       interfaceSelectorChanged: function(event) {
-               var now = new Date();
-               var expires = new Date(now.getTime() + 1000*60*60*24*365); // cookie expires in one year
-               document.cookie = 'typo3-login-interface=' + $('t3-interfaceselector').getValue() + '; expires=' + expires.toGMTString() + ';';
-       },
-
-       /**
-        * Check if an interface was stored in a cookie and preselect it in the select box
-        */
-       checkForInterfaceCookie: function() {
-               if (Object.isElement($('t3-interfaceselector'))) {
-                       var posStart = document.cookie.indexOf('typo3-login-interface=');
-                       if (posStart != -1) {
-                               var selectedInterface = document.cookie.substr(posStart + 22);
-                               selectedInterface = selectedInterface.substr(0, selectedInterface.indexOf(';'));
-                       }
-                       $('t3-interfaceselector').setValue(selectedInterface);
-               }
-       },
-
-       /**
-        * Hide all form fields and show a progress message and icon
-        */
-       showLoginProcess: function() {
-               if ($('t3-login-error')) {
-                       $('t3-login-error').hide();
-               }
-
-               $('t3-login-form-fields').hide();
-               $('t3-nocookies-error').hide();
-
-               // setting a fixed height (based on the current, calculated height of the browser) for
-               // the box with the login form, so it doesn't jump around when the spinner is shown
-               var loginBoxHeight = $('t3-login-form-fields').getHeight();
-               $('t3-login-process').setStyle({height: loginBoxHeight + 'px'}).show();
-       }
-};
-
-Ext.onReady(TYPO3BackendLogin.start, TYPO3BackendLogin);
index c4575bc..f19529f 100644 (file)
@@ -388,8 +388,6 @@ if (TYPO3_MODE === 'BE' || TYPO3_MODE === 'FE' && isset($GLOBALS['BE_USER'])) {
        $TBE_STYLES['logo_login'] = $temp_eP . 'images/login/typo3logo-white-greyback.gif';
        // extJS theme
        $TBE_STYLES['extJS']['theme'] = $temp_eP . 'extjs/xtheme-t3skin.css';
-       // Adding HTML template for login screen
-       $TBE_STYLES['htmlTemplates']['EXT:backend/Resources/Private/Templates/login.html'] = 'sysext/t3skin/Resources/Private/Templates/login.html';
        $GLOBALS['TBE_STYLES']['stylesheets']['admPanel'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('t3skin') . 'stylesheets/standalone/admin_panel.css';
        $flagIcons = array();
        foreach ($flagNames as $flagName) {