Fixed bug #14097: Preview in BE opens Workspace-preview
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tsfebeuserauth.php
index 53aabc2..30e6329 100644 (file)
@@ -190,8 +190,6 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
                if (isset($this->extAdminConfig['enable.'])) {
                        foreach($this->extAdminConfig['enable.'] as $key => $value) {
                                if ($value) {
-                                       $GLOBALS['TSFE']->includeTCA();
-
                                        $this->adminPanel = t3lib_div::makeInstance('tslib_AdminPanel');
                                        $this->extAdmEnabled = true;
 
@@ -247,7 +245,7 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
         * @return      string.
         */
        public function displayAdminPanel() {
-               $content =  $this->adminPanel->display();
+               $content = $this->adminPanel->display();
 
                return $content;
        }
@@ -304,7 +302,7 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
                }
 
                        // Finally a check from t3lib_beuserauth::backendCheckLogin()
-               if (!$TYPO3_CONF_VARS['BE']['adminOnly'] || $this->isAdmin()) {
+               if ($this->isUserAllowedToLogin()) {
                        return true;
                } else {
                        return false;
@@ -373,10 +371,15 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
         * @return      integer         The number of pages for this page in the table "cache_pages"
         */
        public function extGetNumberOfCachedPages($pageId) {
-               $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
-               $pageCacheEntries = $pageCache->getByTag('pageId_' . (int) $pageId);
-
-               return count($pageCacheEntries);
+               if (TYPO3_UseCachingFramework) {
+                       $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
+                       $pageCacheEntries = $pageCache->getByTag('pageId_' . (int) $pageId);
+                       $count = count($pageCacheEntries);
+               } else {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pages', 'page_id='.intval($pageId));
+                       list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+               }
+               return $count;
        }