[TASK] Base backend login on Twitter Bootstrap
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Controller / LoginController.php
index 6f7616b..240afd2 100644 (file)
@@ -133,10 +133,7 @@ class LoginController {
                // Do a logout if the command is set
                if ($this->L == 'OUT' && is_object($GLOBALS['BE_USER'])) {
                        $GLOBALS['BE_USER']->logoff();
-                       if ($this->redirect_url) {
-                               HttpUtility::redirect($this->redirect_url);
-                       }
-                       die;
+                       HttpUtility::redirect($this->redirect_url);
                }
        }
 
@@ -151,6 +148,7 @@ class LoginController {
                /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
                $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
                $pageRenderer->loadJquery();
+
                // support placeholders for IE9 and lower
                $clientInfo = GeneralUtility::clientInfo();
                if ($clientInfo['BROWSER'] == 'msie' && $clientInfo['VERSION'] <= 9) {
@@ -269,10 +267,11 @@ class LoginController {
         */
        public function wrapLoginForm($content) {
                $mainContent = HtmlParser::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###PAGE###');
+
                if ($GLOBALS['TBE_STYLES']['logo_login']) {
                        $logo = '<img src="' . htmlspecialchars(($GLOBALS['BACK_PATH'] . $GLOBALS['TBE_STYLES']['logo_login'])) . '" alt="" class="t3-login-logo" />';
                } else {
-                       $logo = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/typo3logo.gif', 'width="123" height="34"') . ' alt="" class="t3-login-logo" />';
+                       $logo = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/typo3-transparent@2x.png', 'width="140" height="39"') . ' alt="" class="t3-login-logo t3-default-logo" />';
                }
 
                $additionalCssClasses = array();
@@ -348,8 +347,6 @@ class LoginController {
                        // Based on specific setting of interface we set the redirect script:
                        switch ($this->GPinterface) {
                                case 'backend':
-
-                               case 'backend_old':
                                        $this->redirectToURL = 'backend.php';
                                        break;
                                case 'frontend':
@@ -398,14 +395,14 @@ class LoginController {
                        // Only if more than one interface is defined will we show the selector:
                        if (count($parts) > 1) {
                                // Initialize:
-                               $labels = array();
-                               $labels['backend'] = $GLOBALS['LANG']->getLL('interface.backend');
-                               $labels['backend_old'] = $GLOBALS['LANG']->getLL('interface.backend_old');
-                               $labels['frontend'] = $GLOBALS['LANG']->getLL('interface.frontend');
-                               $jumpScript = array();
-                               $jumpScript['backend'] = 'backend.php';
-                               $jumpScript['backend_old'] = 'backend.php';
-                               $jumpScript['frontend'] = '../';
+                               $labels = array(
+                                       'backend' => $GLOBALS['LANG']->getLL('interface.backend'),
+                                       'frontend' => $GLOBALS['LANG']->getLL('interface.frontend')
+                               );
+                               $jumpScript = array(
+                                       'backend' => 'backend.php',
+                                       'frontend' => '../'
+                               );
                                // Traverse the interface keys:
                                foreach ($parts as $valueStr) {
                                        $this->interfaceSelector .= '
@@ -414,10 +411,10 @@ class LoginController {
                                                        <option value="' . htmlspecialchars($jumpScript[$valueStr]) . '">' . htmlspecialchars($labels[$valueStr]) . '</option>';
                                }
                                $this->interfaceSelector = '
-                                               <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3">' . $this->interfaceSelector . '
+                                               <select id="t3-interfaceselector" name="interface" class="form-control t3-interfaces input-lg" tabindex="3">' . $this->interfaceSelector . '
                                                </select>';
                                $this->interfaceSelector_jump = '
-                                               <select id="t3-interfaceselector" name="interface" class="c-interfaceselector" tabindex="3" onchange="window.location.href=this.options[this.selectedIndex].value;">' . $this->interfaceSelector_jump . '
+                                               <select id="t3-interfaceselector" name="interface" class="form-control t3-interfaces input-lg" tabindex="3" onchange="window.location.href=this.options[this.selectedIndex].value;">' . $this->interfaceSelector_jump . '
                                                </select>';
                        } elseif (!$this->redirect_url) {
                                // If there is only ONE interface value set and no redirect_url is present:
@@ -460,9 +457,9 @@ class LoginController {
                        $count = 1;
                        foreach ($systemNews as $newsItemData) {
                                $additionalClass = '';
-                               if ($count == 1) {
+                               if ($count === 1) {
                                        $additionalClass = ' first-item';
-                               } elseif ($count == count($systemNews)) {
+                               } elseif ($count === count($systemNews)) {
                                        $additionalClass = ' last-item';
                                }
                                $newsItemContent = $htmlParser->TS_transform_rte($htmlParser->TS_links_rte($newsItemData['content']));
@@ -511,7 +508,7 @@ class LoginController {
                $output = '';
                // The form defaults to 'no login'. This prevents plain
                // text logins to the Backend. The 'sv' extension changes the form to
-               // use superchallenged method and rsaauth extension makes rsa authetication.
+               // use superchallenged method and rsaauth extension makes rsa authentication.
                $form = '<form action="index.php" method="post" name="loginform" ' . 'onsubmit="alert(\'No authentication methods available. Please, contact your TYPO3 administrator.\');return false">';
                // Call hooks. If they do not return anything, we fail to login
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'])) {
@@ -524,7 +521,11 @@ class LoginController {
                                }
                        }
                }
-               $output .= $form . '<input type="hidden" name="login_status" value="login" />' . '<input type="hidden" id="t3-field-userident" name="userident" value="" />' . '<input type="hidden" name="redirect_url" value="' . htmlspecialchars($this->redirectToURL) . '" />' . '<input type="hidden" name="loginRefresh" value="' . htmlspecialchars($this->loginRefresh) . '" />' . $this->interfaceSelector_hidden . $this->addFields_hidden;
+               $output .= $form . '<input type="hidden" name="login_status" value="login" />' .
+                       '<input type="hidden" id="t3-field-userident" name="userident" value="" />' .
+                       '<input type="hidden" name="redirect_url" value="' . htmlspecialchars($this->redirectToURL) . '" />' .
+                       '<input type="hidden" name="loginRefresh" value="' . htmlspecialchars($this->loginRefresh) . '" />' .
+                       $this->interfaceSelector_hidden . $this->addFields_hidden;
                return $output;
        }