Added feature #8778: Add possibility to disable TYPO3 draft workspace by localconf...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_userauthgroup.php
index 7396e7e..0e18e63 100644 (file)
@@ -1562,7 +1562,23 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         */
        function checkWorkspace($wsRec,$fields='uid,title,adminusers,members,reviewers,publish_access,stagechg_notification')   {
                $retVal = FALSE;
-
+               
+                       // Show draft workspace only if it's enabled in version extension
+               if (t3lib_extMgm::isLoaded('version')) {
+                       $versionExtConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
+                       if (!$versionExtConf['showDraftWorkspace']) {
+                               if (!is_array($wsRec)) {
+                                       if ((string) $wsRec === '-1') {
+                                               return FALSE;
+                                       } 
+                               } else {
+                                       if ((string) $wsRec['uid'] === '-1') {
+                                               return FALSE;
+                                       } 
+                               }
+                       } 
+               } 
+               
                        // If not array, look up workspace record:
                if (!is_array($wsRec))  {
                        switch((string)$wsRec)  {