[TASK] Cleanup draft workspace usages
authorTolleiv Nietsch <info@tolleiv.de>
Wed, 6 Jul 2011 21:53:08 +0000 (23:53 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Fri, 8 Jul 2011 12:27:47 +0000 (14:27 +0200)
The draft workspace is deprecated since 4.4, this patch
makes sure nobody is able to continue using it and
cleans up the related codes.

Change-Id: I9f3a51a822e3af5a80a6fede24ed5f94bd7fbee4
Resolves: #27947
Releases: 4.6
Reviewed-on: http://review.typo3.org/3105
Reviewed-by: Benjamin Mack
Reviewed-by: Oliver Klee
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/class.t3lib_bedisplaylog.php
t3lib/class.t3lib_userauthgroup.php
t3lib/stddb/tbl_be.php
typo3/sysext/belog/mod/index.php [changed mode: 0755->0644]
typo3/sysext/beuser/mod/index.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index f9502bb..fefa244 100644 (file)
@@ -58,7 +58,6 @@ class t3lib_BEDisplayLog {
        );
        var $wsArray = array(
                0 => 'LIVE',
-               -1 => 'Draft',
        );
 
        var $be_user_Array = array(); // Username array (set externally)
@@ -254,4 +253,4 @@ class t3lib_BEDisplayLog {
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_bedisplaylog.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_bedisplaylog.php']);
 }
-?>
\ No newline at end of file
+?>
index a862275..ab60051 100644 (file)
@@ -854,10 +854,9 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         * Returns TRUE if the user has access to publish content from the workspace ID given.
         * Admin-users are always granted access to do this
         * If the workspace ID is 0 (live) all users have access also
-        * If -1 (draft workspace) TRUE is returned if the user has access to the Live workspace
         * For custom workspaces it depends on whether the user is owner OR like with draft workspace if the user has access to Live workspace.
         *
-        * @param       integer         Workspace UID; -1,0,1+
+        * @param       integer         Workspace UID; 0,1+
         * @return      boolean         Returns TRUE if the user has access to publish content from the workspace ID given.
         */
        function workspacePublishAccess($wsid) {
@@ -874,9 +873,6 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                                case 0: // Live workspace
                                        $retVal = TRUE; // If access to Live workspace, no problem.
                                break;
-                               case -1: // Default draft workspace
-                                       $retVal = $this->checkWorkspace(0) ? TRUE : FALSE; // If access to Live workspace, no problem.
-                               break;
                                default: // Custom workspace
                                        $retVal = $wsAccess['_ACCESS'] === 'owner' || ($this->checkWorkspace(0) && !($wsAccess['publish_access'] & 2)); // Either be an adminuser OR have access to online workspace which is OK as well as long as publishing access is not limited by workspace option.
                                break;
@@ -1549,27 +1545,10 @@ abstract 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) {
                                case '0':
-                               case '-1':
                                        $wsRec = array('uid' => $wsRec);
                                break;
                                default:
@@ -1597,9 +1576,6 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                                        case '0':
                                                $retVal = ($this->groupData['workspace_perms'] & 1) ? array_merge($wsRec, array('_ACCESS' => 'online')) : FALSE;
                                        break;
-                                       case '-1':
-                                               $retVal = ($this->groupData['workspace_perms'] & 2) ? array_merge($wsRec, array('_ACCESS' => 'offline')) : FALSE;
-                                       break;
                                        default:
                                                        // Checking if the guy is admin:
                                                if (t3lib_div::inList($wsRec['adminusers'], 'be_users_' . $this->user['uid'])) {
index cdb8d94..b84ca0d 100644 (file)
@@ -247,9 +247,8 @@ $TCA['be_users'] = array(
                                'type' => 'check',
                                'items' => array(
                                        array('LLL:EXT:lang/locallang_tca.xml:workspace_perms_live', 0),
-                                       array('LLL:EXT:lang/locallang_tca.xml:workspace_perms_draft', 0),
                                ),
-                               'default' => 3
+                               'default' => 1
                        )
                ),
                'starttime' => array(
@@ -508,7 +507,6 @@ $TCA['be_groups'] = array(
                                'type' => 'check',
                                'items' => array(
                                        array('LLL:EXT:lang/locallang_tca.xml:workspace_perms_live', 0),
-                                       array('LLL:EXT:lang/locallang_tca.xml:workspace_perms_draft', 0),
                                ),
                                'default' => 0
                        )
old mode 100755 (executable)
new mode 100644 (file)
index dd102cf..0a651cc
@@ -141,7 +141,6 @@ class SC_mod_tools_log_index {
                        'workspaces' => array(
                                '-99' => $GLOBALS['LANG']->getLL('any'),
                                0 => $GLOBALS['LANG']->getLL('live'),
-                               '-1' => $GLOBALS['LANG']->getLL('draft'),
                        ),
                        'time' => array(
                                0 => $GLOBALS['LANG']->getLL('thisWeek'),
index 29f2fb6..2bf3749 100755 (executable)
@@ -979,9 +979,6 @@ class local_beUserAuth extends t3lib_beUserAuth {
                if ($this->checkWorkspace(array('uid' => 0)))   {
                        $options[0] = '0: ' . $GLOBALS['LANG']->getLL('live', TRUE);
                }
-               if ($this->checkWorkspace(array('uid' => -1)))  {
-                       $options[-1] = '-1: ' . $GLOBALS['LANG']->getLL('defaultDraft', TRUE);
-               }
 
                        // Add custom workspaces (selecting all, filtering by BE_USER check):
                if (t3lib_extMgm::isLoaded('workspaces')) {
@@ -1571,4 +1568,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>
index 5a1830f..3070f4d 100644 (file)
@@ -4244,9 +4244,7 @@ if (version == "n3") {
                } else return FALSE;
 
                if ($returnTitle)       {
-                       if ($ws===-1)   {
-                               return 'Default Draft Workspace';
-                       } elseif (t3lib_extMgm::isLoaded('workspaces')) {
+                       if (t3lib_extMgm::isLoaded('workspaces')) {
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title', 'sys_workspace', 'uid='.intval($ws));
                                if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        return $row['title'];