Fixed bug #3666: permissions of versioned pages are not changed in draft workspace...
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Tue, 27 Feb 2007 13:30:35 +0000 (13:30 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Tue, 27 Feb 2007 13:30:35 +0000 (13:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-0@2156 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_treeview.php
typo3/mod/web/perm/index.php

index 350100e..1ec4466 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+
+2007-02-27  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Fixed bug #3666: permissions of versioned pages are not changed in draft workspace (patch by Andreas Wolf)
+
 2007-02-21  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Release of TYPO3 4.0.5
index 6acd2b3..95bee6c 100755 (executable)
@@ -238,6 +238,7 @@ class t3lib_treeView {
                // For record trees:
        var $ids = Array();                             // one-dim array of the uid's selected.
        var $ids_hierarchy = array();   // The hierarchy of element uids
+       var $orig_ids_hierarchy = array();      // The hierarchy of versioned element uids
        var $buffer_idH = array();              // Temporary, internal array
 
                // For FOLDER trees:
@@ -322,7 +323,7 @@ class t3lib_treeView {
 
 
        /**
-        * Resets the tree, recs, ids, and ids_hierarchy internal variables. Use it if you need it.
+        * Resets the tree, recs, ids, ids_hierarchy and orig_ids_hierarchy internal variables. Use it if you need it.
         *
         * @return      void
         */
@@ -331,6 +332,7 @@ class t3lib_treeView {
                $this->recs = array();
                $this->ids = array();
                $this->ids_hierarchy = array();
+               $this->orig_ids_hierarchy = array();
        }
 
 
@@ -741,7 +743,6 @@ class t3lib_treeView {
                        // Buffer for id hierarchy is reset:
                $this->buffer_idH=array();
 
-
                        // Init vars
                $depth=intval($depth);
                $HTML='';
@@ -774,8 +775,9 @@ class t3lib_treeView {
                        }
 
                                // Accumulate the id of the element in the internal arrays
-                       $this->ids[]=$idH[$row['uid']]['uid'] = $row['uid'];
+                       $this->ids[] = $idH[$row['uid']]['uid'] = $row['uid'];
                        $this->ids_hierarchy[$depth][] = $row['uid'];
+                       $this->orig_ids_hierarchy[$depth][] = $row['_ORIG_uid'] ? $row['_ORIG_uid'] : $row['uid'];
 
                                // Make a recursive call to the next level
                        $HTML_depthData = $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' alt="" />';
index 2ac1047..ca5a24e 100755 (executable)
@@ -703,7 +703,7 @@ class SC_mod_web_perm_index {
                $tree->getTree($id,$this->getLevels,'');
 
                        // If there are a hierarchy of page ids, then...
-               if ($GLOBALS['BE_USER']->user['uid'] && count($tree->ids_hierarchy))    {
+               if ($GLOBALS['BE_USER']->user['uid'] && count($tree->orig_ids_hierarchy))       {
 
                                // Init:
                        $label_recur = $GLOBALS['LANG']->getLL('recursive');
@@ -715,8 +715,8 @@ class SC_mod_web_perm_index {
 
                                // Traverse the number of levels we want to allow recursive setting of permissions for:
                        for ($a=$this->getLevels;$a>0;$a--)     {
-                               if (is_array($tree->ids_hierarchy[$a])) {
-                                       foreach($tree->ids_hierarchy[$a] as $theId)     {
+                               if (is_array($tree->orig_ids_hierarchy[$a]))    {
+                                       foreach($tree->orig_ids_hierarchy[$a] as $theId)        {
                                                if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->user['uid']==$tree->recs[$theId]['perms_userid'])    {
                                                        $theIdListArr[]=$theId;
                                                }