Merged changes from Nicole's github-version for Typo3 6.2
authorjbartels <jbartels@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 31 Jul 2014 18:45:40 +0000 (18:45 +0000)
committerjbartels <jbartels@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 31 Jul 2014 18:45:40 +0000 (18:45 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/be_acl/trunk@86088 735d13b6-9817-0410-8766-e36946ffe9aa

15 files changed:
Classes/Xclass/PermissionModuleController.php [new file with mode: 0644]
class.tx_beacl_hooks.php [new file with mode: 0644]
class.tx_beacl_objsel.php [new file with mode: 0644]
ext_autoload.php
ext_conf_template.txt
ext_emconf.php
ext_localconf.php
ext_tables.php
ext_tables.sql
locallang_db.php
res/acl.js
res/class.tx_beacl_userauthgroup.php
res/class.ux_sc_mod_web_perm_index.php
res/locallang_perm.php
tca.php

diff --git a/Classes/Xclass/PermissionModuleController.php b/Classes/Xclass/PermissionModuleController.php
new file mode 100644 (file)
index 0000000..72c7c5d
--- /dev/null
@@ -0,0 +1,776 @@
+<?php
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 Sebastian Kurfuerst (sebastian@garbage-group.de)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Backend ACL - Replacement for "web->Access"
+ *
+ * @author  Sebastian Kurfuerst <sebastian@garbage-group.de>
+ *
+ * Bugfixes applied:
+ * #25942, #25835, #13019, #13176, #13175 Jan Bartels
+ */
+class Tx_BeAcl_Xclass_PermissionModuleController extends SC_mod_web_perm_index {
+
+       /*****************************
+        *
+        * Listing and Form rendering
+        *
+        *****************************/
+
+       /**
+        * Showing the permissions in a tree ($this->edit = false)
+        * (Adding content to internal content variable)
+        *
+        * @return    void
+        */
+       public function notEdit() {
+               // Get ACL configuration
+               $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
+               $disableOldPermissionSystem = 0;
+               if ($beAclConfig['disableOldPermissionSystem']) {
+                       $disableOldPermissionSystem = 1;
+               }
+               $GLOBALS['LANG']->includeLLFile('EXT:be_acl/res/locallang_perm.php');
+
+               // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
+               $beGroupKeys = $GLOBALS['BE_USER']->userGroupsUID;
+               $beUserArray = BackendUtility::getUserNames();
+               if (!$GLOBALS['BE_USER']->isAdmin()) {
+                       $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 0);
+               }
+               $beGroupArray = BackendUtility::getGroupNames();
+               if (!$GLOBALS['BE_USER']->isAdmin()) {
+                       $beGroupArray = BackendUtility::blindGroupNames($beGroupArray, $beGroupKeys, 0);
+               }
+
+               // Length of strings:
+               $tLen = 20;
+
+               // Selector for depth:
+               $code = $GLOBALS['LANG']->getLL('Depth') . ': ';
+               $code .= BackendUtility::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
+               $this->content .= $this->doc->section('', $code);
+
+               /** @var \TYPO3\CMS\Backend\Tree\View\PageTreeView */
+               $tree = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
+               $tree->init('AND ' . $this->perms_clause);
+               $tree->addField('perms_user', 1);
+               $tree->addField('perms_group', 1);
+               $tree->addField('perms_everybody', 1);
+               $tree->addField('perms_userid', 1);
+               $tree->addField('perms_groupid', 1);
+               $tree->addField('hidden');
+               $tree->addField('fe_group');
+               $tree->addField('starttime');
+               $tree->addField('endtime');
+               $tree->addField('editlock');
+
+               // Creating top icon; the current page
+               $HTML = IconUtility::getSpriteIconForRecord('pages', $this->pageinfo);
+               $tree->tree[] = array(
+                       'row' => $this->pageinfo,
+                       'HTML' => $HTML
+               );
+
+               // Create the tree from $this->id:
+               $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
+
+               // Get list of ACL users and groups, and initialize ACLs
+               $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig);
+               $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig);
+
+               $this->buildACLtree($aclUsers, $aclGroups);
+
+               $this->content .= $displayUserSelector;
+               $this->content .= $displayGroupSelector;
+
+               // Make header of table:
+               $code = '
+                       <thead>
+                               <tr>
+                                       <th colspan="2">&nbsp;</th>
+                                       <th>' . $GLOBALS['LANG']->getLL('Owner', TRUE) . '</th>';
+               $tableCells = array();
+               if (!$disableOldPermissionSystem) {
+                       $tableCells[] = $GLOBALS['LANG']->getLL('Group', TRUE);
+                       $tableCells[] = $GLOBALS['LANG']->getLL('Everybody', TRUE);
+                       $tableCells[] = $GLOBALS['LANG']->getLL('EditLock', TRUE);
+               }
+               // ACL headers
+               if (!empty($aclUsers)) {
+                       $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclUser') . '</b>';
+                       foreach ($aclUsers as $uid) {
+                               $tableCells[] = $beUserArray[$uid]['username'];
+                       }
+               }
+               if (!empty($aclGroups)) {
+                       $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclGroup') . '</b>';
+                       foreach ($aclGroups as $uid) {
+                               $tableCells[] = $beGroupArray[$uid]['title'];
+                       }
+               }
+               $code .= $this->printTableHeader($tableCells);
+               $code .= '
+                               </tr>
+                       </thead>';
+
+               // Traverse tree:
+               foreach ($tree->tree as $data) {
+                       $cells = array();
+                       $pageId = $data['row']['uid'];
+
+                       // Background colors:
+                       $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : '';
+                       $lE_bgCol = $bgCol;
+
+                       // User/Group names:
+                       $userName = $beUserArray[$data['row']['perms_userid']] ?
+                               $beUserArray[$data['row']['perms_userid']]['username'] :
+                               ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');
+
+                       if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) {
+                               $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)), FALSE);
+                       } else {
+                               $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)));
+                       }
+
+                       $groupName = $beGroupArray[$data['row']['perms_groupid']] ?
+                               $beGroupArray[$data['row']['perms_groupid']]['title'] :
+                               ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '');
+
+                       if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) {
+                               $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)), FALSE);
+                       } else {
+                               $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)));
+                       }
+
+                       // Seeing if editing of permissions are allowed for that page:
+                       $editPermsAllowed = $data['row']['perms_userid'] == $GLOBALS['BE_USER']->user['uid'] || $GLOBALS['BE_USER']->isAdmin();
+
+                       // First column:
+                       $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '';
+                       $cells[] = '<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) .
+                               $this->generateTitleAttribute($data['row']['uid'], $beUserArray, $beGroupArray) . '>' .
+                               $data['HTML'] . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $tLen)) . '</td>';
+
+                       // "Edit permissions" -icon
+                       if ($editPermsAllowed && $pageId) {
+                               $aHref = BackendUtility::getModuleUrl('web_perm') . '&mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1';
+                               $cells[] = '<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $GLOBALS['LANG']->getLL('ch_permissions', TRUE) . '">' .
+                                       IconUtility::getSpriteIcon('actions-document-open') . '</a></td>';
+                       } else {
+                               $cells[] = '<td' . $bgCol . '></td>';
+                       }
+
+                       if (!$disableOldPermissionSystem) {
+                               $cells[] = '
+                               <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_user'], $pageId, 'user') . ' ' . $userName : '') . '</td>
+                               <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_group'], $pageId, 'group') . ' ' . $groupName : '') . '</td>
+                               <td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? ' ' . SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '') . '</td>
+                               <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $GLOBALS['LANG']->getLL('EditLock_descr', TRUE) . '">' . IconUtility::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>')) . '</td>
+                       ';
+                       }
+
+                       // ACL rows
+                       if (!empty($aclUsers)) {
+                               $cells[] = '<td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][0]) . '</td>';
+                               foreach ($aclUsers as $uid) {
+                                       $tmpBg = $bgCol;
+                                       if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl'])) {
+                                               if ($this->aclList[$data['row']['uid']][0][$uid]['recursive']) {
+                                                       $tmpBg = ' class="bgColor5"';
+                                               } else {
+                                                       $tmpBg = ' class="bgColor6"';
+                                               }
+                                       }
+
+                                       $cells[] = '<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']) : '') . '</td>';
+                               }
+                       }
+                       if (!empty($aclGroups)) {
+                               $cells[] = '<td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][1]) . '</td>';
+                               foreach ($aclGroups as $uid) {
+                                       $tmpBg = $bgCol;
+                                       if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl'])) {
+                                               if ($this->aclList[$data['row']['uid']][1][$uid]['recursive']) {
+                                                       $tmpBg = ' class="bgColor5"';
+                                               } else {
+                                                       $tmpBg = ' class="bgColor6"';
+                                               }
+                                       }
+                                       $cells[] = '<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']) : '') . '</td>';
+                               }
+                       }
+
+                       // Compile table row:
+                       $code .= '<tr>' . implode('', $cells) . '</tr>';
+               }
+
+               // Wrap rows in table tags:
+               $code = '<table class="t3-table" id="typo3-permissionList">' . $code . '</table>';
+
+               // Adding the content as a section:
+               $this->content .= $this->doc->section('', $code);
+
+               // CSH for permissions setting
+               $this->content .= BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br />|');
+
+               // Creating legend table:
+               $legendText = '<strong>' . $GLOBALS['LANG']->getLL('1', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('1_t', TRUE);
+               $legendText .= '<br /><strong>' . $GLOBALS['LANG']->getLL('16', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('16_t', TRUE);
+               $legendText .= '<br /><strong>' . $GLOBALS['LANG']->getLL('2', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('2_t', TRUE);
+               $legendText .= '<br /><strong>' . $GLOBALS['LANG']->getLL('4', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('4_t', TRUE);
+               $legendText .= '<br /><strong>' . $GLOBALS['LANG']->getLL('8', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('8_t', TRUE);
+
+               $code = '<div id="permission-information">
+                                       <img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />
+                               <div class="text">' . $legendText . '</div></div>';
+
+               $code .= '<div id="perm-legend">' . $GLOBALS['LANG']->getLL('def', TRUE);
+               $code .= '<br /><br />' . IconUtility::getSpriteIcon('status-status-permission-granted') . ': ' . $GLOBALS['LANG']->getLL('A_Granted', TRUE);
+               $code .= '<br />' . IconUtility::getSpriteIcon('status-status-permission-denied') . ': ' . $GLOBALS['LANG']->getLL('A_Denied', TRUE);
+               $code .= '</div>';
+
+               // Adding section with legend code:
+               $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Legend') . ':', $code, TRUE, TRUE);
+       }
+
+       /**
+        * Creating form for editing the permissions    ($this->edit = true)
+        * (Adding content to internal content variable)
+        *
+        * @return    void
+        */
+       public function doEdit() {
+               if ($GLOBALS['BE_USER']->workspace != 0) {
+                       // Adding section with the permission setting matrix:
+                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('WorkspaceWarningText'), $GLOBALS['LANG']->getLL('WorkspaceWarning'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
+               }
+
+               // Get ACL configuration
+               $disableOldPermissionSystem = 0;
+               $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
+               if ($beAclConfig['disableOldPermissionSystem']) {
+                       $disableOldPermissionSystem = 1;
+               }
+               $GLOBALS['LANG']->includeLLFile('EXT:be_acl/res/locallang_perm.php');
+
+               // Get usernames and groupnames
+               $beGroupArray = BackendUtility::getListGroupNames('title,uid');
+               $beGroupKeys = array_keys($beGroupArray);
+               $beUserArray = BackendUtility::getUserNames();
+               if (!$GLOBALS['BE_USER']->isAdmin()) {
+                       $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 1);
+               }
+               $beGroupArray_o = ($beGroupArray = BackendUtility::getGroupNames());
+               if (!$GLOBALS['BE_USER']->isAdmin()) {
+                       $beGroupArray = BackendUtility::blindGroupNames($beGroupArray_o, $beGroupKeys, 1);
+               }
+
+               // Set JavaScript
+               // Generate list if record is available on subpages, if yes, enter the id
+               $this->content .= '<script src="../../../' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('be_acl') .
+                       'res/acl.js" type="text/javascript"></script>';
+
+               // Owner selector:
+               $options = '';
+
+               // flag: is set if the page-userid equals one from the user-list
+               $userset = 0;
+               foreach ($beUserArray as $uid => $row) {
+                       if ($uid == $this->pageinfo['perms_userid']) {
+                               $userset = 1;
+                               $selected = ' selected="selected"';
+                       } else {
+                               $selected = '';
+                       }
+                       $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';
+               }
+               $options = '<option value="0"></option>' . $options;
+
+               // Hide selector if not needed
+               $hidden = '';
+               if ($disableOldPermissionSystem) {
+                       $hidden = ' style="display:none;" ';
+               }
+
+               $selector = '<select name="data[pages][' . $this->id . '][perms_userid]"' . $hidden . '>' . $options . '</select>';
+               if ($disableOldPermissionSystem) {
+                       $this->content .= $selector;
+               } else {
+                       $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Owner'), $selector, TRUE);
+               }
+
+               // Group selector:
+               $options = '';
+               $userset = 0;
+               foreach ($beGroupArray as $uid => $row) {
+                       if ($uid == $this->pageinfo['perms_groupid']) {
+                               $userset = 1;
+                               $selected = ' selected="selected"';
+                       } else {
+                               $selected = '';
+                       }
+                       $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';
+               }
+
+               // If the group was not set AND there is a group for the page
+               if (!$userset && $this->pageinfo['perms_groupid']) {
+                       $options = '<option value="' . $this->pageinfo['perms_groupid'] . '" selected="selected">' . htmlspecialchars($beGroupArray_o[$this->pageinfo['perms_groupid']]['title']) . '</option>' . $options;
+               }
+               $options = '<option value="0"></option>' . $options;
+               $selector = '<select name="data[pages][' . $this->id . '][perms_groupid]"' . $hidden . '>' . $options . '</select>';
+               if ($disableOldPermissionSystem) {
+                       $this->content .= $selector;
+               } else {
+                       $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Group'), $selector, TRUE);
+               }
+
+               // Permissions checkbox matrix:
+               $code = '
+                       <input type="hidden" name="pageID" value="' . (int) $this->id . '" />
+                       <table class="t3-table" id="typo3-permissionMatrix">
+                               <thead>
+                                       <tr>
+                                               <th></th>
+                                               <th>' . $GLOBALS['LANG']->getLL('1', TRUE) . '</th>
+                                               <th>' . $GLOBALS['LANG']->getLL('16', TRUE) . '</th>
+                                               <th>' . $GLOBALS['LANG']->getLL('2', TRUE) . '</th>
+                                               <th>' . $GLOBALS['LANG']->getLL('4', TRUE) . '</th>
+                                               <th>' . $GLOBALS['LANG']->getLL('8', TRUE) . '</th>
+                                               <th>' . str_replace(' ', '<br />', $GLOBALS['LANG']->getLL('recursiveAcl', 1)) . '</th>
+                                               <th></th>
+                                       </tr>
+                               </thead>
+                               <tbody>';
+
+               if (!$disableOldPermissionSystem) {
+                       $code .= '
+                                       <tr>
+                                               <td><strong>' . $GLOBALS['LANG']->getLL('Owner', TRUE) . '</strong></td>
+                                               <td>' . $this->printCheckBox('perms_user', 1) . '</td>
+                                               <td>' . $this->printCheckBox('perms_user', 5) . '</td>
+                                               <td>' . $this->printCheckBox('perms_user', 2) . '</td>
+                                               <td>' . $this->printCheckBox('perms_user', 3) . '</td>
+                                               <td>' . $this->printCheckBox('perms_user', 4) . '</td>
+                                               <td></td>
+                                               <td></td>
+                                       </tr>
+                                       <tr>
+                                               <td><strong>' . $GLOBALS['LANG']->getLL('Group', TRUE) . '</strong></td>
+                                               <td>' . $this->printCheckBox('perms_group', 1) . '</td>
+                                               <td>' . $this->printCheckBox('perms_group', 5) . '</td>
+                                               <td>' . $this->printCheckBox('perms_group', 2) . '</td>
+                                               <td>' . $this->printCheckBox('perms_group', 3) . '</td>
+                                               <td>' . $this->printCheckBox('perms_group', 4) . '</td>
+                                               <td></td>
+                                               <td></td>
+                                       </tr>
+                                       <tr>
+                                               <td><strong>' . $GLOBALS['LANG']->getLL('Everybody', TRUE) . '</strong></td>
+                                               <td>' . $this->printCheckBox('perms_everybody', 1) . '</td>
+                                               <td>' . $this->printCheckBox('perms_everybody', 5) . '</td>
+                                               <td>' . $this->printCheckBox('perms_everybody', 2) . '</td>
+                                               <td>' . $this->printCheckBox('perms_everybody', 3) . '</td>
+                                               <td>' . $this->printCheckBox('perms_everybody', 4) . '</td>
+                                               <td></td>
+                                               <td></td>
+                                       </tr>';
+               }
+
+               // ACL CODE
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid=' . (int) $this->id);
+               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $acl_prefix = 'data[tx_beacl_acl][' . $result['uid'] . ']';
+                       $code .= '
+                               <tr>
+                                       <td align="right"><select name="' . $acl_prefix . '[type]" onChange="updateUserGroup(' . $result['uid'] . ')"><option value="0" ' . ($result['type'] ? '' : 'selected="selected"') . '>User</option><option value="1" ' . ($result['type'] ? 'selected="selected"' : '') . '>Group</option></select><select name="' . $acl_prefix . '[object_id]"></select></td>
+                                       <td>' . $this->printCheckBox('perms_acl_' . $result['uid'], 1, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>
+                                       <td>' . $this->printCheckBox('perms_acl_' . $result['uid'], 5, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>
+                                       <td>' . $this->printCheckBox('perms_acl_' . $result['uid'], 2, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>
+                                       <td>' . $this->printCheckBox('perms_acl_' . $result['uid'], 3, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>
+                                       <td>' . $this->printCheckBox('perms_acl_' . $result['uid'], 4, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '
+                                               <input type="hidden" name="' . $acl_prefix . '[permissions]" value="' . $result['permissions'] . '" />
+
+                                               <script type="text/javascript">updateUserGroup(' . $result['uid'] . ', ' . $result['object_id'] . ');
+                                               setCheck("check[perms_acl_' . $result['uid'] . ']","data[tx_beacl_acl][' . $result['uid'] . '][permissions]");
+                                               global_currentACLs[global_currentACLs.length] = ' . $result['uid'] . ' ;
+                                               </script>
+
+                                       </td>
+                                       <td>
+                                               <input type="hidden" name="' . $acl_prefix . '[recursive]" value="0" />
+                                               <input type="checkbox" name="' . $acl_prefix . '[recursive]" value="1" ' . ($result['recursive'] ? 'checked="checked"' : '') . ' />
+                                       </td>
+                                       <td><a href="#" onClick="deleteACL(' . $result['uid'] . ')"><img ' . IconUtility::skinImg('', 'gfx/garbage.gif') . ' alt="' . $GLOBALS['LANG']->getLL('delAcl', 1) . '" /></a></td>
+                               </tr>';
+               }
+
+               $code .= '
+                               </tbody>
+                       </table>
+                       <br />
+                       <span id="insertHiddenFields"></span>
+                       <img ' . IconUtility::skinImg('', 'gfx/garbage.gif') . ' alt="' . $GLOBALS['LANG']->getLL('delAcl', 1) . '" / id="templateDeleteImage" style="display:none">
+                       <a href="javascript:addACL()"><img  ' . IconUtility::skinImg('', 'gfx/new_el.gif') . ' alt="' . $GLOBALS['LANG']->getLL('addAcl', 1) . '" />' . $GLOBALS['LANG']->getLL('addAcl', 1) . '</a><br />
+
+                       <input type="hidden" name="data[pages][' . $this->id . '][perms_user]" value="' . $this->pageinfo['perms_user'] . '" />
+                       <input type="hidden" name="data[pages][' . $this->id . '][perms_group]" value="' . $this->pageinfo['perms_group'] . '" />
+                       <input type="hidden" name="data[pages][' . $this->id . '][perms_everybody]" value="' . $this->pageinfo['perms_everybody'] . '" />
+                       ' . ($disableOldPermissionSystem ? '' : $this->getRecursiveSelect($this->id, $this->perms_clause)) . '
+                       <input type="submit" name="submit" value="' . $GLOBALS['LANG']->getLL('saveAndClose', TRUE) . '" />' . '<input type="submit" value="' . $GLOBALS['LANG']->getLL('Abort', TRUE) . '" onclick="' . htmlspecialchars(('jumpToUrl(' . GeneralUtility::quoteJSvalue((BackendUtility::getModuleUrl('web_perm') . '&id=' . $this->id), TRUE) . '); return false;')) . '" />
+                       <input type="hidden" name="redirect" value="' . htmlspecialchars((BackendUtility::getModuleUrl('web_perm') . '&mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . (int) $this->return_id . '&lastEdited=' . $this->id)) . '" />
+                       ' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction');
+
+               // Adding section with the permission setting matrix:
+               $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('permissions'), $code, TRUE);
+
+               // CSH for permissions setting
+               $this->content .= BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module_setting', $GLOBALS['BACK_PATH'], '<br /><br />');
+
+               // Adding help text:
+               if ($GLOBALS['BE_USER']->uc['helpText']) {
+                       $legendText = '<p><strong>' . $GLOBALS['LANG']->getLL('1', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('1_t', TRUE) . '<br />';
+                       $legendText .= '<strong>' . $GLOBALS['LANG']->getLL('16', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('16_t', TRUE) . '<br />';
+                       $legendText .= '<strong>' . $GLOBALS['LANG']->getLL('2', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('2_t', TRUE) . '<br />';
+                       $legendText .= '<strong>' . $GLOBALS['LANG']->getLL('4', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('4_t', TRUE) . '<br />';
+                       $legendText .= '<strong>' . $GLOBALS['LANG']->getLL('8', TRUE) . '</strong>: ' . $GLOBALS['LANG']->getLL('8_t', TRUE) . '</p>';
+
+                       $code = $legendText . '<p>' . $GLOBALS['LANG']->getLL('def', TRUE) . '</p>';
+
+                       $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Legend', TRUE), $code, TRUE);
+               }
+       }
+
+       /*****************************
+        *
+        * Helper functions
+        *
+        *****************************/
+       /**
+        * generates title attribute for pages
+        *
+        * @param    integer        UID of page
+        * @param    array        BE user array
+        * @param    array        BE group array
+        * @return    string        HTML: title attribute
+        */
+       function generateTitleAttribute($uid, $be_user_Array, $be_group_Array) {
+
+               $composedStr = '';
+               $this->aclList[$uid];
+               if (!$this->aclList[$uid]) {
+                       return FALSE;
+               }
+               foreach ($this->aclList[$uid] as $type => $v1) {
+                       if (!$v1) {
+                               return FALSE;
+                       }
+                       foreach ($v1 as $object_id => $v2) {
+                               if ($v2['newAcl']) {
+                                       if ($type == 1) { // group
+                                               $composedStr .= ' G:' . $be_group_Array[$object_id]['title'];
+                                       } else {
+                                               $composedStr .= ' U:' . $be_user_Array[$object_id]['username'];
+                                       }
+                               }
+                       }
+               }
+
+               return ' title="' . $composedStr . '"' . ($composedStr ? ' class="bgColor5"' : '');
+       }
+
+       /**
+        * outputs a selector for users / groups, returns current ACLs
+        *
+        * @param    integer        type of ACL. 0 -> user, 1 -> group
+        * @param    string        Pointer where the display code is stored
+        * @param    array        configuration of ACLs
+        * @return    array        list of groups/users where the ACLs will be shown
+        */
+       function acl_objectSelector($type, &$displayPointer, $conf) {
+               global $BE_USER;
+               $aclObjects = array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       'tx_beacl_acl.object_id AS object_id, tx_beacl_acl.type AS type',
+                       'tx_beacl_acl, be_groups, be_users',
+                       'tx_beacl_acl.type=' . intval($type) . ' AND ((tx_beacl_acl.object_id=be_groups.uid AND tx_beacl_acl.type=1) OR (tx_beacl_acl.object_id=be_users.uid AND tx_beacl_acl.type=0))',
+                       '',
+                       'be_groups.title ASC, be_users.realname ASC'
+               );
+               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $aclObjects[] = $result['object_id'];
+               }
+               $aclObjects = array_unique($aclObjects);
+               // advanced selector disabled
+               if (!$conf['enableFilterSelector']) {
+                       return $aclObjects;
+               }
+
+               if (!empty($aclObjects)) {
+
+                       // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
+                       $groupArray = $BE_USER->userGroupsUID;
+                       $be_user_Array = BackendUtility::getUserNames();
+                       if (!$GLOBALS['BE_USER']->isAdmin()) {
+                               $be_user_Array = BackendUtility::blindUserNames($be_user_Array, $groupArray, 0);
+                       }
+                       $be_group_Array = BackendUtility::getGroupNames();
+                       if (!$GLOBALS['BE_USER']->isAdmin()) {
+                               $be_group_Array = BackendUtility::blindGroupNames($be_group_Array, $groupArray, 0);
+                       }
+
+                       // get current selection from UC, merge data, write it back to UC
+                       $currentSelection = is_array($BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type]) ? $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] : array();
+
+                       $currentSelectionOverride_raw = GeneralUtility::_GP('tx_beacl_objsel');
+                       $currentSelectionOverride = array();
+                       if (is_array($currentSelectionOverride_raw[$type])) {
+                               foreach ($currentSelectionOverride_raw[$type] as $tmp) {
+                                       $currentSelectionOverride[$tmp] = $tmp;
+                               }
+                       }
+                       if ($currentSelectionOverride) {
+                               $currentSelection = $currentSelectionOverride;
+                       }
+                       $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] = $currentSelection;
+                       $BE_USER->writeUC($BE_USER->uc);
+
+                       // display selector
+                       $displayCode = '<select size="' . \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(count($aclObjects), 5, 15) . '" name="tx_beacl_objsel[' . $type . '][]" multiple="multiple">';
+                       foreach ($aclObjects as $singleObjectId) {
+                               if ($type == 0) {
+                                       $tmpnam = $be_user_Array[$singleObjectId]['username'];
+                               } else {
+                                       $tmpnam = $be_group_Array[$singleObjectId]['title'];
+                               }
+
+                               $displayCode .= '<option value="' . $singleObjectId . '" ' . (@in_array($singleObjectId, $currentSelection) ? 'selected' : '') . '>' . $tmpnam . '</option>';
+                       }
+
+                       $displayCode .= '</select>';
+                       $displayCode .= '<br /><input type="button" value="' . $GLOBALS['LANG']->getLL('aclObjSelUpdate') . '" onClick="document.editform.action=document.location; document.editform.submit()" /><p />';
+
+                       // create section
+                       switch ($type) {
+                               case 0:
+                                       $tmpnam = 'aclUsers';
+                                       break;
+                               default:
+                                       $tmpnam = 'aclGroups';
+                                       break;
+                       }
+                       $displayPointer = $this->doc->section($GLOBALS['LANG']->getLL($tmpnam, 1), $displayCode);
+
+                       return $currentSelection;
+               }
+
+               return NULL;
+       }
+
+
+       /**
+        * returns a datastructure: pageid - userId / groupId - permissions
+        *
+        * @param    array        user ID list
+        * @param    array        group ID list
+        */
+       function buildACLtree($users, $groups) {
+
+               // get permissions in the starting point for users and groups
+               $rootLine = BackendUtility::BEgetRootLine($this->id);
+
+               $userStartPermissions = array();
+               $groupStartPermissions = array();
+
+               array_shift($rootLine); // needed as a starting point
+
+               foreach ($rootLine as $level => $values) {
+                       $recursive = ' AND recursive=1';
+
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive);
+
+                       while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               if ($result['type'] == 0
+                                       && in_array($result['object_id'], $users)
+                                       && !array_key_exists($result['object_id'], $userStartPermissions)
+                               ) {
+                                       $userStartPermissions[$result['object_id']] = $result['permissions'];
+                               } elseif ($result['type'] == 1
+                                       && in_array($result['object_id'], $groups)
+                                       && !array_key_exists($result['object_id'], $groupStartPermissions)
+                               ) {
+                                       $groupStartPermissions[$result['object_id']] = $result['permissions'];
+                               }
+                       }
+               }
+               foreach ($userStartPermissions as $oid => $perm) {
+                       $startPerms[0][$oid]['permissions'] = $perm;
+                       $startPerms[0][$oid]['recursive'] = 1;
+               }
+               foreach ($groupStartPermissions as $oid => $perm) {
+                       $startPerms[1][$oid]['permissions'] = $perm;
+                       $startPerms[1][$oid]['recursive'] = 1;
+               }
+
+
+               $this->traversePageTree_acl($startPerms, $rootLine[0]['uid']);
+
+               // check if there are any ACLs on these pages
+               // build a recursive function traversing through the pagetree
+       }
+
+       function countAcls($pageData) {
+               $i = 0;
+               if (!$pageData) {
+                       return '';
+               }
+               foreach ($pageData as $aclId => $values) {
+                       if ($values['newAcl']) {
+                               $i += $values['newAcl'];
+                       }
+               }
+
+               return ($i ? $i : '');
+       }
+
+       /**
+        * build ACL tree
+        */
+       function traversePageTree_acl($parentACLs, $uid) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions, recursive', 'tx_beacl_acl', 'pid=' . intval($uid));
+
+               $hasNoRecursive = array();
+               $this->aclList[$uid] = $parentACLs;
+               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $permissions = array(
+                               'permissions' => $result['permissions'],
+                               'recursive' => $result['recursive'],
+                       );
+                       if ($result['recursive'] == 0) {
+                               if ($this->aclList[$uid][$result['type']][$result['object_id']]['newAcl']) {
+                                       $permissions['newAcl'] = $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'];
+                               }
+                               $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;
+                               $permissions['newAcl'] = 1;
+                               $hasNoRecursive[$uid][$result['type']][$result['object_id']] = $permissions;
+                       } else {
+                               $parentACLs[$result['type']][$result['object_id']] = $permissions;
+                               if (is_array($hasNoRecursive[$uid][$result['type']][$result['object_id']])) {
+                                       $this->aclList[$uid][$result['type']][$result['object_id']] = $hasNoRecursive[$uid][$result['type']][$result['object_id']];
+                               } else {
+                                       $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;
+                               }
+                       }
+                       $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'] += 1;
+               }
+
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . intval($uid) . ' AND deleted=0');
+               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $this->traversePageTree_acl($parentACLs, $result['uid']);
+               }
+       }
+
+       /**
+        * prints table header
+        *
+        * @param    array        array of cells
+        * @return    string        HTML output for the cells
+        */
+       function printTableHeader($cells) {
+               $wrappedCells = '';
+               foreach ($cells as $singleCell) {
+                       $wrappedCells .= '<th align="center">' . $singleCell . '</th>';
+               }
+
+               return $wrappedCells;
+
+       }
+
+       /**
+        * Print a checkbox for the edit-permission form
+        *
+        * @param    string        Checkbox name key
+        * @param    integer        Checkbox number index
+        * @param string        Result sting, not mandatory
+        * @return    string        HTML checkbox
+        */
+       function printCheckBox($checkName, $num, $result = '') {
+               if (empty($result)) {
+                       $result = 'data[pages][' . $GLOBALS['SOBE']->id . '][' . $checkName . ']';
+               }
+
+               $onClick = 'checkChange(\'check[' . $checkName . ']\', \'' . $result . '\')';
+
+               return '<input type="checkbox" name="check[' . $checkName . '][' . $num . ']" onclick="' . htmlspecialchars($onClick) . '" /><br />';
+       }
+
+       /**
+        * Print a set of permissions
+        *
+        * @param    integer        Permission integer (bits)
+        * @return    string        HTML marked up x/* indications.
+        */
+       function printPerms($int) {
+               global $LANG;
+               $permissions = array(
+                       1,
+                       16,
+                       2,
+                       4,
+                       8
+               );
+               $str = '';
+               foreach ($permissions as $permission) {
+                       if ($int & $permission) {
+                               $str .= IconUtility::getSpriteIcon('status-status-permission-granted', array(
+                                       'tag' => 'a',
+                                       'title' => $LANG->getLL($permission, 1),
+                                       'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'delete\', \'' . $who . '\', ' . $int . ');'
+                               ));
+                       } else {
+                               $str .= IconUtility::getSpriteIcon('status-status-permission-denied', array(
+                                       'tag' => 'a',
+                                       'title' => $LANG->getLL($permission, 1),
+                                       'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'add\', \'' . $who . '\', ' . $int . ');'
+                               ));
+                       }
+               }
+
+               return $str;
+       }
+
+}
+
+?>
diff --git a/class.tx_beacl_hooks.php b/class.tx_beacl_hooks.php
new file mode 100644 (file)
index 0000000..9c9402b
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+class tx_beacl_hooks {\r
+\r
+       function processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray) {\r
+               if ($table == 'pages' && $status == 'new' ) {\r
+                       $GLOBALS['BE_USER']->setAndSaveSessionData('be_acl', array() );\r
+                       $GLOBALS['BE_USER']->getPagePermsClause(1);\r
+               }\r
+\r
+       }\r
+}\r
+\r
+?>\r
diff --git a/class.tx_beacl_objsel.php b/class.tx_beacl_objsel.php
new file mode 100644 (file)
index 0000000..e9a53ae
--- /dev/null
@@ -0,0 +1,63 @@
+<?php\r
+\r
+class tx_beacl_objsel {\r
+       /**\r
+        * Populates the "object_id" field of a "tx_beacl_acl" record depending on\r
+        * whether the field "type" is set to "User" or "Group"\r
+        *\r
+        * @param               array           field configuration\r
+        * @param               object\r
+        * @return      void\r
+        */\r
+       function select($PA, $fobj) {\r
+               global $BE_USER;\r
+               if(!array_key_exists('row', $PA)) return;\r
+               if(!array_key_exists('type', $PA['row'])) return;\r
+\r
+                       // Resetting the SELECT field items\r
+               $PA['items'] = array(\r
+                       0 => array(\r
+                               0 => '',\r
+                               1 => '',\r
+                       ),\r
+               );\r
+\r
+                       // Get users or groups - The function copies functionality of the method acl_objectSelector()\r
+                       // of ux_SC_mod_web_perm_index class as for non-admins it returns only:\r
+                       // 1) Users which are members of the groups of the current user.\r
+                       // 2) Groups that the current user is a member of.\r
+               switch($PA['row']['type']) {\r
+                               // In case users shall be returned\r
+                       case '0':\r
+                               $items = t3lib_BEfunc::getUserNames();\r
+                               if(!$GLOBALS['BE_USER']->isAdmin()) $items = t3lib_BEfunc::blindUserNames($items, $BE_USER->userGroupsUID, 1);\r
+\r
+                               foreach($items as $row) {\r
+                                       $PA['items'][] = array(\r
+                                               0 => $row['username'],\r
+                                               1 => $row['uid'],\r
+                                       );\r
+                               }\r
+                               break;\r
+\r
+                               // In case groups shall be returned\r
+                       case '1':\r
+                               $items = t3lib_BEfunc::getGroupNames();\r
+                               if(!$GLOBALS['BE_USER']->isAdmin()) $items = t3lib_BEfunc::blindGroupNames($items, $BE_USER->userGroupsUID, 1);\r
+\r
+                               foreach($items as $row) {\r
+                                       $PA['items'][] = array(\r
+                                               0 => $row['title'],\r
+                                               1 => $row['uid'],\r
+                                       );\r
+                               }\r
+                               break;\r
+\r
+                       default:\r
+                               return;\r
+               }\r
+\r
+               return;\r
+       }\r
+}\r
+?>\r
index 02db5a8..bccb494 100644 (file)
@@ -1,9 +1,9 @@
-<?php
-// DO NOT CHANGE THIS FILE! It is automatically generated by extdeveval::buildAutoloadRegistry.
-// This file was generated on 2009-04-25 20:13
-
-$extensionPath = t3lib_extMgm::extPath('be_acl');
-return array(
-       'tx_beacl_userauthgroup' => $extensionPath . 'res/class.tx_beacl_userauthgroup.php',
-);
-?>
\ No newline at end of file
+<?php\r
+// DO NOT CHANGE THIS FILE! It is automatically generated by extdeveval::buildAutoloadRegistry.\r
+// This file was generated on 2009-04-25 20:13\r
+\r
+$extensionPath = t3lib_extMgm::extPath('be_acl');\r
+return array(\r
+       'tx_beacl_userauthgroup'   => $extensionPath . 'res/class.tx_beacl_userauthgroup.php',\r
+);\r
+?>\r
index 4369c85..2d33299 100644 (file)
@@ -3,6 +3,3 @@ disableOldPermissionSystem = 0
 \r
 # cat=basic/enable; type=boolean; label=enable selector for users/groups - VERY useful if there are many ACLs\r
 enableFilterSelector = 1\r
-\r
-# cat=basic/enable; type=string; label=define tables where changes lead to automatic ACL cache clear (comma-seperated list)\r
-tablesForCacheClear = pages
\ No newline at end of file
index df907c8..4789204 100644 (file)
@@ -1,52 +1,48 @@
-<?php
-
-########################################################################
-# Extension Manager/Repository config file for ext "be_acl".
-#
-# Auto generated 02-12-2010 10:59
-#
-# Manual updates:
-# Only the data in the array - everything else is removed by next
-# writing. "version" and "dependencies" must not be touched!
-########################################################################
-
-$EM_CONF[$_EXTKEY] = array(
-       'title' => 'Backend ACLs',
-       'description' => 'Backend Access Control Lists',
-       'category' => 'be',
-       'shy' => 0,
-       'version' => '1.4.3',
-       'dependencies' => 'cms,lang',
-       'conflicts' => '',
-       'priority' => '',
-       'loadOrder' => '',
-       'module' => '',
-       'state' => 'stable',
-       'uploadfolder' => 0,
-       'createDirs' => 'typo3temp/beacl_cache',
-       'modify_tables' => '',
-       'clearcacheonload' => 0,
-       'lockType' => '',
-       'author' => 'Sebastian Kurfuerst',
-       'author_email' => 'sebastian@garbage-group.de',
-       'author_company' => '',
-       'CGLcompliance' => '',
-       'CGLcompliance_note' => '',
-       'constraints' => array(
-               'depends' => array(
-                       'cms' => '',
-                       'lang' => '',
-                       'php' => '3.0.0-0.0.0',
-                       'typo3' => '3.5.0-0.0.0',
-               ),
-               'conflicts' => array(
-               ),
-               'suggests' => array(
-               ),
-       ),
-       '_md5_values_when_last_written' => 'a:16:{s:16:"ext_autoload.php";s:4:"001a";s:21:"ext_conf_template.txt";s:4:"ed55";s:12:"ext_icon.gif";s:4:"1bea";s:17:"ext_localconf.php";s:4:"5dcf";s:14:"ext_tables.php";s:4:"aceb";s:14:"ext_tables.sql";s:4:"1076";s:21:"icon_tx_beacl_acl.gif";s:4:"1bea";s:16:"locallang_db.php";s:4:"0f61";s:7:"tca.php";s:4:"01cc";s:14:"doc/manual.sxw";s:4:"4db3";s:19:"doc/wizard_form.dat";s:4:"e68f";s:20:"doc/wizard_form.html";s:4:"4e9b";s:10:"res/acl.js";s:4:"80ec";s:36:"res/class.tx_beacl_userauthgroup.php";s:4:"e954";s:38:"res/class.ux_sc_mod_web_perm_index.php";s:4:"4bb6";s:22:"res/locallang_perm.php";s:4:"9a96";}',
-       'suggests' => array(
-       ),
-);
-
+<?php\r
+\r
+/***************************************************************\r
+ * Extension Manager/Repository config file for ext "be_acl".\r
+ *\r
+ * Auto generated 19-06-2014 14:49\r
+ *\r
+ * Manual updates:\r
+ * Only the data in the array - everything else is removed by next\r
+ * writing. "version" and "dependencies" must not be touched!\r
+ ***************************************************************/\r
+\r
+$EM_CONF[$_EXTKEY] = array(\r
+       'title' => 'Backend ACLs',\r
+       'description' => 'Backend Access Control Lists',\r
+       'category' => 'be',\r
+       'shy' => 0,\r
+       'version' => '1.5.0',\r
+       'dependencies' => '',\r
+       'conflicts' => '',\r
+       'priority' => '',\r
+       'loadOrder' => '',\r
+       'module' => '',\r
+       'state' => 'stable',\r
+       'uploadfolder' => 0,\r
+       'createDirs' => '',\r
+       'modify_tables' => '',\r
+       'clearcacheonload' => 0,\r
+       'lockType' => '',\r
+       'author' => 'Sebastian Kurfuerst',\r
+       'author_email' => 'sebastian@garbage-group.de',\r
+       'author_company' => '',\r
+       'CGLcompliance' => '',\r
+       'CGLcompliance_note' => '',\r
+       'constraints' => array(\r
+               'depends' => array(\r
+                       'php' => '5.2.0-5.5.99',\r
+                       'typo3' => '4.5.0-6.2.99',\r
+               ),\r
+               'conflicts' => array(\r
+               ),\r
+               'suggests' => array(\r
+               ),\r
+       ),\r
+       '_md5_values_when_last_written' => 'a:19:{s:24:"class.tx_beacl_hooks.php";s:4:"9ccb";s:25:"class.tx_beacl_objsel.php";s:4:"503a";s:16:"ext_autoload.php";s:4:"001a";s:21:"ext_conf_template.txt";s:4:"7db6";s:12:"ext_icon.gif";s:4:"1bea";s:17:"ext_localconf.php";s:4:"2c68";s:14:"ext_tables.php";s:4:"aceb";s:14:"ext_tables.sql";s:4:"1076";s:21:"icon_tx_beacl_acl.gif";s:4:"1bea";s:16:"locallang_db.php";s:4:"e78d";s:7:"tca.php";s:4:"6d44";s:45:"Classes/Xclass/PermissionModuleController.php";s:4:"4f5b";s:14:"doc/manual.sxw";s:4:"4db3";s:19:"doc/wizard_form.dat";s:4:"e68f";s:20:"doc/wizard_form.html";s:4:"4e9b";s:10:"res/acl.js";s:4:"6946";s:36:"res/class.tx_beacl_userauthgroup.php";s:4:"68a2";s:38:"res/class.ux_sc_mod_web_perm_index.php";s:4:"ca90";s:22:"res/locallang_perm.php";s:4:"4435";}',\r
+);\r
+\r
 ?>
\ No newline at end of file
index 803eb25..a2bb085 100644 (file)
@@ -1,23 +1,26 @@
-<?php
-if (!defined ("TYPO3_MODE"))   die ("Access denied.");
-t3lib_extMgm::addUserTSConfig('
-       options.saveDocNew.tx_beacl_acl=1
-');
-
-
-
-require_once(t3lib_extMgm::extPath('be_acl').'res/class.tx_beacl_userauthgroup.php');
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'][] = 'tx_beacl_userAuthGroup->calcPerms';
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'][] = 'tx_beacl_userAuthGroup->getPagePermsClause';
-
-
-
-$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/perm/index.php'] = t3lib_extMgm::extPath('be_acl').'res/class.ux_sc_mod_web_perm_index.php';
-
-// Hook for clear cache
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][$_EXTKEY] = 'EXT:be_acl/res/class.tx_beacl_userauthgroup.php:tx_beacl_userAuthGroup->clearCache';
-//TCEmain Hooks
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][$_EXTKEY] = 'EXT:be_acl/res/class.tx_beacl_userauthgroup.php:&tx_beacl_userAuthGroup';
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][$_EXTKEY] = 'EXT:be_acl/res/class.tx_beacl_userauthgroup.php:&tx_beacl_userAuthGroup';
-
-?>
\ No newline at end of file
+<?php\r
+if (!defined ("TYPO3_MODE"))   die ("Access denied.");\r
+t3lib_extMgm::addUserTSConfig('\r
+       options.saveDocNew.tx_beacl_acl=1\r
+');\r
+\r
+\r
+\r
+require_once(t3lib_extMgm::extPath('be_acl').'class.tx_beacl_objsel.php');\r
+require_once(t3lib_extMgm::extPath('be_acl').'res/class.tx_beacl_userauthgroup.php');\r
+$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'][] = 'tx_beacl_userAuthGroup->calcPerms';\r
+$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'][] = 'tx_beacl_userAuthGroup->getPagePermsClause';\r
+\r
+\r
+if (version_compare(TYPO3_branch, '6.0', '<')) {\r
+       $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/web/perm/index.php'] = t3lib_extMgm::extPath('be_acl') . 'res/class.ux_sc_mod_web_perm_index.php';\r
+} else {\r
+       $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Perm\\Controller\\PermissionModuleController'] = array(\r
+               'className' => 'Tx_BeAcl_Xclass_PermissionModuleController',\r
+       );\r
+}\r
+\r
+\r
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:be_acl/class.tx_beacl_hooks.php:tx_beacl_hooks';\r
+\r
+?>\r
index f0f11d4..a7f6827 100644 (file)
@@ -1,23 +1,23 @@
-<?php
-if (!defined ("TYPO3_MODE"))   die ("Access denied.");
-
-t3lib_extMgm::allowTableOnStandardPages("tx_beacl_acl");
-
-$TCA["tx_beacl_acl"] = Array (
-       "ctrl" => Array (
-               "title" => "LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl",
-               "label" => "uid",
-               "tstamp" => "tstamp",
-               "crdate" => "crdate",
-               "cruser_id" => "cruser_id",
-               "type" => "type",
-               "default_sortby" => "ORDER BY type",
-               "dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
-               "iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_beacl_acl.gif",
-       ),
-       "feInterface" => Array (
-               "fe_admin_fieldList" => "type, object_id, permissions, recursive",
-       )
-);
-
-?>
\ No newline at end of file
+<?php\r
+if (!defined ("TYPO3_MODE"))   die ("Access denied.");\r
+\r
+t3lib_extMgm::allowTableOnStandardPages("tx_beacl_acl");\r
+\r
+$TCA["tx_beacl_acl"] = Array (\r
+       "ctrl" => Array (\r
+               "title" => "LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl",\r
+               "label" => "uid",\r
+               "tstamp" => "tstamp",\r
+               "crdate" => "crdate",\r
+               "cruser_id" => "cruser_id",\r
+               "type" => "type",\r
+               "default_sortby" => "ORDER BY type",\r
+               "dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",\r
+               "iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_beacl_acl.gif",\r
+       ),\r
+       "feInterface" => Array (\r
+               "fe_admin_fieldList" => "type, object_id, permissions, recursive",\r
+       )\r
+);\r
+\r
+?>\r
index c560ab7..fdc7751 100644 (file)
@@ -1,17 +1,17 @@
-#
-# Table structure for table 'tx_beacl_acl'
-#
-CREATE TABLE tx_beacl_acl (
-       uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
-       pid int(11) unsigned DEFAULT '0' NOT NULL,
-       tstamp int(11) unsigned DEFAULT '0' NOT NULL,
-       crdate int(11) unsigned DEFAULT '0' NOT NULL,
-       cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
-       type int(11) unsigned DEFAULT '0' NOT NULL,
-       object_id int(11) unsigned DEFAULT '0' NOT NULL,
-       permissions int(11) unsigned DEFAULT '0' NOT NULL,
-       recursive tinyint(1) unsigned DEFAULT '0' NOT NULL,
-       PRIMARY KEY (uid),
-       UNIQUE KEY uniqueacls (pid,type,object_id,recursive),
-       KEY parent (pid)
-);
\ No newline at end of file
+#\r
+# Table structure for table 'tx_beacl_acl'\r
+#\r
+CREATE TABLE tx_beacl_acl (\r
+       uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,\r
+       pid int(11) unsigned DEFAULT '0' NOT NULL,\r
+       tstamp int(11) unsigned DEFAULT '0' NOT NULL,\r
+       crdate int(11) unsigned DEFAULT '0' NOT NULL,\r
+       cruser_id int(11) unsigned DEFAULT '0' NOT NULL,\r
+       type int(11) unsigned DEFAULT '0' NOT NULL,\r
+       object_id int(11) unsigned DEFAULT '0' NOT NULL,\r
+       permissions int(11) unsigned DEFAULT '0' NOT NULL,\r
+       recursive tinyint(1) unsigned DEFAULT '0' NOT NULL,\r
+       PRIMARY KEY (uid),\r
+       UNIQUE KEY uniqueacls (pid,type,object_id,recursive),\r
+       KEY parent (pid)\r
+);\r
index 8679d9e..35143d1 100644 (file)
-<?php
-/**
- * Language labels for database tables/fields belonging to extension 'be_acl'
- * 
- * This file is detected by the translation tool.
- */
-
-$LOCAL_LANG = Array (
-       'default' => Array (
-               'tx_beacl_acl' => 'Access Control Lists',
-               'tx_beacl_acl.type.I.0' => 'User',
-               'tx_beacl_acl.type.I.1' => 'Group',
-               'tx_beacl_acl.type' => 'ACL type',
-               'tx_beacl_acl.object_id' => 'ID of User/Group',
-               'tx_beacl_acl.permissions.I.0' => 'Show page',
-               'tx_beacl_acl.permissions.I.1' => 'Edit page',
-               'tx_beacl_acl.permissions.I.2' => 'Delete page',
-               'tx_beacl_acl.permissions.I.3' => 'New pages',
-               'tx_beacl_acl.permissions.I.4' => 'Edit content',
-               'tx_beacl_acl.permissions' => 'Permissions',
-               'tx_beacl_acl.recursive' => 'Rekursiv',
-       ),
-       'dk' => Array (
-               'tx_beacl_acl' => 'Adgangskontrollister',
-               'tx_beacl_acl.type.I.0' => 'Bruger',
-               'tx_beacl_acl.type.I.1' => 'Gruppe',
-               'tx_beacl_acl.type' => 'ACL type',
-               'tx_beacl_acl.object_id' => 'Bruger/gruppe ID',
-               'tx_beacl_acl.permissions.I.0' => 'Vis siden',
-               'tx_beacl_acl.permissions.I.1' => 'Redigér siden',
-               'tx_beacl_acl.permissions.I.2' => 'Slet siden',
-               'tx_beacl_acl.permissions.I.3' => 'Nye sider',
-               'tx_beacl_acl.permissions.I.4' => 'Redigér indhold',
-               'tx_beacl_acl.permissions' => 'Rettigheder',
-               'tx_beacl_acl.recursive' => 'Rekursiv',
-       ),
-       'de' => Array (
-       ),
-       'no' => Array (
-       ),
-       'it' => Array (
-       ),
-       'fr' => Array (
-       ),
-       'es' => Array (
-       ),
-       'nl' => Array (
-       ),
-       'cz' => Array (
-       ),
-       'pl' => Array (
-       ),
-       'si' => Array (
-       ),
-       'fi' => Array (
-       ),
-       'tr' => Array (
-       ),
-       'se' => Array (
-       ),
-       'pt' => Array (
-       ),
-       'ru' => Array (
-       ),
-       'ro' => Array (
-       ),
-       'ch' => Array (
-       ),
-       'sk' => Array (
-       ),
-       'lt' => Array (
-       ),
-       'is' => Array (
-       ),
-       'hr' => Array (
-       ),
-       'hu' => Array (
-       ),
-       'gl' => Array (
-       ),
-       'th' => Array (
-       ),
-       'gr' => Array (
-       ),
-       'hk' => Array (
-       ),
-       'eu' => Array (
-       ),
-       'bg' => Array (
-       ),
-       'br' => Array (
-       ),
-       'et' => Array (
-       ),
-       'ar' => Array (
-       ),
-       'he' => Array (
-       ),
-       'ua' => Array (
-       ),
-       'lv' => Array (
-       ),
-       'jp' => Array (
-       ),
-       'vn' => Array (
-       ),
-       'ca' => Array (
-       ),
-       'ba' => Array (
-       ),
-       'kr' => Array (
-       ),
-       'eo' => Array (
-       ),
-       'my' => Array (
-       ),
-       'hi' => Array (
-       ),
-);
-?>
\ No newline at end of file
+<?php\r
+/**\r
+ * Language labels for database tables/fields belonging to extension 'be_acl'\r
+ *\r
+ * This file is detected by the translation tool.\r
+ */\r
+\r
+$LOCAL_LANG = Array (\r
+       'default' => Array (\r
+               'tx_beacl_acl' => 'Access Control Lists',\r
+               'tx_beacl_acl.type.I.0' => 'User',\r
+               'tx_beacl_acl.type.I.1' => 'Group',\r
+               'tx_beacl_acl.type' => 'ACL type',\r
+               'tx_beacl_acl.object_id' => 'ID of User/Group',\r
+               'tx_beacl_acl.permissions.I.0' => 'Show page',\r
+               'tx_beacl_acl.permissions.I.1' => 'Edit page',\r
+               'tx_beacl_acl.permissions.I.2' => 'Delete page',\r
+               'tx_beacl_acl.permissions.I.3' => 'New pages',\r
+               'tx_beacl_acl.permissions.I.4' => 'Edit content',\r
+               'tx_beacl_acl.permissions' => 'Permissions',\r
+               'tx_beacl_acl.recursive' => 'Rekursiv',\r
+       ),\r
+       'dk' => Array (\r
+               'tx_beacl_acl' => 'Adgangskontrollister',\r
+               'tx_beacl_acl.type.I.0' => 'Bruger',\r
+               'tx_beacl_acl.type.I.1' => 'Gruppe',\r
+               'tx_beacl_acl.type' => 'ACL type',\r
+               'tx_beacl_acl.object_id' => 'Bruger/gruppe ID',\r
+               'tx_beacl_acl.permissions.I.0' => 'Vis siden',\r
+               'tx_beacl_acl.permissions.I.1' => 'Redigér siden',\r
+               'tx_beacl_acl.permissions.I.2' => 'Slet siden',\r
+               'tx_beacl_acl.permissions.I.3' => 'Nye sider',\r
+               'tx_beacl_acl.permissions.I.4' => 'Redigér indhold',\r
+               'tx_beacl_acl.permissions' => 'Rettigheder',\r
+               'tx_beacl_acl.recursive' => 'Rekursiv',\r
+       ),\r
+       'de' => Array (\r
+               'tx_beacl_acl' => 'Zugriffsrechte (ACL)',\r
+               'tx_beacl_acl.type.I.0' => 'Benutzer',\r
+               'tx_beacl_acl.type.I.1' => 'Gruppe',\r
+               'tx_beacl_acl.type' => 'ACL Typ',\r
+               'tx_beacl_acl.object_id' => 'Benutzer-/Gruppen-ID',\r
+               'tx_beacl_acl.permissions.I.0' => 'Seite anzeigen',\r
+               'tx_beacl_acl.permissions.I.1' => 'Seite bearbeiten',\r
+               'tx_beacl_acl.permissions.I.2' => 'Seite löchen',\r
+               'tx_beacl_acl.permissions.I.3' => 'Neue Seite',\r
+               'tx_beacl_acl.permissions.I.4' => 'Inhalt bearbeiten',\r
+               'tx_beacl_acl.permissions' => 'Rechte',\r
+               'tx_beacl_acl.recursive' => 'Rekursiv',\r
+       ),\r
+       'no' => Array (\r
+       ),\r
+       'it' => Array (\r
+       ),\r
+       'fr' => Array (\r
+       ),\r
+       'es' => Array (\r
+       ),\r
+       'nl' => Array (\r
+       ),\r
+       'cz' => Array (\r
+       ),\r
+       'pl' => Array (\r
+       ),\r
+       'si' => Array (\r
+       ),\r
+       'fi' => Array (\r
+       ),\r
+       'tr' => Array (\r
+       ),\r
+       'se' => Array (\r
+       ),\r
+       'pt' => Array (\r
+       ),\r
+       'ru' => Array (\r
+       ),\r
+       'ro' => Array (\r
+       ),\r
+       'ch' => Array (\r
+       ),\r
+       'sk' => Array (\r
+       ),\r
+       'lt' => Array (\r
+       ),\r
+       'is' => Array (\r
+       ),\r
+       'hr' => Array (\r
+       ),\r
+       'hu' => Array (\r
+       ),\r
+       'gl' => Array (\r
+       ),\r
+       'th' => Array (\r
+       ),\r
+       'gr' => Array (\r
+       ),\r
+       'hk' => Array (\r
+       ),\r
+       'eu' => Array (\r
+       ),\r
+       'bg' => Array (\r
+       ),\r
+       'br' => Array (\r
+       ),\r
+       'et' => Array (\r
+       ),\r
+       'ar' => Array (\r
+       ),\r
+       'he' => Array (\r
+       ),\r
+       'ua' => Array (\r
+       ),\r
+       'lv' => Array (\r
+       ),\r
+       'jp' => Array (\r
+       ),\r
+       'vn' => Array (\r
+       ),\r
+       'ca' => Array (\r
+       ),\r
+       'ba' => Array (\r
+       ),\r
+       'kr' => Array (\r
+       ),\r
+       'eo' => Array (\r
+       ),\r
+       'my' => Array (\r
+       ),\r
+       'hi' => Array (\r
+       ),\r
+);\r
+?>\r
index ef006f2..f017ea2 100644 (file)
@@ -145,7 +145,6 @@ function addACL () {
                // permission table cells
        for(var i = 1; i <= 6;i++) {
                tableCells[i] = document.createElement("td");
-               tableCells[i].className = 'bgColor-20';
                var id = 0;
                switch(i) {
                        case 1: id = 1; break;
@@ -193,7 +192,7 @@ function addACL () {
        tableRow.appendChild(tableCells[7]);
 
                // append line to table
-       document.getElementById('typo3-permissionMatrix').firstChild.appendChild(tableRow);
+       document.getElementById('typo3-permissionMatrix').getElementsByTagName('tbody')[0].appendChild(tableRow);
 
                // hidden fields
        var hiddenFields = document.getElementById('insertHiddenFields');
index 192fda9..6ec0652 100644 (file)
@@ -2,27 +2,27 @@
 
 
 /***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 Sebastian Kurfuerst (sebastian@garbage-group.de)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
+*  Copyright notice
+*
+*  (c) 2005 Sebastian Kurfuerst (sebastian@garbage-group.de)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
 /**
  * Backend ACL - Functions re-calculating permissions
  *
@@ -40,11 +40,11 @@ class tx_beacl_userAuthGroup {
         * @param       object          BE User Object
         * @return      integer         Bitwise representation of the users permissions in relation to input page row, $row
         */
-       public function calcPerms($params, $that) {
+       public function calcPerms($params, $that)       {
                $row = $params['row'];
 
-               $beAclConfig = $this->getConfig();
-               if (!$beAclConfig['disableOldPermissionSystem']) {
+               $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
+               if(!$beAclConfig['disableOldPermissionSystem']) {
                        $out = $params['outputPermissions'];
                } else {
                        $out = 0;
@@ -55,25 +55,25 @@ class tx_beacl_userAuthGroup {
                $i = 0;
                $takeUserIntoAccount = 1;
                $groupIdsAlreadyUsed = Array();
-               foreach ($rootLine as $level => $values) {
-                       if ($i != 0) {
+               foreach($rootLine as $level => $values) {
+                       if($i != 0) {
                                $recursive = ' AND recursive=1';
                        } else {
                                $recursive = '';
                        }
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive, '', 'recursive ASC');
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid='.intval($values['uid']).$recursive, '', 'recursive ASC');
 
                        while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                if ($result['type'] == 0
                                        && ($that->user['uid'] == $result['object_id'])
                                        && $takeUserIntoAccount) { // user has to be taken into account
-                                       $out |= $result['permissions'];
+                                       $out|=$result['permissions'];
                                        $takeUserIntoAccount = 0;
 
                                } elseif ($result['type'] == 1
-                                                 && $that->isMemberOfGroup($result['object_id'])
-                                                 && !in_array($result['object_id'], $groupIdsAlreadyUsed)) {
-                                       $out |= $result['permissions'];
+                                       && $that->isMemberOfGroup($result['object_id'])
+                                       && !in_array($result['object_id'], $groupIdsAlreadyUsed)) {
+                                       $out|=$result['permissions'];
                                        $groupIdsAlreadyUsed[] = $result['object_id'];
                                }
                        }
@@ -86,10 +86,10 @@ class tx_beacl_userAuthGroup {
        /**
         * Returns a WHERE-clause for the pages-table where user permissions according to input argument, $perms, is validated.
         * $perms is the 'mask' used to select. Fx. if $perms is 1 then you'll get all pages that a user can actually see!
-        *                2^0 = show (1)
-        *               2^1 = edit (2)
-        *               2^2 = delete (4)
-        *               2^3 = new (8)
+        *              2^0 = show (1)
+        *              2^1 = edit (2)
+        *              2^2 = delete (4)
+        *              2^3 = new (8)
         * If the user is 'admin' " 1=1" is returned (no effect)
         * If the user is not set at all (->user is not an array), then " 1=0" is returned (will cause no selection results at all)
         * The 95% use of this function is "->getPagePermsClause(1)" which will return WHERE clauses for *selecting* pages in backend listings - in other words will this check read permissions.
@@ -99,52 +99,59 @@ class tx_beacl_userAuthGroup {
         * @return      string          Part of where clause. Prefix " AND " to this.
         */
 
-       function getPagePermsClause($params, $that) {
+       function getPagePermsClause($params, $that)     {
 
-               $fileCachePath = PATH_site . 'typo3temp/beacl_cache/';
-               $filename = $fileCachePath . 'ppc_' . md5($that->user['uid'] . $params['perms']) . ',cache';
-                       // Check if we can return something from cache
-               if (file_exists($filename)) {
-                       return t3lib_div::getURL($filename);
+               // Load cache from BE User data
+               $cache = array();
+               if (!empty($GLOBALS['BE_USER'])) {
+                 $cache = $GLOBALS['BE_USER']->getSessionData('be_acl');
                }
 
+                       // Check if we can return something from cache
+               if (is_array($cache[$that->user['uid']])
+                       && $cache[$that->user['uid']][$params['perms']]) {
+                       return $cache[$that->user['uid']][$params['perms']];
+               }
 
-               // get be_acl config in EM
+                       // get be_acl config in EM
                $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
-               if (!$beAclConfig['disableOldPermissionSystem']) {
+               if(!$beAclConfig['disableOldPermissionSystem']) {
                        $str = $params['currentClause'];
                } else {
                        $str = '1 = 2';
                }
-               // get some basic variables
+                       // get some basic variables
                $perms = $params['perms'];
-               $this->aclPageList = array();
+               $this->aclPageList = Array();
 
-               // get allowed IDs for user
+                       // get allowed IDs for user
                $this->getPagePermsClause_single(0, $that->user['uid'], $perms);
-               // get allowed IDs for every single group
-               if ($that->groupList) {
-                       $groupList = explode(',', $that->groupList);
-                       foreach ($groupList as $singleGroup) {
+                       // get allowed IDs for every single group
+               if($that->groupList) {
+                       $groupList = explode(',',$that->groupList);
+                       foreach($groupList as $singleGroup) {
                                $this->getPagePermsClause_single(1, $singleGroup, $perms);
                        }
                }
-               if (!empty($this->aclPageList)) {
-                       // put all page IDs together to the final SQL string
-                       $str = '( ' . $str . ' ) OR ( pages.uid IN (' . implode(',', $this->aclPageList) . ') )';
-
-                       // if the user is in a workspace, that has to be taken into account
-                       // see t3lib_BEfunc::getWorkspaceVersionOfRecord() for the source of this query
-                       if ($that->workspace) {
-                               $str .= ' OR ( pages.t3ver_wsid=' . intval($that->workspace) . ' AND pages.t3ver_oid IN (' . implode(',', $this->aclPageList) . ') )';
+               if(!empty($this->aclPageList)) {
+                               // put all page IDs together to the final SQL string
+                       $str = '( '.$str.' ) OR ( pages.uid IN ('.implode(',',$this->aclPageList).') )';
+
+                               // if the user is in a workspace, that has to be taken into account
+                               // see t3lib_BEfunc::getWorkspaceVersionOfRecord() for the source of this query
+                       if ($that->workspace)   {
+                               $str .= ' OR ( pages.t3ver_wsid='.intval($that->workspace).' AND pages.t3ver_oid IN ('.implode(',',$this->aclPageList).') )';
                        }
                }
 
-               // for safety, put whole where query part into brackets so it won't interfere with other parts of the page
-               $str = ' ( ' . $str . ' ) ';
+                       // for safety, put whole where query part into brackets so it won't interfere with other parts of the page
+               $str = ' ( '.$str.' ) ';
 
-               // Store data in cache
-               file_put_contents($filename, $str);
+                       // Store data in cache
+               $cache[$that->user['uid']][$params['perms']] = $str;
+               if (!empty($GLOBALS['BE_USER'])) {
+                       $GLOBALS['BE_USER']->setAndSaveSessionData('be_acl', $cache);
+               }
                return $str;
        }
 
@@ -159,38 +166,38 @@ class tx_beacl_userAuthGroup {
         * @return nothing, fills $this->aclPageList
         **/
        protected function getPagePermsClause_single($type, $object_id, $perms) {
-               // reset aclDisallowed
+                       // reset aclDisallowed
                $this->aclDisallowed = Array();
-               // 1. fetch all ACLs relevant for the current user/group
+                       // 1. fetch all ACLs relevant for the current user/group
                $aclAllowed = Array();
-               $where = ' ( (type = ' . intval($type) . ' AND object_id = ' . intval($object_id) . ')';
+               $where = ' ( (type = '.intval($type).' AND object_id = '.intval($object_id).')';
 
-               $whereAllow = ') AND (permissions & ' . $perms . ' = ' . $perms . ')';
-               $whereDeny = ') AND (permissions & ' . $perms . ' = 0)';
+               $whereAllow = ') AND (permissions & '.$perms.' = '.$perms.')';
+               $whereDeny = ') AND (permissions & '.$perms.' = 0)';
 
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                        'pid, recursive',
                        'tx_beacl_acl',
-                       $where . $whereAllow
+                       $where.$whereAllow
                );
-               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+               while($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $aclAllowed[] = $result;
                }
 
-               if ($aclAllowed) {
-                       // get all "deny" acls if there are allow ACLs
+               if($aclAllowed) {
+                               // get all "deny" acls if there are allow ACLs
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                'pid, recursive',
                                'tx_beacl_acl',
-                               $where . $whereDeny
+                               $where.$whereDeny
                        );
-                       while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       while($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $this->aclDisallowed[$result['pid']] = $result['recursive']; // only one ACL per group/user per page is allowed, that's why this line imposes no problem. It rather increases speed.
                        }
 
                        // go through all allowed ACLs, if it is not recursive, add the page to the aclPageList, if recursive, call recursion function
-                       foreach ($aclAllowed as $singleAllow) {
-                               if ($singleAllow['recursive'] == 0) {
+                       foreach($aclAllowed as $singleAllow) {
+                               if($singleAllow['recursive'] == 0) {
                                        $this->aclPageList[$singleAllow['pid']] = $singleAllow['pid'];
                                } else {
                                        $this->aclTraversePageTree($singleAllow['pid']);
@@ -207,95 +214,21 @@ class tx_beacl_userAuthGroup {
         * @return nothing, fills $this->aclPageList
         **/
        protected function aclTraversePageTree($pid) {
-
-               if (array_key_exists($pid, $this->aclDisallowed)) {
-                               // if there is a disallow ACL for the current page, don't add the page to the aclPageList
-                       if ($this->aclDisallowed[$pid] == 1) {
+                       // if there is a disallow ACL for the current page, don't add the page to the aclPageList
+               if(array_key_exists($pid, $this->aclDisallowed)) {
+                       if($this->aclDisallowed[$pid] == 1) {
                                return 0; // if recursive, stop processing
                        }
-               } else {
-                               // in case there is no disallow ACL, add page ID to aclPageList
+               } else { // in case there is no disallow ACL, add page ID to aclPageList
                        $this->aclPageList[$pid] = $pid;
                }
 
                        // find subpages and call function itself again
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . intval($pid) . ' AND deleted=0');
-               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid','pages', 'pid='.intval($pid).' AND deleted=0');
+               while($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $this->aclTraversePageTree($result['uid']);
                }
        }
-
-       /**
-        * hook for clear cache, works for "all" and "configuration" clear command
-        *
-        * @param array $params params for the hook
-        * @param object $pObj parent class (tcemain)
-        */
-       public function clearCache($params, $pObj) {
-               if ($params['cacheCmd'] == 'temp_CACHED' || $params['cacheCmd'] == 'all') {
-                       $this->clearBeaAclCache();
-               }
-       }
-
-       /**
-        * Hook tcemain for after database change action
-        *
-        * @param  string $status
-        * @param  string $table
-        * @param  string $id
-        * @param  array $fieldArray
-        * @param  t3lib_TCEmain $pObj
-        * @return void
-        */
-       public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, &$pObj) {
-               $beAclConfig = $this->getConfig();
-               $tables = t3lib_div::trimExplode(',', $beAclConfig['tablesForCacheClear'], TRUE);
-               if (in_array($table, $tables)) {
-                       $this->clearBeaAclCache();
-               }
-       }
-
-       /**
-        * Hook tcemain for after delete action
-        *
-        * @param  string $command
-        * @param  string $table
-        * @param  string $id
-        * @param  string $value
-        * @param  t3lib_TCEmain $pObj
-        * @return void
-        */
-       public function processCmdmap_postProcess ($command, $table ,$id, $value, &$pObj) {
-               $beAclConfig = $this->getConfig();
-               $tables = t3lib_div::trimExplode(',', $beAclConfig['tablesForCacheClear'], TRUE);
-               if ($command == 'delete' && in_array($table, $tables)) {
-                       $this->clearBeaAclCache();
-               }
-       }
-
-       /**
-        * Internal function for clearing cache
-        *
-        * @return void
-        */
-       protected function clearBeaAclCache() {
-               $tempPath = PATH_site . 'typo3temp/beacl_cache/';
-                       $handle = opendir($tempPath);
-                       while ($data = readdir($handle)) {
-                               if (!is_dir($data) && $data != "." && $data != "..") {
-                                       unlink($tempPath . $data);
-                               }
-                       }
-                       closedir($handle);
-       }
-
-       /**
-        * Gets the ext config
-        * @return array
-        */
-       protected function getConfig() {
-               return unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
-       }
 }
 
-?>
\ No newline at end of file
+?>
index 92cc765..a86d7e6 100644 (file)
-<?php
-
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2005 Sebastian Kurfuerst (sebastian@garbage-group.de)
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-/**
- * Backend ACL - Replacement for "web->Access"
- *
- * @author  Sebastian Kurfuerst <sebastian@garbage-group.de>
- */
-
-class ux_SC_mod_web_perm_index extends SC_mod_web_perm_index {
-
-
-
-       /*****************************
-        *
-        * Listing and Form rendering
-        *
-        *****************************/
-
-       /**
-        * Showing the permissions in a tree ($this->edit = false)
-        * (Adding content to internal content variable)
-        *
-        * @return      void
-        */
-       function notEdit()      {
-               global $BE_USER,$LANG,$BACK_PATH;
-
-               // get ACL configuration
-               $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
-               if ($beAclConfig['disableOldPermissionSystem']) {
-                       $disableOldPermissionSystem = 1;
-               } else {
-                       $disableOldPermissionSystem = 0;
-               }
-
-               $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');
-                       // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
-               $groupArray = $BE_USER->userGroupsUID;
-               $be_user_Array = t3lib_BEfunc::getUserNames();
-               if (!$GLOBALS['BE_USER']->isAdmin())            $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array,$groupArray,0);
-               $be_group_Array = t3lib_BEfunc::getGroupNames();
-               if (!$GLOBALS['BE_USER']->isAdmin())            $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array,$groupArray,0);
-
-                       // Length of strings:
-               $tLen= ($this->MOD_SETTINGS['mode']=='perms' ? 20 : 30);
-
-                       // Selector for depth:
-               $code.=$LANG->getLL('Depth').': ';
-               $code.=t3lib_BEfunc::getFuncMenu($this->id,'SET[depth]',$this->MOD_SETTINGS['depth'],$this->MOD_MENU['depth']);
-               $this->content.=$this->doc->section('',$code);
-               $this->content.=$this->doc->spacer(5);
-
-                       // Initialize tree object:
-               $tree = t3lib_div::makeInstance('t3lib_pageTree');
-               $tree->init('AND '.$this->perms_clause);
-
-               $tree->addField('perms_user',1);
-               $tree->addField('perms_group',1);
-               $tree->addField('perms_everybody',1);
-               $tree->addField('perms_userid',1);
-               $tree->addField('perms_groupid',1);
-               $tree->addField('hidden');
-               $tree->addField('fe_group');
-               $tree->addField('starttime');
-               $tree->addField('endtime');
-               $tree->addField('editlock');
-
-                       // Creating top icon; the current page
-               $HTML=t3lib_iconWorks::getIconImage('pages',$this->pageinfo,$BACK_PATH,'align="top"');
-               $tree->tree[]=Array('row'=>$this->pageinfo,'HTML'=>$HTML);
-
-                       // Create the tree from $this->id:
-               $tree->getTree($this->id,$this->MOD_SETTINGS['depth'],'');
-
-                       // get list of ACL users and groups, and initialize ACLs
-               $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig);
-               $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig);
-
-               $this->buildACLtree($aclUsers, $aclGroups);
-
-               $this->content.=$displayUserSelector;
-               $this->content.=$displayGroupSelector;
-
-
-                       // Make header of table:
-               $code='';
-
-               if ($this->MOD_SETTINGS['mode']=='perms')       {
-                       $code.='
-                               <tr>
-                                       <td class="bgColor2" colspan="2">&nbsp;</td>';
-                       $code.='
-                                       <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>';
-                       $tableCells = Array();
-                       if(!$disableOldPermissionSystem) {
-                               $tableCells[] = '<b>'.$LANG->getLL('Owner',1).'</b>';
-                               $tableCells[] = '<b>'.$LANG->getLL('Group',1).'</b>';
-                               $tableCells[] = '<b>'.$LANG->getLL('Everybody',1).'</b>';
-                       }
-                       // $tableCells[] = '<b>'.$LANG->getLL('EditLock',1).'</b>'; // TODO: Editlock
-
-                               // ACL headers
-                       if(!empty($aclUsers)) {
-                               $tableCells[] = '<b>'.$GLOBALS['LANG']->getLL('aclUser').'</b>';
-                               foreach($aclUsers as $uid) {
-                                       $tableCells[] = $be_user_Array[$uid]['username'];
-                               }
-                       }
-                       if(!empty($aclGroups)) {
-                               $tableCells[] = '<b>'.$GLOBALS['LANG']->getLL('aclGroup').'</b>';
-                               foreach($aclGroups as $uid) {
-                                       $tableCells[] = $be_group_Array[$uid]['title'];
-                               }
-                       }
-                       $code.=$this->printTableHeader($tableCells);
-                       $code .='</tr>';
-               } else {
-                       $code.='
-                               <tr>
-                                       <td class="bgColor2" colspan="2">&nbsp;</td>
-                                       <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                       <td class="bgColor2" align="center" nowrap="nowrap"><b>'.$LANG->getLL('User',1).':</b> '.$BE_USER->user['username'].'</td>
-                                       '.(!$BE_USER->isAdmin()?'<td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                       <td class="bgColor2" align="center"><b>'.$LANG->getLL('EditLock',1).'</b></td>':'').'
-                               </tr>';
-               }
-
-                       // Traverse tree:
-               foreach($tree->tree as $data)   {
-                       $cells = array();
-
-                               // Background colors:
-                       //if ($this->lastEdited==$data['row']['uid'])   {$bgCol = ' class="bgColor-20"';} else {$bgCol = '';}
-
-                       $bgCol = '';
-
-                       $lE_bgCol = $bgCol;
-
-                               // User/Group names:
-                       $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>['.$data['row']['perms_userid'].']!</i>' : '');
-                       $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title']  : ($data['row']['perms_groupid'] ? '<i>['.$data['row']['perms_groupid'].']!</i>' : '');
-                       $groupN = t3lib_div::fixed_lgd_cs($groupN,20);
-
-                               // Seeing if editing of permissions are allowed for that page:
-                       $editPermsAllowed=($data['row']['perms_userid']==$BE_USER->user['uid'] || $BE_USER->isAdmin());
-
-                               // First column:
-                       $cells[]='
-                                       <td align="left" nowrap="nowrap"'.$bgCol.$this->generateTitleAttribute($data['row']['uid'],$be_user_Array, $be_group_Array).'>'.$data['HTML'].htmlspecialchars(t3lib_div::fixed_lgd($data['row']['title'],$tLen)).'&nbsp;</td>';
-
-                               // "Edit permissions" -icon
-                       if ($editPermsAllowed && $data['row']['uid'])   {
-                               $aHref = 'index.php?mode='.$this->MOD_SETTINGS['mode'].'&depth='.$this->MOD_SETTINGS['depth'].'&id='.$data['row']['uid'].'&return_id='.$this->id.'&edit=1';
-                               $cells[]='
-                                       <td'.$bgCol.'><a href="'.htmlspecialchars($aHref).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/edit2.gif','width="11" height="12"').' border="0" title="'.$LANG->getLL('ch_permissions',1).'" align="top" alt="" /></a></td>';
-                       } else {
-                               $cells[]='
-                                       <td'.$bgCol.'></td>';
-                       }
-
-                               // Rest of columns (depending on mode)
-                       if ($this->MOD_SETTINGS['mode']=='perms')       {
-                               if(!$disableOldPermissionSystem) {
-                                       $cells[]='
-                                               <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                               <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?$this->printPerms($data['row']['perms_user']).' '.$userN:'').'</td>
-
-                                               <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                               <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?$this->printPerms($data['row']['perms_group']).' '.$groupN:'').'</td>
-
-                                               <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                               <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?' '.$this->printPerms($data['row']['perms_everybody']):'').'</td>';
-                               }
-
-                               /*$cells[] ='
-                                       <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                       <td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
-                               ';*/ // TODO: Editlock
-
-                                       // ACL rows
-                               if(!empty($aclUsers)) {
-                                       $cells[] = '<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td><td'.$bgCol.'>'.$this->countAcls($this->aclList[$data['row']['uid']][0]).'</td>';
-                                       foreach($aclUsers as $uid) {
-                                               $tmpBg = $bgCol;
-                                               if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl']))      {
-                                                       if ($this->aclList[$data['row']['uid']][0][$uid]['recursive'])  {
-                                                               $tmpBg = ' class="bgColor5"';
-                                                       } else {
-                                                               $tmpBg = ' class="bgColor6"';
-                                                       }
-                                               }
-
-                                               $cells[] = '<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                               <td'.$tmpBg.' nowrap="nowrap">'.($data['row']['uid']?' '.$this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']):'').'</td>';
-                                       }
-                               }
-                               if(!empty($aclGroups)) {
-                                       $cells[] = '<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td><td'.$bgCol.'>'.$this->countAcls($this->aclList[$data['row']['uid']][1]).'</td>';
-                                       foreach($aclGroups as $uid) {
-                                               $tmpBg = $bgCol;
-                                               if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl']))      {
-                                                       if ($this->aclList[$data['row']['uid']][1][$uid]['recursive'])  {
-                                                               $tmpBg = ' class="bgColor5"';
-                                                       } else {
-                                                               $tmpBg = ' class="bgColor6"';
-                                                       }
-                                               }
-                                               $cells[] = '<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                               <td'.$tmpBg.' nowrap="nowrap">'.($data['row']['uid']?' '.$this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']):'').'</td>';
-                                       }
-                               }
-
-                       } else {
-                               $cells[]='
-                                       <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>';
-
-                               if ($BE_USER->user['uid']==$data['row']['perms_userid'])        {$bgCol = ' class="bgColor-20"';} else {$bgCol = $lE_bgCol;}
-                               $cells[]='
-                                       <td'.$bgCol.' nowrap="nowrap" align="center">'.($data['row']['uid']?$owner.$this->printPerms($BE_USER->calcPerms($data['row'])):'').'</td>
-                                       '.(!$BE_USER->isAdmin()?'
-                                       <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
-                                       <td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
-                                       ':'');
-                               $bgCol = $lE_bgCol;
-                       }
-
-                               // Compile table row:
-                       $code.='
-                               <tr>
-                                       '.implode('
-                                       ',$cells).'
-                               </tr>';
-               }
-
-                       // Wrap rows in table tags:
-               $code='<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">'.$code.'</table>';
-
-                       // Adding the content as a section:
-               $this->content.=$this->doc->section('',$code);
-
-                       // CSH for permissions setting
-               $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'],'<br/>|');
-
-                       // Creating legend table:
-               $legendText = '<b>'.$LANG->getLL('1',1).'</b>: '.$LANG->getLL('1_t',1);
-               $legendText.= '<br /><b>'.$LANG->getLL('16',1).'</b>: '.$LANG->getLL('16_t',1);
-               $legendText.= '<br /><b>'.$LANG->getLL('2',1).'</b>: '.$LANG->getLL('2_t',1);
-               $legendText.= '<br /><b>'.$LANG->getLL('4',1).'</b>: '.$LANG->getLL('4_t',1);
-               $legendText.= '<br /><b>'.$LANG->getLL('8',1).'</b>: '.$LANG->getLL('8_t',1);
-
-               $code='<table border="0" id="typo3-legendTable">
-                       <tr>
-                               <td valign="top"><img src="legend.gif" width="86" height="75" alt="" /></td>
-                               <td valign="top" nowrap="nowrap">'.$legendText.'</td>
-                       </tr>
-               </table>';
-               $code.='<br />'.$LANG->getLL('def',1);
-               $code.='<br /><br /><span class="perm-allowed">*</span>: '.$LANG->getLL('A_Granted',1);
-               $code.='<br /><span class="perm-denied">x</span>: '.$LANG->getLL('A_Denied',1);
-
-                       // Adding section with legend code:
-               $this->content.=$this->doc->spacer(20);
-               $this->content.=$this->doc->section($LANG->getLL('Legend').':',$code,0,1);
-       }
-
-       /**
-        * Creating form for editing the permissions    ($this->edit = true)
-        * (Adding content to internal content variable)
-        *
-        * @return      void
-        */
-       function doEdit()       {
-               global $BE_USER,$LANG;
-
-                       // get ACL configuration
-               $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
-               if($beAclConfig['disableOldPermissionSystem']) {
-                       $disableOldPermissionSystem = 1;
-               } else {
-                       $disableOldPermissionSystem = 0;
-               }
-
-               $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');
-
-                       // Get usernames and groupnames
-               $be_group_Array=t3lib_BEfunc::getListGroupNames('title,uid');
-               $groupArray=array_keys($be_group_Array);
-
-               $be_user_Array = t3lib_BEfunc::getUserNames();
-               if (!$GLOBALS['BE_USER']->isAdmin())            $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array,$groupArray,1);
-               $be_group_Array_o = $be_group_Array = t3lib_BEfunc::getGroupNames();
-               if (!$GLOBALS['BE_USER']->isAdmin())            $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array_o,$groupArray,1);
-               $firstGroup = $groupArray[0] ? $be_group_Array[$groupArray[0]] : '';    // data of the first group, the user is member of
-
-
-                       // set JavaScript
-               $subPagesData = '';
-                       // generate list if record is available on subpages, if yes, enter the id
-               $this->content .= '<script src="../../../'.t3lib_extMgm::extRelPath('be_acl').'res/acl.js" type="text/javascript">
-                       '.$subPagesData.'
-               </script>';
-
-                       // Owner selector:
-               $options='';
-               $userset=0;     // flag: is set if the page-userid equals one from the user-list
-               foreach($be_user_Array as $uid => $row) {
-                       if ($uid==$this->pageinfo['perms_userid'])      {
-                               $userset = 1;
-                               $selected=' selected="selected"';
-                       } else {$selected='';}
-                       $options.='
-                               <option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['username']).'</option>';
-               }
-               $options='
-                               <option value="0"></option>'.$options;
-
-
-                       // hide selector if not needed
-               if($disableOldPermissionSystem) {
-                       $hidden = ' style="display:none;" ';
-               } else {
-                       $hidden = '';
-               }
-               $selector='
-                       <select name="data[pages]['.$this->id.'][perms_userid]" '.$hidden.'>
-                               '.$options.'
-                       </select>';
-
-               if ($disableOldPermissionSystem)        {
-                       $this->content.= $selector;
-               } else {
-                       $this->content.=$this->doc->section($LANG->getLL('Owner').':',$selector);
-               }
-
-                       // Group selector:
-               $options='';
-               $userset=0;
-               foreach($be_group_Array as $uid => $row)        {
-                       if ($uid==$this->pageinfo['perms_groupid'])     {
-                               $userset = 1;
-                               $selected=' selected="selected"';
-                       } else {$selected='';}
-                       $options.='
-                               <option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['title']).'</option>';
-               }
-               if (!$userset && $this->pageinfo['perms_groupid'])      {       // If the group was not set AND there is a group for the page
-                       $options='
-                               <option value="'.$this->pageinfo['perms_groupid'].'" selected="selected">'.
-                                               htmlspecialchars($be_group_Array_o[$this->pageinfo['perms_groupid']]['title']).
-                                               '</option>'.
-                                               $options;
-               }
-               $options='
-                               <option value="0"></option>'.$options;
-               $selector='
-                       <select name="data[pages]['.$this->id.'][perms_groupid]"  '.$hidden.'>
-                               '.$options.'
-                       </select>';
-
-               if ($disableOldPermissionSystem)        {
-                       $this->content.= $selector;
-               } else {
-                       $this->content.=$this->doc->divider(5);
-                       $this->content.=$this->doc->section($LANG->getLL('Group').':',$selector);
-               }
-                       // Permissions checkbox matrix:
-               $code='
-               <input type="hidden" name="pageID" value="'.$this->id.'" />
-                       <table border="0" cellspacing="2" cellpadding="0" id="typo3-permissionMatrix"><tbody>
-                               <tr>
-                                       <td></td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('1',1)).'</td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('16',1)).'</td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('2',1)).'</td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('4',1)).'</td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('8',1)).'</td>
-                                       <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('recursiveAcl',1)).'</td>
-                                       <td></td>
-                               </tr>';
-               if(!$disableOldPermissionSystem) {
-                       $code .= '
-                               <tr>
-                                       <td align="right" class="bgColor2">'.$LANG->getLL('Owner',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_user',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_user',5).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_user',2).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_user',3).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_user',4).'</td>
-                                       <td class="bgColor-20"></td>
-                                       <td></td>
-                               </tr>
-                               <tr>
-                                       <td align="right" class="bgColor2">'.$LANG->getLL('Group',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_group',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_group',5).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_group',2).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_group',3).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_group',4).'</td>
-                                       <td class="bgColor-20"></td>
-                                       <td></td>
-                               </tr>
-                               <tr>
-                                       <td align="right" class="bgColor2">'.$LANG->getLL('Everybody',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',1).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',5).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',2).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',3).'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',4).'</td>
-                                       <td class="bgColor-20"></td>
-                                       <td></td>
-                               </tr>';
-               }
-                       // ACL CODE
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid='.intval($this->id));
-               while($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $acl_prefix = 'data[tx_beacl_acl]['.$result['uid'].']';
-                       $code .= '<tr>
-                                       <td align="right" class="bgColor2"><select name="'.$acl_prefix.'[type]" onChange="updateUserGroup('.$result['uid'].')"><option value="0" '.($result['type']?'':'selected="selected"').'>User</option><option value="1" '.($result['type']?'selected="selected"':'').'>Group</option></select><select name="'.$acl_prefix.'[object_id]"></select></td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_acl_'.$result['uid'],1, 'data[tx_beacl_acl]['.$result['uid'].'][permissions]').'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_acl_'.$result['uid'],5, 'data[tx_beacl_acl]['.$result['uid'].'][permissions]').'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_acl_'.$result['uid'],2, 'data[tx_beacl_acl]['.$result['uid'].'][permissions]').'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_acl_'.$result['uid'],3, 'data[tx_beacl_acl]['.$result['uid'].'][permissions]').'</td>
-                                       <td class="bgColor-20">'.$this->printCheckBox('perms_acl_'.$result['uid'],4, 'data[tx_beacl_acl]['.$result['uid'].'][permissions]').'
-                                               <input type="hidden" name="'.$acl_prefix.'[permissions]" value="'.$result['permissions'].'" />
-
-                                               <script type="text/javascript">updateUserGroup('.$result['uid'].', '.$result['object_id'].');
-                                               setCheck("check[perms_acl_'.$result['uid'].']","data[tx_beacl_acl]['.$result['uid'].'][permissions]");
-                                               global_currentACLs[global_currentACLs.length] = '.$result['uid'].' ;
-                                               </script>
-
-                                       </td>
-                                       <td class="bgColor-20">
-                                               <input type="hidden" name="'.$acl_prefix.'[recursive]" value="0" />
-                                               <input type="checkbox" name="'.$acl_prefix.'[recursive]" value="1" '.($result['recursive']?'checked="checked"':'').' />
-                                       </td>
-                                       <td><a href="#" onClick="deleteACL('.$result['uid'].')"><img '.t3lib_iconWorks::skinImg('../../../', 'gfx/garbage.gif').' alt="'.$LANG->getLL('delAcl',1).'" /></a></td>
-                               </tr>';
-               }
-
-               $code .= '
-                               </tbody>
-                       </table>
-                       <br />
-                       <span id="insertHiddenFields"></span>
-                       <img '.t3lib_iconWorks::skinImg('../../../', 'gfx/garbage.gif').' alt="'.$LANG->getLL('delAcl',1).'" / id="templateDeleteImage" style="display:none">
-                       <a href="javascript:addACL()"><img  '.t3lib_iconWorks::skinImg('../../../', 'gfx/new_el.gif').' alt="'.$LANG->getLL('addAcl',1).'" />'.$LANG->getLL('addAcl',1).'</a><br>
-
-                       <input type="hidden" name="data[pages]['.$this->id.'][perms_user]" value="'.$this->pageinfo['perms_user'].'" />
-                       <input type="hidden" name="data[pages]['.$this->id.'][perms_group]" value="'.$this->pageinfo['perms_group'].'" />
-                       <input type="hidden" name="data[pages]['.$this->id.'][perms_everybody]" value="'.$this->pageinfo['perms_everybody'].'" />
-                       '.($disableOldPermissionSystem?'':$this->getRecursiveSelect($this->id,$this->perms_clause)).'
-                       <input type="submit" name="submit" value="'.$LANG->getLL('saveAndClose',1).'" />'.
-                       '<input type="submit" value="'.$LANG->getLL('Abort',1).'" onclick="'.htmlspecialchars('jumpToUrl(\'index.php?id='.$this->id.'\'); return false').'" />
-                       <input type="hidden" name="redirect" value="'.htmlspecialchars(TYPO3_MOD_PATH.'index.php?mode='.$this->MOD_SETTINGS['mode'].'&depth='.$this->MOD_SETTINGS['depth'].'&id='.intval($this->return_id).'&lastEdited='.$this->id).'" />
-               ';
-
-                       // Adding section with the permission setting matrix:
-               $this->content.=$this->doc->divider(5);
-               $this->content.=$this->doc->section($LANG->getLL('permissions').':',$code);
-
-                       // CSH for permissions setting
-               $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module_setting', $GLOBALS['BACK_PATH'],'<br/><br/>');
-
-                       // Adding help text:
-               if ($BE_USER->uc['helpText'])   {
-                       $this->content.=$this->doc->divider(20);
-                       $legendText = '<b>'.$LANG->getLL('1',1).'</b>: '.$LANG->getLL('1_t',1);
-                       $legendText.= '<br /><b>'.$LANG->getLL('16',1).'</b>: '.$LANG->getLL('16_t',1);
-                       $legendText.= '<br /><b>'.$LANG->getLL('2',1).'</b>: '.$LANG->getLL('2_t',1);
-                       $legendText.= '<br /><b>'.$LANG->getLL('4',1).'</b>: '.$LANG->getLL('4_t',1);
-                       $legendText.= '<br /><b>'.$LANG->getLL('8',1).'</b>: '.$LANG->getLL('8_t',1);
-
-                       $code=$legendText.'<br /><br />'.$LANG->getLL('def',1);
-                       $this->content.=$this->doc->section($LANG->getLL('Legend',1).':',$code);
-               }
-       }
-
-
-       /*****************************
-        *
-        * Helper functions
-        *
-        *****************************/
-        /**
-         * generates title attribute for pages
-               *
-               * @param        integer         UID of page
-               * @param        array           BE user array
-               * @param        array           BE group array
-               * @return       string          HTML: title attribute
-               */
-       function generateTitleAttribute($uid, $be_user_Array, $be_group_Array)  {
-
-               $composedStr = '';
-               $this->aclList[$uid];
-               if (!$this->aclList[$uid])      {return FALSE;}
-               foreach ($this->aclList[$uid] as $type => $v1)  {
-                       if (!$v1)       {return FALSE;}
-                       foreach ($v1 as $object_id => $v2)      {
-                               if ($v2['newAcl'])      {
-                                       if ($type == 1) { // group
-                                               $composedStr .= ' G:'.$be_group_Array[$object_id]['title'];
-                                       } else {
-                                               $composedStr .= ' U:'.$be_user_Array[$object_id]['username'];
-                                       }
-                               }
-                       }
-               }
-               return ' title="'.$composedStr.'"'.($composedStr?' class="bgColor5"':'');
-       }
-       /**
-        * outputs a selector for users / groups, returns current ACLs
-        *
-        * @param       integer         type of ACL. 0 -> user, 1 -> group
-        * @param       string          Pointer where the display code is stored
-        * @param       array           configuration of ACLs
-        * @return      array           list of groups/users where the ACLs will be shown
-        */
-       function acl_objectSelector($type, &$displayPointer, $conf) {
-               global $BE_USER;
-               $aclObjects = Array();
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       'tx_beacl_acl.object_id AS object_id, tx_beacl_acl.type AS type',
-                       'tx_beacl_acl, be_groups, be_users',
-                       'tx_beacl_acl.type='.intval($type).' AND ((tx_beacl_acl.object_id=be_groups.uid AND tx_beacl_acl.type=1) OR (tx_beacl_acl.object_id=be_users.uid AND tx_beacl_acl.type=0))',
-                       '',
-                       'be_groups.title ASC, be_users.realname ASC'
-               );
-               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $aclObjects[] = $result['object_id'];
-               }
-               $aclObjects = array_unique($aclObjects);
-                       // advanced selector disabled
-               if(!$conf['enableFilterSelector']) {
-                       return $aclObjects;
-               }
-
-               if(!empty($aclObjects)) {
-
-                               // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
-                       $groupArray = $BE_USER->userGroupsUID;
-                       $be_user_Array = t3lib_BEfunc::getUserNames();
-                       if (!$GLOBALS['BE_USER']->isAdmin())            $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array,$groupArray,0);
-                       $be_group_Array = t3lib_BEfunc::getGroupNames();
-                       if (!$GLOBALS['BE_USER']->isAdmin())            $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array,$groupArray,0);
-
-                               // get current selection from UC, merge data, write it back to UC
-                       $currentSelection = is_array($BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type]) ? $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] : array();
-
-                       $currentSelectionOverride_raw = t3lib_div::_GP('tx_beacl_objsel');
-                       $currentSelectionOverride = Array();
-                       if(is_array($currentSelectionOverride_raw[$type])) {
-                               foreach($currentSelectionOverride_raw[$type] as $tmp) {
-                                       $currentSelectionOverride[$tmp] = $tmp;
-                               }
-                       }
-                       if ($currentSelectionOverride) {
-                               $currentSelection = $currentSelectionOverride;
-                       }
-                       $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] = $currentSelection;
-                       $BE_USER->writeUC($BE_USER->uc);
-
-                               // display selector
-                       $displayCode = '<select size="'.t3lib_div::intInRange(count($aclObjects),5,15).'" name="tx_beacl_objsel['.$type.'][]" multiple="multiple">';
-                       foreach($aclObjects as $singleObjectId) {
-                               if($type == 0)
-                                       $tmpnam = $be_user_Array[$singleObjectId]['username'];
-                               else
-                                       $tmpnam = $be_group_Array[$singleObjectId]['title'];
-
-                               $displayCode .= '<option value="'.$singleObjectId.'" '.(@in_array($singleObjectId, $currentSelection)?'selected':'').'>'.$tmpnam.'</option>';
-                       }
-
-                       $displayCode .= '</select>';
-                       $displayCode .= '<br /><input type="button" value="'.$GLOBALS['LANG']->getLL('aclObjSelUpdate').'" onClick="document.editform.action=document.location; document.editform.submit()" /><p />';
-
-                               // create section
-                       switch($type) {
-                               case 0:
-                                       $tmpnam = 'aclUsers';
-                                       break;
-                               default:
-                                       $tmpnam = 'aclGroups';
-                                       break;
-                       }
-                       $displayPointer = $this->doc->section($GLOBALS['LANG']->getLL($tmpnam,1),$displayCode);
-
-                       return $currentSelection;
-               }
-               return NULL;
-       }
-
-
-       /**
-        * returns a datastructure: pageid - userId / groupId - permissions
-        *
-        * @param       array           user ID list
-        * @param       array           group ID list
-        */
-       function buildACLtree($users, $groups) {
-
-                       // get permissions in the starting point for users and groups
-               $rootLine = t3lib_BEfunc::BEgetRootLine($this->id);
-
-               $userStartPermissions = array();
-               $groupStartPermissions = array();
-
-               array_shift($rootLine); // needed as a starting point
-
-               foreach($rootLine as $level => $values) {
-                       $recursive = ' AND recursive=1';
-
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions', 'tx_beacl_acl', 'pid='.intval($values['uid']).$recursive);
-
-                       while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               if ($result['type'] == 0
-                                       && in_array($result['object_id'], $users)
-                                       && !array_key_exists($result['object_id'], $userStartPermissions)) {
-                                       $userStartPermissions[$result['object_id']] = $result['permissions'];
-                               } elseif ($result['type'] == 1
-                                       && in_array($result['object_id'], $groups)
-                                       && !array_key_exists($result['object_id'], $groupStartPermissions)) {
-                                       $groupStartPermissions[$result['object_id']] = $result['permissions'];
-                               }
-                       }
-               }
-               foreach($userStartPermissions as $oid => $perm) {
-                       $startPerms[0][$oid]['permissions'] = $perm;
-                       $startPerms[0][$oid]['recursive'] = 1;
-               }
-               foreach($groupStartPermissions as $oid => $perm) {
-                       $startPerms[1][$oid]['permissions'] = $perm;
-                       $startPerms[1][$oid]['recursive'] = 1;
-               }
-
-
-               $this->traversePageTree_acl($startPerms,$rootLine[0]['uid']);
-
-               // check if there are any ACLs on these pages
-               // build a recursive function traversing through the pagetree
-       }
-
-       function countAcls($pageData)   {
-               $i = 0;
-               if (!$pageData) return '';
-               foreach ($pageData as $aclId => $values)        {
-                       if ($values['newAcl'])  {
-                               $i+=$values['newAcl'];
-                       }
-               }
-               return ($i?$i:'');
-       }
-
-       /**
-        * build ACL tree
-        */
-       function traversePageTree_acl($parentACLs, $uid) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions, recursive', 'tx_beacl_acl', 'pid='.intval($uid));
-
-               $hasNoRecursive = array();
-               $this->aclList[$uid] = $parentACLs;
-               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $permissions = array (
-                                       'permissions' => $result['permissions'],
-                                       'recursive' => $result['recursive'],
-                               );
-                       if($result['recursive'] == 0) {
-                               if ($this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'])      {
-                                       $permissions['newAcl'] = $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'];
-                               }
-                               $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;
-                               $permissions['newAcl'] = 1;
-                               $hasNoRecursive[$uid][$result['type']][$result['object_id']] = $permissions;
-                       } else {
-                               $parentACLs[$result['type']][$result['object_id']] = $permissions;
-                               if (is_array($hasNoRecursive[$uid][$result['type']][$result['object_id']]))     {
-                                       $this->aclList[$uid][$result['type']][$result['object_id']] = $hasNoRecursive[$uid][$result['type']][$result['object_id']];
-                               } else {
-                                       $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;
-                               }
-                       }
-                       $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'] += 1;
-               }
-
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid='.intval($uid).' AND deleted=0');
-               while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $this->traversePageTree_acl($parentACLs, $result['uid']);
-               }
-       }
-
-       /**
-        * prints table header
-        *
-        * @param       array           array of cells
-        * @return      string          HTML output for the cells
-        */
-       function printTableHeader($cells)       {
-               global $BACK_PATH;
-               $verticalDivider = '<td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>';
-               $wrappedCells = Array();
-               foreach($cells as $singleCell) {
-                       $wrappedCells[] = '<td class="bgColor2" align="center"><b>'.$singleCell.'</b></td>';
-               }
-               return implode($verticalDivider,$wrappedCells);
-
-       }
-
-       /**
-        * Print a checkbox for the edit-permission form
-        *
-        * @param       string          Checkbox name key
-        * @param       integer         Checkbox number index
-        * @param string                Result sting, not mandatory
-        * @return      string          HTML checkbox
-        */
-       function printCheckBox($checkName,$num, $result = '')   {
-               if(empty($result)) {
-                       $result = 'data[pages]['.$GLOBALS['SOBE']->id.']['.$checkName.']';
-               }
-
-               $onClick = 'checkChange(\'check['.$checkName.']\', \''.$result.'\')';
-               return '<input type="checkbox" name="check['.$checkName.']['.$num.']" onclick="'.htmlspecialchars($onClick).'" /><br />';
-       }
-
-       /**
-        * Print a set of permissions
-        *
-        * @param       integer         Permission integer (bits)
-        * @return      string          HTML marked up x/* indications.
-        */
-       function printPerms($int)       {
-               $str='';
-               $str.= (($int&1)?'*':'<span class="perm-denied">x</span>');
-               $str.= (($int&16)?'*':'<span class="perm-denied">x</span>');
-               $str.= (($int&2)?'*':'<span class="perm-denied">x</span>');
-               $str.= (($int&4)?'*':'<span class="perm-denied">x</span>');
-               $str.= (($int&8)?'*':'<span class="perm-denied">x</span>');
-
-               return '<span class="perm-allowed">'.$str.'</span>';
-       }
-
-
-}
-?>
+<?php\r
+\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2005 Sebastian Kurfuerst (sebastian@garbage-group.de)\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Backend ACL - Replacement for "web->Access"\r
+ *\r
+ * @author  Sebastian Kurfuerst <sebastian@garbage-group.de>\r
+ *\r
+ * Bugfixes applied:\r
+ * #25942, #25835, #13019, #13176, #13175 Jan Bartels\r
+ */\r
+class ux_SC_mod_web_perm_index extends SC_mod_web_perm_index {\r
+\r
+    /*****************************\r
+     *\r
+     * Listing and Form rendering\r
+     *\r
+     *****************************/\r
+\r
+    /**\r
+     * Showing the permissions in a tree ($this->edit = false)\r
+     * (Adding content to internal content variable)\r
+     *\r
+     * @return    void\r
+     */\r
+    public function notEdit() {\r
+        global $BE_USER, $LANG, $BACK_PATH;\r
+\r
+        // Get ACL configuration\r
+        $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);\r
+        $disableOldPermissionSystem = 0;\r
+        if ($beAclConfig['disableOldPermissionSystem']) {\r
+            $disableOldPermissionSystem = 1;\r
+        }\r
+        $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');\r
+\r
+        // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of\r
+        $beGroupKeys = $BE_USER->userGroupsUID;\r
+        $beUserArray = t3lib_BEfunc::getUserNames();\r
+        if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+            $beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 0);\r
+        }\r
+        $beGroupArray = t3lib_BEfunc::getGroupNames();\r
+        if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+            $beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray, $beGroupKeys, 0);\r
+        }\r
+\r
+        // Length of strings:\r
+        $tLen = ($this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30);\r
+\r
+\r
+        // Selector for depth:\r
+        $code .= $LANG->getLL('Depth') . ': ';\r
+        $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);\r
+        $this->content .= $this->doc->section('', $code);\r
+        $this->content .= $this->doc->spacer(5);\r
+\r
+        // Initialize tree object:\r
+        $tree = t3lib_div::makeInstance('t3lib_pageTree');\r
+        $tree->init('AND ' . $this->perms_clause);\r
+\r
+        $tree->addField('perms_user', 1);\r
+        $tree->addField('perms_group', 1);\r
+        $tree->addField('perms_everybody', 1);\r
+        $tree->addField('perms_userid', 1);\r
+        $tree->addField('perms_groupid', 1);\r
+        $tree->addField('hidden');\r
+        $tree->addField('fe_group');\r
+        $tree->addField('starttime');\r
+        $tree->addField('endtime');\r
+        $tree->addField('editlock');\r
+\r
+        // Creating top icon; the current page\r
+        $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo);\r
+        $tree->tree[] = array(\r
+            'row' => $this->pageinfo,\r
+            'HTML' => $HTML\r
+        );\r
+\r
+        // Create the tree from $this->id:\r
+        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');\r
+\r
+        // Get list of ACL users and groups, and initialize ACLs\r
+        $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig);\r
+        $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig);\r
+\r
+        $this->buildACLtree($aclUsers, $aclGroups);\r
+\r
+        $this->content .= $displayUserSelector;\r
+        $this->content .= $displayGroupSelector;\r
+\r
+        // Make header of table:\r
+        $code = '';\r
+        if ($this->MOD_SETTINGS['mode'] == 'perms') {\r
+            $code .= '\r
+                <tr class="t3-row-header">\r
+                    <td colspan="2">&nbsp;</td>\r
+                    <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';\r
+            $tableCells = array();\r
+            if (!$disableOldPermissionSystem) {\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('User', TRUE);\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('Group', TRUE);\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('Everybody', TRUE);\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('EditLock', TRUE);\r
+            }\r
+            // ACL headers\r
+            if (!empty($aclUsers)) {\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('aclUser');\r
+                foreach ($aclUsers as $uid) {\r
+                    $tableCells[] = $beUserArray[$uid]['username'];\r
+                }\r
+            }\r
+            if (!empty($aclGroups)) {\r
+                $tableCells[] = $GLOBALS['LANG']->getLL('aclGroup');\r
+                foreach ($aclGroups as $uid) {\r
+                    $tableCells[] = $beGroupArray[$uid]['title'];\r
+                }\r
+            }\r
+            $code .= $this->printTableHeader($tableCells);\r
+            $code .= '\r
+                </tr>';\r
+        } else {\r
+            $code .= '\r
+                <tr class="t3-row-header">\r
+                    <td colspan="2">&nbsp;</td>\r
+                    <td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                    <td align="center" nowrap="nowrap">' . $LANG->getLL('User', TRUE) . ': ' . htmlspecialchars($BE_USER->user['username']) . '</td>\r
+                    ' . (!$BE_USER->isAdmin() ? '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                    <td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>' : '') . '\r
+                </tr>';\r
+        }\r
+\r
+        // Traverse tree:\r
+        foreach ($tree->tree as $data) {\r
+            $cells = array();\r
+            $pageId = $data['row']['uid'];\r
+\r
+            // Background colors:\r
+            $bgCol = ($this->lastEdited == $pageId ? ' class="bgColor-20"' : '');\r
+            $lE_bgCol = $bgCol;\r
+\r
+            // User/Group names:\r
+            $userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');\r
+            if ($data['row']['perms_userid'] && (!$beUserArray[$data['row']['perms_userid']])) {\r
+                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)), FALSE);\r
+            } else {\r
+                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)));\r
+            }\r
+\r
+            $groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '');\r
+            if ($data['row']['perms_groupid'] && (!$beGroupArray[$data['row']['perms_groupid']])) {\r
+                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)), FALSE);\r
+            } else {\r
+                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)));\r
+            }\r
+\r
+            // Seeing if editing of permissions are allowed for that page:\r
+            $editPermsAllowed = ($data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin());\r
+\r
+\r
+            // First column:\r
+            $cellAttrib = ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '');\r
+            $cells[] = '\r
+                    <td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';\r
+\r
+            // "Edit permissions" -icon\r
+            if ($editPermsAllowed && $pageId) {\r
+                $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1';\r
+                $cells[] = '\r
+                    <td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $LANG->getLL('ch_permissions', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>';\r
+            } else {\r
+                $cells[] = '\r
+                    <td' . $bgCol . '></td>';\r
+            }\r
+\r
+            // Rest of columns (depending on mode)\r
+            if ($this->MOD_SETTINGS['mode'] == 'perms') {\r
+                if (!$disableOldPermissionSystem) {\r
+                    $cells[] = '\r
+                        <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_user']) . ' ' . $userName : '') . '</td>\r
+\r
+                        <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_group']) . ' ' . $groupName : '') . '</td>\r
+\r
+                        <td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($data['row']['perms_everybody']) : '') . '</td>\r
+\r
+                        <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $LANG->getLL('EditLock_descr', 1) . '">' .\r
+                            t3lib_iconWorks::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>')) . '</td>';\r
+                }\r
+\r
+                // ACL rows\r
+                if (!empty($aclUsers)) {\r
+                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][0]) . '</td>';\r
+                    foreach ($aclUsers as $uid) {\r
+                        $tmpBg = $bgCol;\r
+                        if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl'])) {\r
+                            if ($this->aclList[$data['row']['uid']][0][$uid]['recursive']) {\r
+                                $tmpBg = ' class="bgColor5"';\r
+                            } else {\r
+                                $tmpBg = ' class="bgColor6"';\r
+                            }\r
+                        }\r
+\r
+                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']) : '') . '</td>';\r
+                    }\r
+                }\r
+\r
+                if (!empty($aclGroups)) {\r
+                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][1]) . '</td>';\r
+                    foreach ($aclGroups as $uid) {\r
+                        $tmpBg = $bgCol;\r
+                        if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl'])) {\r
+                            if ($this->aclList[$data['row']['uid']][1][$uid]['recursive']) {\r
+                                $tmpBg = ' class="bgColor5"';\r
+                            } else {\r
+                                $tmpBg = ' class="bgColor6"';\r
+                            }\r
+                        }\r
+                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                        <td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']) : '') . '</td>';\r
+                    }\r
+                }\r
+            } else {\r
+                $cells[] = '\r
+                    <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';\r
+\r
+                $bgCol = ($BE_USER->user['uid'] == $data['row']['perms_userid'] ? ' class="bgColor-20"' : $lE_bgCol);\r
+\r
+                // FIXME $owner undefined\r
+                $cells[] = '\r
+                    <td' . $bgCol . ' nowrap="nowrap" align="center">' . ($pageId ? $owner . SC_mod_web_perm_ajax::renderPermissions($BE_USER->calcPerms($data['row']), $pageId, 'user') : '') . '</td>\r
+                    ' . (!$BE_USER->isAdmin() ? '\r
+                    <td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>\r
+                    <td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? t3lib_iconWorks::getSpriteIcon('status-warning-lock', array('title' => $LANG->getLL('EditLock_descr', TRUE))) : '') . '</td>\r
+                    ' : '');\r
+                $bgCol = $lE_bgCol;\r
+            }\r
+\r
+            // Compile table row:\r
+            $code .= '\r
+                <tr>\r
+                    ' . implode('\r
+                    ', $cells) . '\r
+                </tr>';\r
+        }\r
+\r
+        // Wrap rows in table tags:\r
+        $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>';\r
+\r
+        // Adding the content as a section:\r
+        $this->content .= $this->doc->section('', $code);\r
+\r
+        // CSH for permissions setting\r
+        $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br />|');\r
+\r
+        // Creating legend table:\r
+        $legendText = '<strong>' . $LANG->getLL('1', 1) . '</strong>: ' . $LANG->getLL('1_t', 1);\r
+        $legendText .= '<br /><strong>' . $LANG->getLL('16', 1) . '</strong>: ' . $LANG->getLL('16_t', 1);\r
+        $legendText .= '<br /><strong>' . $LANG->getLL('2', 1) . '</strong>: ' . $LANG->getLL('2_t', 1);\r
+        $legendText .= '<br /><strong>' . $LANG->getLL('4', 1) . '</strong>: ' . $LANG->getLL('4_t', 1);\r
+        $legendText .= '<br /><strong>' . $LANG->getLL('8', 1) . '</strong>: ' . $LANG->getLL('8_t', 1);\r
+\r
+        $code = '<table border="0" id="typo3-legendTable">\r
+            <tr>\r
+                <td valign="top">\r
+                    <img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />\r
+                </td>\r
+                <td valign="top" nowrap="nowrap">' . $legendText . '</td>\r
+            </tr>\r
+        </table>';\r
+        $code .= '<div id="perm-legend">' . $LANG->getLL('def', 1);\r
+        $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1);\r
+        $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1);\r
+        $code .= '</div>';\r
+\r
+        // Adding section with legend code:\r
+        $this->content .= $this->doc->spacer(20);\r
+        $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1);\r
+    }\r
+\r
+    /**\r
+     * Creating form for editing the permissions    ($this->edit = true)\r
+     * (Adding content to internal content variable)\r
+     *\r
+     * @return    void\r
+     */\r
+    public function doEdit() {\r
+        global $BE_USER, $LANG;\r
+\r
+        // Get ACL configuration\r
+        $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);\r
+        $disableOldPermissionSystem = 0;\r
+        if ($beAclConfig['disableOldPermissionSystem']) {\r
+            $disableOldPermissionSystem = 1;\r
+        }\r
+        $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');\r
+\r
+        if ($BE_USER->workspace != 0) {\r
+            // Adding section with the permission setting matrix:\r
+            $lockedMessage = t3lib_div::makeInstance(\r
+                't3lib_FlashMessage',\r
+                $LANG->getLL('WorkspaceWarningText'),\r
+                $LANG->getLL('WorkspaceWarning'),\r
+                t3lib_FlashMessage::WARNING\r
+            );\r
+            t3lib_FlashMessageQueue::addMessage($lockedMessage);\r
+        }\r
+\r
+        // Get usernames and groupnames\r
+        $beGroupArray = t3lib_BEfunc::getListGroupNames('title,uid');\r
+        $beGroupKeys = array_keys($beGroupArray);\r
+\r
+        $beUserArray = t3lib_BEfunc::getUserNames();\r
+        if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+            $beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 1);\r
+        }\r
+        $beGroupArray_o = $beGroupArray = t3lib_BEfunc::getGroupNames();\r
+        if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+            $beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray_o, $beGroupKeys, 1);\r
+        }\r
+        $firstGroup = $beGroupKeys[0] ? $beGroupArray[$beGroupKeys[0]] : ''; // data of the first group, the user is member of\r
+\r
+        // Set JavaScript\r
+        // Generate list if record is available on subpages, if yes, enter the id\r
+        $this->content .= '<script src="../../../' . t3lib_extMgm::extRelPath('be_acl') .\r
+            'res/acl.js" type="text/javascript"></script>';\r
+\r
+        // Owner selector:\r
+        $options = '';\r
+        $userset = 0; // flag: is set if the page-userid equals one from the user-list\r
+        foreach ($beUserArray as $uid => $row) {\r
+            if ($uid == $this->pageinfo['perms_userid']) {\r
+                $userset = 1;\r
+                $selected = ' selected="selected"';\r
+            } else {\r
+                $selected = '';\r
+            }\r
+            $options .= '\r
+                <option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';\r
+        }\r
+        $options = '\r
+                <option value="0"></option>' . $options;\r
+\r
+        // Hide selector if not needed\r
+        if ($disableOldPermissionSystem) {\r
+            $hidden = ' style="display:none;" ';\r
+        } else {\r
+            $hidden = '';\r
+        }\r
+\r
+        $selector = '\r
+            <select name="data[pages][' . $this->id . '][perms_userid]"' . $hidden . '>\r
+                ' . $options . '\r
+            </select>';\r
+\r
+        if ($disableOldPermissionSystem) {\r
+            $this->content .= $selector;\r
+        } else {\r
+            $this->content .= $this->doc->section($LANG->getLL('Owner') . ':', $selector);\r
+        }\r
+\r
+        // Group selector:\r
+        $options = '';\r
+        $userset = 0;\r
+        foreach ($beGroupArray as $uid => $row) {\r
+            if ($uid == $this->pageinfo['perms_groupid']) {\r
+                $userset = 1;\r
+                $selected = ' selected="selected"';\r
+            } else {\r
+                $selected = '';\r
+            }\r
+            $options .= '\r
+                <option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';\r
+        }\r
+        if (!$userset && $this->pageinfo['perms_groupid']) { // If the group was not set AND there is a group for the page\r
+            $options = '\r
+                <option value="' . $this->pageinfo['perms_groupid'] . '" selected="selected">' .\r
+                htmlspecialchars($beGroupArray_o[$this->pageinfo['perms_groupid']]['title']) .\r
+                '</option>' .\r
+                $options;\r
+        }\r
+        $options = '\r
+                <option value="0"></option>' . $options;\r
+        $selector = '\r
+            <select name="data[pages][' . $this->id . '][perms_groupid]"' . $hidden . '>\r
+                ' . $options . '\r
+            </select>';\r
+\r
+        if ($disableOldPermissionSystem) {\r
+            $this->content .= $selector;\r
+        } else {\r
+            $this->content .= $this->doc->divider(5);\r
+            $this->content .= $this->doc->section($LANG->getLL('Group') . ':', $selector);\r
+        }\r
+\r
+        // Permissions checkbox matrix:\r
+        $code = '\r
+            <input type="hidden" name="pageID" value="' . $this->id . '" />\r
+            <table border="0" cellspacing="2" cellpadding="0" id="typo3-permissionMatrix">\r
+                <tr>\r
+                    <td></td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('1', 1)) . '</td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('16', 1)) . '</td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('2', 1)) . '</td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('4', 1)) . '</td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('8', 1)) . '</td>\r
+                    <td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('recursiveAcl', 1)) . '</td>\r
+                    <td></td>\r
+                </tr>';\r
+        if (!$disableOldPermissionSystem) {\r
+            $code .= '\r
+                <tr>\r
+                    <td align="right" class="bgColor2">' . $LANG->getLL('Owner', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_user', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_user', 5) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_user', 2) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_user', 3) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_user', 4) . '</td>\r
+                    <td class="bgColor-20"></td>\r
+                    <td></td>\r
+                </tr>\r
+                <tr>\r
+                    <td align="right" class="bgColor2">' . $LANG->getLL('Group', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_group', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_group', 5) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_group', 2) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_group', 3) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_group', 4) . '</td>\r
+                    <td class="bgColor-20"></td>\r
+                    <td></td>\r
+                </tr>\r
+                <tr>\r
+                    <td align="right" class="bgColor2">' . $LANG->getLL('Everybody', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_everybody', 1) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_everybody', 5) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_everybody', 2) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_everybody', 3) . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_everybody', 4) . '</td>\r
+                    <td class="bgColor-20"></td>\r
+                    <td></td>\r
+                </tr>';\r
+        }\r
+\r
+        // ACL CODE\r
+        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid=' . intval($this->id));\r
+        while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+            $acl_prefix = 'data[tx_beacl_acl][' . $result['uid'] . ']';\r
+            $code .= '<tr>\r
+                    <td align="right" class="bgColor2"><select name="' . $acl_prefix . '[type]" onChange="updateUserGroup(' . $result['uid'] . ')"><option value="0" ' . ($result['type'] ? '' : 'selected="selected"') . '>User</option><option value="1" ' . ($result['type'] ? 'selected="selected"' : '') . '>Group</option></select><select name="' . $acl_prefix . '[object_id]"></select></td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_acl_' . $result['uid'], 1, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_acl_' . $result['uid'], 5, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_acl_' . $result['uid'], 2, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_acl_' . $result['uid'], 3, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '</td>\r
+                    <td class="bgColor-20">' . $this->printCheckBox('perms_acl_' . $result['uid'], 4, 'data[tx_beacl_acl][' . $result['uid'] . '][permissions]') . '\r
+                        <input type="hidden" name="' . $acl_prefix . '[permissions]" value="' . $result['permissions'] . '" />\r
+\r
+                        <script type="text/javascript">updateUserGroup(' . $result['uid'] . ', ' . $result['object_id'] . ');\r
+                        setCheck("check[perms_acl_' . $result['uid'] . ']","data[tx_beacl_acl][' . $result['uid'] . '][permissions]");\r
+                        global_currentACLs[global_currentACLs.length] = ' . $result['uid'] . ' ;\r
+                        </script>\r
+\r
+                    </td>\r
+                    <td class="bgColor-20">\r
+                        <input type="hidden" name="' . $acl_prefix . '[recursive]" value="0" />\r
+                        <input type="checkbox" name="' . $acl_prefix . '[recursive]" value="1" ' . ($result['recursive'] ? 'checked="checked"' : '') . ' />\r
+                    </td>\r
+                    <td><a href="#" onClick="deleteACL(' . $result['uid'] . ')"><img ' . t3lib_iconWorks::skinImg('../../../', 'gfx/garbage.gif') . ' alt="' . $LANG->getLL('delAcl', 1) . '" /></a></td>\r
+                </tr>';\r
+        }\r
+\r
+        $code .= '\r
+            </table>\r
+            <br />\r
+            <span id="insertHiddenFields"></span>\r
+            <img ' . t3lib_iconWorks::skinImg('../../../', 'gfx/garbage.gif') . ' alt="' . $LANG->getLL('delAcl', 1) . '" / id="templateDeleteImage" style="display:none">\r
+            <a href="javascript:addACL()"><img  ' . t3lib_iconWorks::skinImg('../../../', 'gfx/new_el.gif') . ' alt="' . $LANG->getLL('addAcl', 1) . '" />' . $LANG->getLL('addAcl', 1) . '</a><br>\r
+\r
+            <input type="hidden" name="data[pages][' . $this->id . '][perms_user]" value="' . $this->pageinfo['perms_user'] . '" />\r
+            <input type="hidden" name="data[pages][' . $this->id . '][perms_group]" value="' . $this->pageinfo['perms_group'] . '" />\r
+            <input type="hidden" name="data[pages][' . $this->id . '][perms_everybody]" value="' . $this->pageinfo['perms_everybody'] . '" />\r
+            ' . ($disableOldPermissionSystem ? '' : $this->getRecursiveSelect($this->id, $this->perms_clause)) . '\r
+            <input type="submit" name="submit" value="' . $LANG->getLL('saveAndClose', 1) . '" />' .\r
+            '<input type="submit" value="' . $LANG->getLL('Abort', 1) . '" onclick="' . htmlspecialchars('jumpToUrl(\'index.php?id=' . $this->id . '\'); return false;') . '" />\r
+            <input type="hidden" name="redirect" value="' . htmlspecialchars(TYPO3_MOD_PATH . 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . intval($this->return_id) . '&lastEdited=' . $this->id) . '" />\r
+        ' . t3lib_TCEforms::getHiddenTokenField('tceAction');\r
+\r
+        // Adding section with the permission setting matrix:\r
+        $this->content .= $this->doc->divider(5);\r
+        $this->content .= $this->doc->section($LANG->getLL('permissions') . ':', $code);\r
+\r
+        // CSH for permissions setting\r
+        $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module_setting', $GLOBALS['BACK_PATH'], '<br /><br />');\r
+\r
+        // Adding help text:\r
+        if ($BE_USER->uc['helpText']) {\r
+            $this->content .= $this->doc->divider(20);\r
+            $legendText = '<strong>' . $LANG->getLL('1', 1) . '</strong>: ' . $LANG->getLL('1_t', 1);\r
+            $legendText .= '<br /><strong>' . $LANG->getLL('16', 1) . '</strong>: ' . $LANG->getLL('16_t', 1);\r
+            $legendText .= '<br /><strong>' . $LANG->getLL('2', 1) . '</strong>: ' . $LANG->getLL('2_t', 1);\r
+            $legendText .= '<br /><strong>' . $LANG->getLL('4', 1) . '</strong>: ' . $LANG->getLL('4_t', 1);\r
+            $legendText .= '<br /><strong>' . $LANG->getLL('8', 1) . '</strong>: ' . $LANG->getLL('8_t', 1);\r
+\r
+            $code = $legendText . '<br /><br />' . $LANG->getLL('def', 1);\r
+            $this->content .= $this->doc->section($LANG->getLL('Legend', 1) . ':', $code);\r
+        }\r
+    }\r
+\r
+    /*****************************\r
+     *\r
+     * Helper functions\r
+     *\r
+     *****************************/\r
+    /**\r
+     * generates title attribute for pages\r
+     *\r
+     * @param    integer        UID of page\r
+     * @param    array        BE user array\r
+     * @param    array        BE group array\r
+     * @return    string        HTML: title attribute\r
+     */\r
+    function generateTitleAttribute($uid, $be_user_Array, $be_group_Array) {\r
+\r
+        $composedStr = '';\r
+        $this->aclList[$uid];\r
+        if (!$this->aclList[$uid]) {\r
+            return FALSE;\r
+        }\r
+        foreach ($this->aclList[$uid] as $type => $v1) {\r
+            if (!$v1) {\r
+                return FALSE;\r
+            }\r
+            foreach ($v1 as $object_id => $v2) {\r
+                if ($v2['newAcl']) {\r
+                    if ($type == 1) { // group\r
+                        $composedStr .= ' G:' . $be_group_Array[$object_id]['title'];\r
+                    } else {\r
+                        $composedStr .= ' U:' . $be_user_Array[$object_id]['username'];\r
+                    }\r
+                }\r
+            }\r
+        }\r
+\r
+        return ' title="' . $composedStr . '"' . ($composedStr ? ' class="bgColor5"' : '');\r
+    }\r
+\r
+    /**\r
+     * outputs a selector for users / groups, returns current ACLs\r
+     *\r
+     * @param    integer        type of ACL. 0 -> user, 1 -> group\r
+     * @param    string        Pointer where the display code is stored\r
+     * @param    array        configuration of ACLs\r
+     * @return    array        list of groups/users where the ACLs will be shown\r
+     */\r
+    function acl_objectSelector($type, &$displayPointer, $conf) {\r
+        global $BE_USER;\r
+        $aclObjects = array();\r
+        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r
+            'tx_beacl_acl.object_id AS object_id, tx_beacl_acl.type AS type',\r
+            'tx_beacl_acl, be_groups, be_users',\r
+            'tx_beacl_acl.type=' . intval($type) . ' AND ((tx_beacl_acl.object_id=be_groups.uid AND tx_beacl_acl.type=1) OR (tx_beacl_acl.object_id=be_users.uid AND tx_beacl_acl.type=0))',\r
+            '',\r
+            'be_groups.title ASC, be_users.realname ASC'\r
+        );\r
+        while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+            $aclObjects[] = $result['object_id'];\r
+        }\r
+        $aclObjects = array_unique($aclObjects);\r
+        // advanced selector disabled\r
+        if (!$conf['enableFilterSelector']) {\r
+            return $aclObjects;\r
+        }\r
+\r
+        if (!empty($aclObjects)) {\r
+\r
+            // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of\r
+            $groupArray = $BE_USER->userGroupsUID;\r
+            $be_user_Array = t3lib_BEfunc::getUserNames();\r
+            if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+                $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 0);\r
+            }\r
+            $be_group_Array = t3lib_BEfunc::getGroupNames();\r
+            if (!$GLOBALS['BE_USER']->isAdmin()) {\r
+                $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array, $groupArray, 0);\r
+            }\r
+\r
+            // get current selection from UC, merge data, write it back to UC\r
+            $currentSelection = is_array($BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type]) ? $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] : array();\r
+\r
+            $currentSelectionOverride_raw = t3lib_div::_GP('tx_beacl_objsel');\r
+            $currentSelectionOverride = array();\r
+            if (is_array($currentSelectionOverride_raw[$type])) {\r
+                foreach ($currentSelectionOverride_raw[$type] as $tmp) {\r
+                    $currentSelectionOverride[$tmp] = $tmp;\r
+                }\r
+            }\r
+            if ($currentSelectionOverride) {\r
+                $currentSelection = $currentSelectionOverride;\r
+            }\r
+            $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] = $currentSelection;\r
+            $BE_USER->writeUC($BE_USER->uc);\r
+\r
+            // display selector\r
+            $displayCode = '<select size="' . t3lib_div::intInRange(count($aclObjects), 5, 15) . '" name="tx_beacl_objsel[' . $type . '][]" multiple="multiple">';\r
+            foreach ($aclObjects as $singleObjectId) {\r
+                if ($type == 0) {\r
+                    $tmpnam = $be_user_Array[$singleObjectId]['username'];\r
+                } else {\r
+                    $tmpnam = $be_group_Array[$singleObjectId]['title'];\r
+                }\r
+\r
+                $displayCode .= '<option value="' . $singleObjectId . '" ' . (@in_array($singleObjectId, $currentSelection) ? 'selected' : '') . '>' . $tmpnam . '</option>';\r
+            }\r
+\r
+            $displayCode .= '</select>';\r
+            $displayCode .= '<br /><input type="button" value="' . $GLOBALS['LANG']->getLL('aclObjSelUpdate') . '" onClick="document.editform.action=document.location; document.editform.submit()" /><p />';\r
+\r
+            // create section\r
+            switch ($type) {\r
+                case 0:\r
+                    $tmpnam = 'aclUsers';\r
+                    break;\r
+                default:\r
+                    $tmpnam = 'aclGroups';\r
+                    break;\r
+            }\r
+            $displayPointer = $this->doc->section($GLOBALS['LANG']->getLL($tmpnam, 1), $displayCode);\r
+\r
+            return $currentSelection;\r
+        }\r
+\r
+        return NULL;\r
+    }\r
+\r
+\r
+    /**\r
+     * returns a datastructure: pageid - userId / groupId - permissions\r
+     *\r
+     * @param    array        user ID list\r
+     * @param    array        group ID list\r
+     */\r
+    function buildACLtree($users, $groups) {\r
+\r
+        // get permissions in the starting point for users and groups\r
+        $rootLine = t3lib_BEfunc::BEgetRootLine($this->id);\r
+\r
+        $userStartPermissions = array();\r
+        $groupStartPermissions = array();\r
+\r
+        array_shift($rootLine); // needed as a starting point\r
+\r
+        foreach ($rootLine as $level => $values) {\r
+            $recursive = ' AND recursive=1';\r
+\r
+            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive);\r
+\r
+            while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+                if ($result['type'] == 0\r
+                    && in_array($result['object_id'], $users)\r
+                    && !array_key_exists($result['object_id'], $userStartPermissions)\r
+                ) {\r
+                    $userStartPermissions[$result['object_id']] = $result['permissions'];\r
+                } elseif ($result['type'] == 1\r
+                    && in_array($result['object_id'], $groups)\r
+                    && !array_key_exists($result['object_id'], $groupStartPermissions)\r
+                ) {\r
+                    $groupStartPermissions[$result['object_id']] = $result['permissions'];\r
+                }\r
+            }\r
+        }\r
+        foreach ($userStartPermissions as $oid => $perm) {\r
+            $startPerms[0][$oid]['permissions'] = $perm;\r
+            $startPerms[0][$oid]['recursive'] = 1;\r
+        }\r
+        foreach ($groupStartPermissions as $oid => $perm) {\r
+            $startPerms[1][$oid]['permissions'] = $perm;\r
+            $startPerms[1][$oid]['recursive'] = 1;\r
+        }\r
+\r
+\r
+        $this->traversePageTree_acl($startPerms, $rootLine[0]['uid']);\r
+\r
+        // check if there are any ACLs on these pages\r
+        // build a recursive function traversing through the pagetree\r
+    }\r
+\r
+    function countAcls($pageData) {\r
+        $i = 0;\r
+        if (!$pageData) {\r
+            return '';\r
+        }\r
+        foreach ($pageData as $aclId => $values) {\r
+            if ($values['newAcl']) {\r
+                $i += $values['newAcl'];\r
+            }\r
+        }\r
+\r
+        return ($i ? $i : '');\r
+    }\r
+\r
+    /**\r
+     * build ACL tree\r
+     */\r
+    function traversePageTree_acl($parentACLs, $uid) {\r
+        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions, recursive', 'tx_beacl_acl', 'pid=' . intval($uid));\r
+\r
+        $hasNoRecursive = array();\r
+        $this->aclList[$uid] = $parentACLs;\r
+        while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+            $permissions = array(\r
+                'permissions' => $result['permissions'],\r
+                'recursive' => $result['recursive'],\r
+            );\r
+            if ($result['recursive'] == 0) {\r
+                if ($this->aclList[$uid][$result['type']][$result['object_id']]['newAcl']) {\r
+                    $permissions['newAcl'] = $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'];\r
+                }\r
+                $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;\r
+                $permissions['newAcl'] = 1;\r
+                $hasNoRecursive[$uid][$result['type']][$result['object_id']] = $permissions;\r
+            } else {\r
+                $parentACLs[$result['type']][$result['object_id']] = $permissions;\r
+                if (is_array($hasNoRecursive[$uid][$result['type']][$result['object_id']])) {\r
+                    $this->aclList[$uid][$result['type']][$result['object_id']] = $hasNoRecursive[$uid][$result['type']][$result['object_id']];\r
+                } else {\r
+                    $this->aclList[$uid][$result['type']][$result['object_id']] = $permissions;\r
+                }\r
+            }\r
+            $this->aclList[$uid][$result['type']][$result['object_id']]['newAcl'] += 1;\r
+        }\r
+\r
+        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . intval($uid) . ' AND deleted=0');\r
+        while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+            $this->traversePageTree_acl($parentACLs, $result['uid']);\r
+        }\r
+    }\r
+\r
+    /**\r
+     * prints table header\r
+     *\r
+     * @param    array        array of cells\r
+     * @return    string        HTML output for the cells\r
+     */\r
+    function printTableHeader($cells) {\r
+        global $BACK_PATH;\r
+        $verticalDivider = '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';\r
+        $wrappedCells = Array();\r
+        foreach ($cells as $singleCell) {\r
+            $wrappedCells[] = '<td align="center"><b>' . $singleCell . '</b></td>';\r
+        }\r
+\r
+        return implode($verticalDivider, $wrappedCells);\r
+    }\r
+\r
+    /**\r
+     * Print a checkbox for the edit-permission form\r
+     *\r
+     * @param    string        Checkbox name key\r
+     * @param    integer        Checkbox number index\r
+     * @param string        Result sting, not mandatory\r
+     * @return    string        HTML checkbox\r
+     */\r
+    function printCheckBox($checkName, $num, $result = '') {\r
+        if (empty($result)) {\r
+            $result = 'data[pages][' . $GLOBALS['SOBE']->id . '][' . $checkName . ']';\r
+        }\r
+\r
+        $onClick = 'checkChange(\'check[' . $checkName . ']\', \'' . $result . '\')';\r
+\r
+        return '<input type="checkbox" name="check[' . $checkName . '][' . $num . ']" onclick="' . htmlspecialchars($onClick) . '" /><br />';\r
+    }\r
+\r
+    /**\r
+     * Print a set of permissions\r
+     *\r
+     * @param    integer        Permission integer (bits)\r
+     * @return    string        HTML marked up x/* indications.\r
+     */\r
+    function printPerms($int) {\r
+        global $LANG;\r
+        $permissions = array(\r
+            1,\r
+            16,\r
+            2,\r
+            4,\r
+            8\r
+        );\r
+        $str = '';\r
+        foreach ($permissions as $permission) {\r
+            if ($int & $permission) {\r
+                $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-granted', array(\r
+                    'tag' => 'a',\r
+                    'title' => $LANG->getLL($permission, 1),\r
+                    'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'delete\', \'' . $who . '\', ' . $int . ');'\r
+                ));\r
+            } else {\r
+                $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-denied', array(\r
+                    'tag' => 'a',\r
+                    'title' => $LANG->getLL($permission, 1),\r
+                    'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'add\', \'' . $who . '\', ' . $int . ');'\r
+                ));\r
+            }\r
+        }\r
+\r
+        return $str;\r
+    }\r
+}\r
+\r
+?>\r
index 97c756d..0d9d1d2 100644 (file)
@@ -29,6 +29,15 @@ $LOCAL_LANG = Array (
                'aclObjSelUpdate' => 'Opdatér!',
        ),
        'de' => Array (
+               'recursiveAcl' => 'Rekursiv',
+               'addAcl' => 'ACL hinzufügen',
+               'delAcl' => 'ACL löschen',
+               'saveAndClose' => 'Speichern und Schließen',
+               'aclUsers' => 'Benutzer ACL',
+               'aclGroups' => 'Gruppen ACL',
+               'aclUser' => 'Benutzer',
+               'aclGroup' => 'Gruppe',
+               'aclObjSelUpdate' => 'Aktualisieren!',
        ),
        'no' => Array (
        ),
diff --git a/tca.php b/tca.php
index abbd2bc..5e5666e 100644 (file)
--- a/tca.php
+++ b/tca.php
@@ -1,69 +1,67 @@
-<?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
-
-$TCA['tx_beacl_acl'] = Array (
-       'ctrl' => $TCA['tx_beacl_acl']['ctrl'],
-       'interface' => Array (
-               'showRecordFieldList' => 'type,object_id,permissions,recursive'
-       ),
-       'feInterface' => $TCA['tx_beacl_acl']['feInterface'],
-       'columns' => Array (
-               'type' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type.I.0', '0'),
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type.I.1', '1'),
-                               ),
-                               'size' => 1,
-                               'maxitems' => 1,
-                       )
-               ),
-               'object_id' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.object_id',
-                       'config' => Array (
-                               'type' => 'select',
-                               #'foreign_table' => 'be_users',
-                               #'foreign_table_where' => '',
-                               'itemsProcFunc' => 'tx_beacl_objsel->select',
-                               'size' => 1,
-                               'minitems' => 0,
-                               'maxitems' => 1,
-                       )
-               ),
-               'permissions' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions',
-                       'config' => Array (
-                               'type' => 'check',
-                               'cols' => 5,
-                               'items' => Array (
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.0', ''),
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.1', ''),
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.2', ''),
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.3', ''),
-                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.4', ''),
-                               ),
-                       )
-               ),
-               'recursive' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.recursive',
-                       'config' => Array (
-                               'type' => 'check'
-                       )
-               ),
-       ),
-       'types' => Array (
-               '0' => Array('showitem' => 'type;;;;1-1-1, object_id, permissions, recursive'),
-               '1' => Array('showitem' => 'type;;;;1-1-1, object_id, permissions, recursive')
-       ),
-       'palettes' => Array (
-               '1' => Array('showitem' => '')
-       )
-);
-
-?>
\ No newline at end of file
+<?php\r
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');\r
+\r
+$TCA['tx_beacl_acl'] = Array (\r
+       'ctrl' => $TCA['tx_beacl_acl']['ctrl'],\r
+       'interface' => Array (\r
+               'showRecordFieldList' => 'type,object_id,permissions,recursive'\r
+       ),\r
+       'feInterface' => $TCA['tx_beacl_acl']['feInterface'],\r
+       'columns' => Array (\r
+               'type' => Array (\r
+                       'exclude' => 1,\r
+                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type',\r
+                       'config' => Array (\r
+                               'type' => 'select',\r
+                               'items' => Array (\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type.I.0', '0'),\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.type.I.1', '1'),\r
+                               ),\r
+                               'size' => 1,\r
+                               'maxitems' => 1,\r
+                       )\r
+               ),\r
+               'object_id' => Array (\r
+                       'exclude' => 1,\r
+                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.object_id',\r
+                       'config' => Array (\r
+                               'type' => 'select',\r
+                               'itemsProcFunc' => 'tx_beacl_objsel->select',\r
+                               'size' => 1,\r
+                               'minitems' => 0,\r
+                               'maxitems' => 1,\r
+                       )\r
+               ),\r
+               'permissions' => Array (\r
+                       'exclude' => 1,\r
+                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions',\r
+                       'config' => Array (\r
+                               'type' => 'check',\r
+                               'cols' => 5,\r
+                               'items' => Array (\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.0', ''),\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.1', ''),\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.2', ''),\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.3', ''),\r
+                                       Array('LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.permissions.I.4', ''),\r
+                               ),\r
+                       )\r
+               ),\r
+               'recursive' => Array (\r
+                       'exclude' => 1,\r
+                       'label' => 'LLL:EXT:be_acl/locallang_db.php:tx_beacl_acl.recursive',\r
+                       'config' => Array (\r
+                               'type' => 'check'\r
+                       )\r
+               ),\r
+       ),\r
+       'types' => Array (\r
+               '0' => Array('showitem' => 'type;;;;1-1-1, object_id, permissions, recursive'),\r
+               '1' => Array('showitem' => 'type;;;;1-1-1, object_id, permissions, recursive')\r
+       ),\r
+       'palettes' => Array (\r
+               '1' => Array('showitem' => '')\r
+       )\r
+);\r
+\r
+?>\r