[TASK] Move FEworkspace code into versioning / part 2
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_fe.php
index 70cd66f..3e6bd5b 100644 (file)
@@ -83,7 +83,7 @@
        var $loginUser='';                                      // Global flag indicating that a front-end user is logged in. This is set only if a user really IS logged in. The group-list may show other groups (like added by IP filter or so) even though there is no user.
        var $gr_list='';                                        // (RO=readonly) The group list, sorted numerically. Group '0,-1' is the default group, but other groups may be added by other means than a user being logged in though...
        var $beUserLogin='';                            // Flag that indicates if a Backend user is logged in!
-       var $workspacePreview='';                       // Integer, that indicates which workspace is being previewed.
+       var $workspacePreview = 0;                      // Integer, that indicates which workspace is being previewed.
        var $loginAllowedInBranch = TRUE;       // Shows whether logins are allowed in branch
        var $loginAllowedInBranch_mode = '';    // Shows specific mode (all or groups)
        var $ADMCMD_preview_BEUSER_uid = 0;     // Integer, set to backend user ID to initialize when keyword-based preview is used.
                        $GLOBALS['TT']->pull();
                        $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'] = microtime(TRUE);
 
-               } elseif ($this->ADMCMD_preview_BEUSER_uid) {
-                               // TODO: validate the comment below: is this necessary? if so,
-                               // formfield_status should be set to "" in t3lib_tsfeBeUserAuth
-                               // which is a subclass of t3lib_beUserAuth
-                               // ----
-                               // the value this->formfield_status is set to empty in order to
-                               // disable login-attempts to the backend account through this script
-
-                               // New backend user object
-                       $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth');
-                       $BE_USER->userTS_dontGetCached = 1;
-                       $BE_USER->OS = TYPO3_OS;
-                       $BE_USER->setBeUserByUid($this->ADMCMD_preview_BEUSER_uid);
-                       $BE_USER->unpack_uc('');
-                       if ($BE_USER->user['uid']) {
-                               $BE_USER->fetchGroupData();
-                               $this->beUserLogin = 1;
-                       } else {
-                               $BE_USER = NULL;
-                               $this->beUserLogin = 0;
-                               $_SESSION['TYPO3-TT-start'] = FALSE;
-                       }
                }
 
                // *****************
@@ -4334,12 +4312,19 @@ if (version == "n3") {
                }
        }
 
+
+       /********************************************
+        * PUBLIC ACCESSIBLE WORKSPACES FUNCTIONS
+        *******************************************/
+
        /**
         * Initialize workspace preview
         *
         * @return      void
+        * @deprecated since TYPO3 4.7, will be removed in TYPO3 4.9 as this is part of Tx_Version now
         */
-       function workspacePreviewInit() {
+       public function workspacePreviewInit()  {
+               t3lib_div::logDeprecatedFunction();
                $previewWS = t3lib_div::_GP('ADMCMD_previewWS');
                if ($this->beUserLogin && is_object($GLOBALS['BE_USER']) && t3lib_utility_Math::canBeInterpretedAsInteger($previewWS))  {
                        if ($previewWS==0 || ($previewWS>=-1 && $GLOBALS['BE_USER']->checkWorkspace($previewWS))) {     // Check Access to workspace. Live (0) is OK to preview for all.
@@ -4355,8 +4340,8 @@ if (version == "n3") {
         *
         * @return      boolean         Returns TRUE if workspace preview is enabled
         */
-       function doWorkspacePreview()   {
-               return (string)$this->workspacePreview!=='';
+       public function doWorkspacePreview() {
+               return ($this->workspacePreview !== 0 ? TRUE : FALSE);
        }
 
        /**