[!!!][TASK] Move EXT:perm into EXT:beuser 02/33402/15
authorFrank Nägler <typo3@naegler.net>
Sun, 19 Oct 2014 21:50:43 +0000 (23:50 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Nov 2014 21:34:20 +0000 (22:34 +0100)
Move the logic from EXT:perm into EXT:beuser.

* Move module from "Web > Access" to "System > Access".
* Move logic of EXT:perm:PermissonModuleController into
  EXT:beuser:PersmissionContoller.
* Refactoring of the logic to extbase, remove HTML code from Controller.
* Remove EXT:perm
* Change ClickMenu items
* Remove old entries from LegacyClassesForIde.php

Resolves: #62339
Releases: master
Change-Id: Iadc18e90e20b116d78655311f1e894ed685d0c96
Reviewed-on: http://review.typo3.org/33402
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
33 files changed:
composer.json
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php [new file with mode: 0644]
typo3/sysext/beuser/Classes/Controller/PermissionController.php [new file with mode: 0644]
typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php
typo3/sysext/beuser/Classes/ViewHelpers/Be/ContainerViewHelper.php [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Language/locallang_mod_permission.xlf [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Layouts/Permission.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Public/Css/style.css
typo3/sysext/beuser/Resources/Public/Icons/module-permission.png [new file with mode: 0644]
typo3/sysext/beuser/Resources/Public/Images/legend.gif [new file with mode: 0644]
typo3/sysext/beuser/Resources/Public/JavaScript/Permissions.js [new file with mode: 0644]
typo3/sysext/beuser/ext_tables.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-62339-MoveExtPermIntoExtBeuser.rst [new file with mode: 0644]
typo3/sysext/lang/locallang_mod_web_perm.xlf [deleted file]
typo3/sysext/perm/Classes/Controller/PermissionAjaxController.php [deleted file]
typo3/sysext/perm/Classes/Controller/PermissionModuleController.php [deleted file]
typo3/sysext/perm/Resources/Private/Styles/styles.less [deleted file]
typo3/sysext/perm/Resources/Private/Templates/perm.html [deleted file]
typo3/sysext/perm/Resources/Public/Icons/module-perm.png [deleted file]
typo3/sysext/perm/Resources/Public/JavaScript/Permissions.js [deleted file]
typo3/sysext/perm/Resources/Public/Styles/styles.css [deleted file]
typo3/sysext/perm/composer.json [deleted file]
typo3/sysext/perm/ext_emconf.php [deleted file]
typo3/sysext/perm/ext_icon.gif [deleted file]
typo3/sysext/perm/ext_tables.php [deleted file]
typo3/sysext/perm/mod1/clear.gif [deleted file]
typo3/sysext/perm/mod1/conf.php [deleted file]
typo3/sysext/perm/mod1/index.php [deleted file]
typo3/sysext/perm/mod1/perm.gif [deleted file]
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 196eaf4..613d961 100644 (file)
@@ -89,7 +89,6 @@
                "typo3/cms-lowlevel": "self.version",
                "typo3/cms-opendocs": "self.version",
                "typo3/cms-openid": "self.version",
-               "typo3/cms-perm": "self.version",
                "typo3/cms-recordlist": "self.version",
                "typo3/cms-recycler": "self.version",
                "typo3/cms-reports": "self.version",
index bbb2e03..5f2657e 100644 (file)
@@ -420,7 +420,7 @@ class ClickMenu {
                                if (($table === 'pages' || $table === 'tt_content') && !in_array('new_wizard', $this->disabledItems, TRUE)) {
                                        $localItems['new_wizard'] = $this->DB_newWizard($table, $uid, $this->rec);
                                }
-                               if ($table === 'pages' && !in_array('perms', $this->disabledItems, TRUE) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) {
+                               if ($table === 'pages' && !in_array('perms', $this->disabledItems, TRUE) && $GLOBALS['BE_USER']->check('modules', 'system_BeuserTxPermission')) {
                                        $localItems['perms'] = $this->DB_perms($table, $uid, $this->rec);
                                }
                                if (!in_array('db_list', $this->disabledItems, TRUE) && $GLOBALS['BE_USER']->check('modules', 'web_list')) {
@@ -566,7 +566,7 @@ class ClickMenu {
         * @internal
         */
        public function DB_perms($table, $uid, $rec) {
-               if (!ExtensionManagementUtility::isLoaded('perm')) {
+               if (!ExtensionManagementUtility::isLoaded('beuser')) {
                        return '';
                }
 
@@ -579,7 +579,7 @@ class ClickMenu {
                        $parameters['edit'] = '1';
                }
 
-               $url = BackendUtility::getModuleUrl('web_perm', $parameters);
+               $url = BackendUtility::getModuleUrl('system_BeuserTxPermission', $parameters);
                return $this->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_perms')), $this->excludeIcon(IconUtility::getSpriteIcon('status-status-locked')), $this->urlRefForCM($url), 0);
        }
 
diff --git a/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php b/typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php
new file mode 100644 (file)
index 0000000..35ebd71
--- /dev/null
@@ -0,0 +1,311 @@
+<?php
+namespace TYPO3\CMS\Beuser\Controller;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Http\AjaxRequestHandler;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * This class extends the permissions module in the TYPO3 Backend to provide
+ * convenient methods of editing of page permissions (including page ownership
+ * (user and group)) via new AjaxRequestHandler facility
+ */
+class PermissionAjaxController {
+
+       /**
+        * The local configuration array
+        *
+        * @var array
+        */
+       protected $conf = array();
+
+       /**
+        * The constructor of this class
+        */
+       public function __construct() {
+               $this->getLanguageService()->includeLLFile('EXT:lang/locallang_mod_web_perm.xlf');
+               // Configuration, variable assignment
+               $this->conf['page'] = GeneralUtility::_POST('page');
+               $this->conf['who'] = GeneralUtility::_POST('who');
+               $this->conf['mode'] = GeneralUtility::_POST('mode');
+               $this->conf['bits'] = (int)GeneralUtility::_POST('bits');
+               $this->conf['permissions'] = (int)GeneralUtility::_POST('permissions');
+               $this->conf['action'] = GeneralUtility::_POST('action');
+               $this->conf['ownerUid'] = (int)GeneralUtility::_POST('ownerUid');
+               $this->conf['username'] = GeneralUtility::_POST('username');
+               $this->conf['groupUid'] = (int)GeneralUtility::_POST('groupUid');
+               $this->conf['groupname'] = GeneralUtility::_POST('groupname');
+               $this->conf['editLockState'] = (int)GeneralUtility::_POST('editLockState');
+               // User: Replace some parts of the posted values
+               $this->conf['new_owner_uid'] = (int)GeneralUtility::_POST('newOwnerUid');
+               $temp_owner_data = BackendUtility::getUserNames('username, uid', ' AND uid = ' . $this->conf['new_owner_uid']);
+               $this->conf['new_owner_username'] = htmlspecialchars($temp_owner_data[$this->conf['new_owner_uid']]['username']);
+               // Group: Replace some parts of the posted values
+               $this->conf['new_group_uid'] = (int)GeneralUtility::_POST('newGroupUid');
+               $temp_group_data = BackendUtility::getGroupNames('title,uid', ' AND uid = ' . $this->conf['new_group_uid']);
+               $this->conf['new_group_username'] = htmlspecialchars($temp_group_data[$this->conf['new_group_uid']]['title']);
+       }
+
+       /**
+        * The main dispatcher function. Collect data and prepare HTML output.
+        *
+        * @param array $params array of parameters from the AJAX interface, currently unused
+        * @param AjaxRequestHandler $ajaxObj object of type AjaxRequestHandler
+        * @return void
+        */
+       public function dispatch($params = array(), AjaxRequestHandler $ajaxObj = NULL) {
+               $content = '';
+               // Basic test for required value
+               if ($this->conf['page'] > 0) {
+                       // Init TCE for execution of update
+                       /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
+                       $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
+                       $tce->stripslashes_values = 1;
+                       // Determine the scripts to execute
+                       switch ($this->conf['action']) {
+                               case 'show_change_owner_selector':
+                                       $content = $this->renderUserSelector($this->conf['page'], $this->conf['ownerUid'], $this->conf['username']);
+                                       break;
+                               case 'change_owner':
+                                       if (is_int($this->conf['new_owner_uid'])) {
+                                               // Prepare data to change
+                                               $data = array();
+                                               $data['pages'][$this->conf['page']]['perms_userid'] = $this->conf['new_owner_uid'];
+                                               // Execute TCE Update
+                                               $tce->start($data, array());
+                                               $tce->process_datamap();
+                                               $content = self::renderOwnername($this->conf['page'], $this->conf['new_owner_uid'], $this->conf['new_owner_username']);
+                                       } else {
+                                               $ajaxObj->setError('An error occurred: No page owner uid specified.');
+                                       }
+                                       break;
+                               case 'show_change_group_selector':
+                                       $content = $this->renderGroupSelector($this->conf['page'], $this->conf['groupUid'], $this->conf['groupname']);
+                                       break;
+                               case 'change_group':
+                                       if (is_int($this->conf['new_group_uid'])) {
+                                               // Prepare data to change
+                                               $data = array();
+                                               $data['pages'][$this->conf['page']]['perms_groupid'] = $this->conf['new_group_uid'];
+                                               // Execute TCE Update
+                                               $tce->start($data, array());
+                                               $tce->process_datamap();
+                                               $content = self::renderGroupname($this->conf['page'], $this->conf['new_group_uid'], $this->conf['new_group_username']);
+                                       } else {
+                                               $ajaxObj->setError('An error occurred: No page group uid specified.');
+                                       }
+                                       break;
+                               case 'toggle_edit_lock':
+                                       // Prepare data to change
+                                       $data = array();
+                                       $data['pages'][$this->conf['page']]['editlock'] = $this->conf['editLockState'] === 1 ? 0 : 1;
+                                       // Execute TCE Update
+                                       $tce->start($data, array());
+                                       $tce->process_datamap();
+                                       $content = $this->renderToggleEditLock($this->conf['page'], $data['pages'][$this->conf['page']]['editlock']);
+                                       break;
+                               default:
+                                       if ($this->conf['mode'] === 'delete') {
+                                               $this->conf['permissions'] = (int)($this->conf['permissions'] - $this->conf['bits']);
+                                       } else {
+                                               $this->conf['permissions'] = (int)($this->conf['permissions'] + $this->conf['bits']);
+                                       }
+                                       // Prepare data to change
+                                       $data = array();
+                                       $data['pages'][$this->conf['page']]['perms_' . $this->conf['who']] = $this->conf['permissions'];
+                                       // Execute TCE Update
+                                       $tce->start($data, array());
+                                       $tce->process_datamap();
+                                       $content = self::renderPermissions($this->conf['permissions'], $this->conf['page'], $this->conf['who']);
+                       }
+               } else {
+                       $ajaxObj->setError('This script cannot be called directly.');
+               }
+               $ajaxObj->addContent($this->conf['page'] . '_' . $this->conf['who'], $content);
+       }
+
+       /**
+        * Generate the user selector element
+        *
+        * @param int $page The page id to change the user for
+        * @param int $ownerUid The page owner uid
+        * @param string $username The username to display
+        * @return string The html select element
+        */
+       protected function renderUserSelector($page, $ownerUid, $username = '') {
+               // Get usernames
+               $beUsers = BackendUtility::getUserNames();
+               // Init groupArray
+               $groups = array();
+               if (!$GLOBALS['BE_USER']->isAdmin()) {
+                       $beUsers = BackendUtility::blindUserNames($beUsers, $groups, 1);
+               }
+               // Owner selector:
+               $options = '';
+               // Loop through the users
+               foreach ($beUsers as $uid => $row) {
+                       $selected = $uid == $ownerUid ? ' selected="selected"' : '';
+                       $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';
+               }
+               $elementId = 'o_' . $page;
+               $options = '<option value="0"></option>' . $options;
+               $selector = '<select name="new_page_owner" id="new_page_owner">' . $options . '</select>';
+               $saveButton = '<a class="saveowner" data-page="' . $page . '" data-owner="' . $ownerUid . '" data-element-id="' . $elementId . '" title="Change owner">' . IconUtility::getSpriteIcon('actions-document-save') . '</a>';
+               $cancelButton = '<a class="restoreowner" data-page="' . $page . '"  data-owner="' . $ownerUid . '" data-element-id="' . $elementId . '"' . (!empty($username) ? ' data-username="' . htmlspecialchars($username) . '"' : '') . ' title="Cancel">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
+               return '<span id="' . $elementId . '">' . $selector . $saveButton . $cancelButton . '</span>';
+       }
+
+       /**
+        * Generate the group selector element
+        *
+        * @param int $page The page id to change the user for
+        * @param int $groupUid The page group uid
+        * @param string $username The username to display
+        * @return string The html select element
+        */
+       protected function renderGroupSelector($page, $groupUid, $groupname = '') {
+               // Get usernames
+               $beGroups = BackendUtility::getListGroupNames('title,uid');
+               $beGroupKeys = array_keys($beGroups);
+               $beGroupsO = ($beGroups = BackendUtility::getGroupNames());
+               if (!$this->getBackendUser()->isAdmin()) {
+                       $beGroups = BackendUtility::blindGroupNames($beGroupsO, $beGroupKeys, 1);
+               }
+               // Group selector:
+               $options = '';
+               // flag: is set if the page-groupid equals one from the group-list
+               $userset = 0;
+               // Loop through the groups
+               foreach ($beGroups as $uid => $row) {
+                       if ($uid == $groupUid) {
+                               $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 && $groupUid) {
+                       $options = '<option value="' . $groupUid . '" selected="selected">' .
+                               htmlspecialchars($beGroupsO[$groupUid]['title']) . '</option>' . $options;
+               }
+               $elementId = 'g_' . $page;
+               $options = '<option value="0"></option>' . $options;
+               $selector = '<select name="new_page_group" id="new_page_group">' . $options . '</select>';
+               $saveButton = '<a class="savegroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '" title="Change group">' . IconUtility::getSpriteIcon('actions-document-save') . '</a>';
+               $cancelButton = '<a class="restoregroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '"' . (!empty($groupname) ? ' data-groupname="' . htmlspecialchars($groupname) . '"' : '') . ' title="Cancel">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
+               return '<span id="' . $elementId . '">' . $selector . $saveButton . $cancelButton . '</span>';
+       }
+
+       /**
+        * Print the string with the new owner of a page record
+        *
+        * @param int $page The TYPO3 page id
+        * @param int $ownerUid The new page user uid
+        * @param string $username The TYPO3 BE username (used to display in the element)
+        * @param bool $validUser Must be set to FALSE, if the user has no name or is deleted
+        * @return string The new group wrapped in HTML
+        */
+       static public function renderOwnername($page, $ownerUid, $username, $validUser = TRUE) {
+               $elementId = 'o_' . $page;
+               return '<span id="' . $elementId . '"><a class="ug_selector changeowner" data-page="' . $page . '" data-owner="' . $ownerUid . '" data-username="' . htmlspecialchars($username) . '">' . ($validUser ? ($username == '' ? '<span class=not_set>[' . $GLOBALS['LANG']->getLL('notSet') . ']</span>' : htmlspecialchars(GeneralUtility::fixed_lgd_cs($username, 20))) : '<span class=not_set title="' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($username, 20)) . '">[' . $GLOBALS['LANG']->getLL('deleted') . ']</span>') . '</a></span>';
+       }
+
+       /**
+        * Print the string with the new group of a page record
+        *
+        * @param int $page The TYPO3 page id
+        * @param int $groupUid The new page group uid
+        * @param string $groupname The TYPO3 BE groupname (used to display in the element)
+        * @param bool $validGroup Must be set to FALSE, if the group has no name or is deleted
+        * @return string The new group wrapped in HTML
+        */
+       static public function renderGroupname($page, $groupUid, $groupname, $validGroup = TRUE) {
+               $elementId = 'g_' . $page;
+               return '<span id="' . $elementId . '"><a class="ug_selector changegroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-groupname="' . htmlspecialchars($groupname) . '">' . ($validGroup ? ($groupname == '' ? '<span class=not_set>[' . $GLOBALS['LANG']->getLL('notSet') . ']</span>' : htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupname, 20))) : '<span class=not_set title="' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupname, 20)) . '">[' . $GLOBALS['LANG']->getLL('deleted') . ']</span>') . '</a></span>';
+       }
+
+       /**
+        * Print the string with the new edit lock state of a page record
+        *
+        * @param int $page The TYPO3 page id
+        * @param string $editlockstate The state of the TYPO3 page (locked, unlocked)
+        * @return string The new edit lock string wrapped in HTML
+        */
+       protected function renderToggleEditLock($page, $editLockState) {
+               if ($editLockState === 1) {
+                       $ret = '<span id="el_' . $page . '"><a class="editlock" data-page="' . (int)$page . '" data-lockstate="1" title="The page and all content is locked for editing by all non-Admin users.">' . IconUtility::getSpriteIcon('status-warning-lock') . '</a></span>';
+               } else {
+                       $ret = '<span id="el_' . $page . '"><a class="editlock" data-page="' . (int)$page . '" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>';
+               }
+               return $ret;
+       }
+
+       /**
+        * Print a set of permissions. Also used in index.php
+        *
+        * @param int $int Permission integer (bits)
+        * @param int $page The TYPO3 page id
+        * @param string $who The scope (user, group or everybody)
+        * @return string HTML marked up x/* indications.
+        */
+       static public function renderPermissions($int, $pageId = 0, $who = 'user') {
+               $str = '';
+               $permissions = array(1, 16, 2, 4, 8);
+               foreach ($permissions as $permission) {
+                       if ($int & $permission) {
+                               $str .= IconUtility::getSpriteIcon('status-status-permission-granted', array(
+                                       'title' => $GLOBALS['LANG']->getLL($permission, TRUE),
+                                       'class' => 'change-permission',
+                                       'data-page' => $pageId,
+                                       'data-permissions' => $int,
+                                       'data-mode' => 'delete',
+                                       'data-who' => $who,
+                                       'data-bits' => $permission,
+                                       'style' => 'cursor:pointer'
+                               ));
+                       } else {
+                               $str .= IconUtility::getSpriteIcon('status-status-permission-denied', array(
+                                       'title' => $GLOBALS['LANG']->getLL($permission, TRUE),
+                                       'class' => 'change-permission',
+                                       'data-page' => $pageId,
+                                       'data-permissions' => $int,
+                                       'data-mode' => 'add',
+                                       'data-who' => $who,
+                                       'data-bits' => $permission,
+                                       'style' => 'cursor:pointer'
+                               ));
+                       }
+               }
+               return '<span id="' . $pageId . '_' . $who . '">' . $str . '</span>';
+       }
+
+       /**
+        * @return \TYPO3\CMS\Lang\LanguageService
+        */
+       protected function getLanguageService() {
+               return $GLOBALS['LANG'];
+       }
+
+       /**
+        * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
+        */
+       protected function getBackendUser() {
+               return $GLOBALS['BE_USER'];
+       }
+}
diff --git a/typo3/sysext/beuser/Classes/Controller/PermissionController.php b/typo3/sysext/beuser/Classes/Controller/PermissionController.php
new file mode 100644 (file)
index 0000000..521ae66
--- /dev/null
@@ -0,0 +1,435 @@
+<?php
+namespace TYPO3\CMS\Beuser\Controller;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Database\DatabaseConnection;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+
+/**
+ * Backend module page permissions
+ *
+ * @author Frank Nägler <typo3@naegler.net>
+ */
+class PermissionController extends ActionController {
+
+       /**
+        * @var string prefix for session
+        */
+       const SESSION_PREFIX = 'tx_Beuser_';
+
+       /**
+        * @var int the current page id
+        */
+       protected $id;
+
+       /**
+        * @var int
+        */
+       protected $returnId;
+
+       /**
+        * @var int
+        */
+       protected $depth;
+
+       /**
+        * @var int
+        */
+       protected $lastEdited;
+
+       /**
+        * @var string
+        */
+       protected $permissionsClause;
+
+       /**
+        * Number of levels to enable recursive settings for
+        *
+        * @var int
+        */
+       protected $getLevels = 10;
+
+       /**
+        * @var array
+        */
+       protected $pageInfo = array();
+
+       /**
+        * Initialize action
+        *
+        * @return void
+        */
+       protected function initializeAction() {
+               // determine id parameter
+               $this->id = (int)GeneralUtility::_GP('id');
+               if ($this->request->hasArgument('id')) {
+                       $this->id = (int)$this->request->getArgument('id');
+               }
+
+               // determine depth paramter
+               $this->depth = ((int)GeneralUtility::_GP('depth') > 0) ? (int) GeneralUtility::_GP('depth') :
+                       $this->getBackendUser()->getSessionData(self::SESSION_PREFIX . 'depth');
+               if ($this->request->hasArgument('depth')) {
+                       $this->depth = (int)$this->request->getArgument('depth');
+               }
+               $this->getBackendUser()->setAndSaveSessionData(self::SESSION_PREFIX . 'depth', $this->depth);
+               $this->lastEdited = GeneralUtility::_GP('lastEdited');
+               $this->returnId = GeneralUtility::_GP('returnId');
+               $this->permissionsClause = $this->getBackendUser()->getPagePermsClause(1);
+               $this->pageInfo = BackendUtility::readPageAccess($this->id, $this->permissionsClause);
+       }
+
+       /**
+        * Index action
+        *
+        * @return void
+        */
+       public function indexAction() {
+               // Checking access:
+               if ($this->checkAccess()) {
+                       if ($this->getBackendUser()->isAdmin() && !$this->id) {
+                               $this->pageInfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
+                       }
+                       $this->view->assign(
+                               'previewUrl',
+                               BackendUtility::viewonclick(
+                                       $this->pageInfo['uid'], $GLOBALS['BACK_PATH'],
+                                       BackendUtility::BEgetRootLine($this->pageInfo['uid'])
+                               )
+                       );
+                       $this->view->assign('versionSelector', $this->getVersionSelector($this->id, TRUE));
+                       if ($this->getBackendUser()->workspace != 0) {
+                               // Adding section with the permission setting matrix:
+                               $this->addFlashMessage(
+                                       LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'),
+                                       LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'),
+                                       FlashMessage::WARNING
+                               );
+                       }
+
+                       // depth options
+                       $depthOptions = array();
+                       $url = $this->uriBuilder->reset()->setArguments(array(
+                               'action' => 'index',
+                               'depth' => '__DEPTH__',
+                               'id' => $this->id
+                       ))->buildBackendUri();
+                       foreach (array(1, 2, 3, 4, 10) as $depthLevel) {
+                               $depthOptions[$depthLevel] = $depthLevel . ' ' . LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:levels', 'beuser');
+                       }
+                       $this->view->assign('depthBaseUrl', $url);
+                       $this->view->assign('depth', $this->depth);
+                       $this->view->assign('depthOptions', $depthOptions);
+
+                       // 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 = $this->getBackendUser()->userGroupsUID;
+                       $beUserArray = BackendUtility::getUserNames();
+                       if (!$this->getBackendUser()->isAdmin()) {
+                               $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 0);
+                       }
+                       $beGroupArray = BackendUtility::getGroupNames();
+                       if (!$this->getBackendUser()->isAdmin()) {
+                               $beGroupArray = BackendUtility::blindGroupNames($beGroupArray, $beGroupKeys, 0);
+                       }
+
+                       /** @var \TYPO3\CMS\Backend\Tree\View\PageTreeView */
+                       $tree = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
+                       $tree->init('AND ' . $this->permissionsClause);
+                       $tree->addField('perms_user', TRUE);
+                       $tree->addField('perms_group', TRUE);
+                       $tree->addField('perms_everybody', TRUE);
+                       $tree->addField('perms_userid', TRUE);
+                       $tree->addField('perms_groupid', TRUE);
+                       $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->depth, '');
+
+                       // Traverse tree:
+                       $treeData = array();
+                       foreach ($tree->tree as $data) {
+                               $viewDataRow = array();
+                               $pageId = $data['row']['uid'];
+                               $viewData['pageId'] = $pageId;
+
+                               // User/Group names:
+                               if ($beUserArray[$data['row']['perms_userid']]) {
+                                       $userName = $beUserArray[$data['row']['perms_userid']]['username'];
+                               } else {
+                                       $userName = ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');
+                               }
+
+                               if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) {
+                                       $userName = PermissionAjaxController::renderOwnername(
+                                               $pageId,
+                                               $data['row']['perms_userid'],
+                                               htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)),
+                                               FALSE
+                                       );
+                               } else {
+                                       $userName = PermissionAjaxController::renderOwnername(
+                                               $pageId,
+                                               $data['row']['perms_userid'],
+                                               htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20))
+                                       );
+                               }
+                               $viewDataRow['userName'] = $userName;
+
+                               if ($beGroupArray[$data['row']['perms_groupid']]) {
+                                       $groupName = $beGroupArray[$data['row']['perms_groupid']]['title'];
+                               } else {
+                                       $groupName = $data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '';
+                               }
+
+                               if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) {
+                                       $groupName = PermissionAjaxController::renderGroupname(
+                                               $pageId,
+                                               $data['row']['perms_groupid'],
+                                               htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)),
+                                               FALSE
+                                       );
+                               } else {
+                                       $groupName = PermissionAjaxController::renderGroupname(
+                                               $pageId, $data['row']['perms_groupid'],
+                                               htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20))
+                                       );
+                               }
+                               $viewDataRow['groupName'] = $groupName;
+
+                               // Seeing if editing of permissions are allowed for that page:
+                               $viewData['editPermsAllowed'] = ($data['row']['perms_userid'] == $this->getBackendUser()->user['uid']
+                                       || $this->getBackendUser()->isAdmin());
+
+                               $viewData['html'] = $data['HTML'] . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], 20));
+                               $viewData['id'] = $data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId;
+
+                               $viewData['userPermissions'] = ($pageId ?
+                                       PermissionAjaxController::renderPermissions($data['row']['perms_user'], $pageId, 'user') .
+                                       ' ' . $userName : '');
+                               $viewData['groupPermissions'] = ($pageId ?
+                                       PermissionAjaxController::renderPermissions($data['row']['perms_group'], $pageId, 'group') .
+                                       ' ' . $groupName : '');
+                               $viewData['otherPermissions'] = ($pageId ? ' ' .
+                                       PermissionAjaxController::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '');
+
+                               $viewData['editLock'] = ($data['row']['editlock']) ? TRUE : FALSE;
+
+                               $treeData[] = $viewData;
+                       }
+                       $this->view->assign('viewTree', $treeData);
+
+                       // CSH for permissions setting
+                       $this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH']));
+               }
+       }
+
+       /**
+        * Edit action
+        *
+        * @return void
+        */
+       public function editAction() {
+               $this->view->assign('id', $this->id);
+               $this->view->assign('depth', $this->depth);
+
+               // Checking access:
+               if ($this->checkAccess()) {
+                       if ($this->getBackendUser()->isAdmin() && !$this->id) {
+                               $this->pageInfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
+                       }
+                       if ($this->getBackendUser()->workspace != 0) {
+                               // Adding FlashMessage with the permission setting matrix:
+                               $this->addFlashMessage(
+                                       LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'),
+                                       LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'),
+                                       FlashMessage::WARNING
+                               );
+                       }
+                       // Get usernames and groupnames
+                       $beGroupArray = BackendUtility::getListGroupNames('title,uid');
+                       $beGroupKeys  = array_keys($beGroupArray);
+                       $beUserArray  = BackendUtility::getUserNames();
+                       if (!$this->getBackendUser()->isAdmin()) {
+                               $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 1);
+                       }
+                       $beGroupArrayO = ($beGroupArray = BackendUtility::getGroupNames());
+                       if (!$this->getBackendUser()->isAdmin()) {
+                               $beGroupArray = BackendUtility::blindGroupNames($beGroupArrayO, $beGroupKeys, 1);
+                       }
+
+                       // Owner selector:
+                       $beUserDataArray = array();
+                       $beUserDataArray[0] = '';
+                       foreach ($beUserArray as $uid => &$row) {
+                               $beUserDataArray[$uid] = $row['username'];
+                       }
+                       $this->view->assign('currentBeUser', $this->pageInfo['perms_userid']);
+                       $this->view->assign('beUserData', $beUserDataArray);
+
+                       // Group selector:
+                       $beGroupDataArray = array();
+                       $beGroupDataArray[0] = '';
+                       foreach ($beGroupArray as $uid => $row) {
+                               $beGroupDataArray[$uid] = $row['title'];
+                       }
+                       $this->view->assign('currentBeGroup', $this->pageInfo['perms_groupid']);
+                       $this->view->assign('beGroupData', $beGroupDataArray);
+                       $this->view->assign('pageInfo', $this->pageInfo);
+                       $this->view->assign('returnId', $this->returnId);
+                       $this->view->assign('recursiveSelectOptions', $this->getRecursiveSelectOptions());
+                       // Adding help text:
+                       if ($this->getBackendUser()->uc['helpText']) {
+                               $this->view->assign('showHelp', TRUE);
+                       }
+               }
+       }
+
+       /**
+        * Update action
+        *
+        * @param array $data
+        * @param array $mirror
+        * @return void
+        */
+       protected function updateAction(array $data, array $mirror) {
+               // Checking access:
+               if ($this->checkAccess()) {
+                       if (!empty($data['pages'])) {
+                               foreach ($data['pages'] as $pageUid => $properties) {
+                                       $this->getDatabaseConnection()->exec_UPDATEquery(
+                                               'pages',
+                                               'uid = ' . (int)$pageUid,
+                                               $properties
+                                       );
+                                       if (!empty($mirror['pages'][$pageUid])) {
+                                               $mirrorPages = GeneralUtility::trimExplode(',', $mirror['pages'][$pageUid]);
+                                               foreach ($mirrorPages as $mirrorPageUid) {
+                                                       $this->getDatabaseConnection()->exec_UPDATEquery(
+                                                               'pages',
+                                                               'uid = ' . (int)$mirrorPageUid,
+                                                               $properties
+                                                       );
+                                               }
+                                       }
+                               }
+                       }
+               }
+               $this->redirect('index', NULL, NULL, array('id' => $this->returnId, 'depth' => $this->depth));
+       }
+
+       /**
+        * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
+        */
+       protected function getBackendUser() {
+               return $GLOBALS['BE_USER'];
+       }
+
+       /**
+        * @return DatabaseConnection
+        */
+       protected function getDatabaseConnection() {
+               return $GLOBALS['TYPO3_DB'];
+       }
+
+       /**
+        * Finding tree and offer setting of values recursively.
+        *
+        * @return array
+        */
+       protected function getRecursiveSelectOptions() {
+               // Initialize tree object:
+               $tree = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
+               $tree->init('AND ' . $this->permissionsClause);
+               $tree->addField('perms_userid', TRUE);
+               $tree->makeHTML = 0;
+               $tree->setRecs = 1;
+               // Make tree:
+               $tree->getTree($this->id, $this->getLevels, '');
+               $options = array();
+               $options[''] = '';
+               // If there are a hierarchy of page ids, then...
+               if ($this->getBackendUser()->user['uid'] && count($tree->orig_ids_hierarchy)) {
+                       // Init:
+                       $labelRecursive = LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:recursive', 'beuser');
+                       $labelLevels = LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:levels', 'beuser');
+                       $labelPagesAffected = LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:pages_affected', 'beuser');
+                       $theIdListArr = array();
+                       // Traverse the number of levels we want to allow recursive
+                       // setting of permissions for:
+                       for ($a = $this->getLevels; $a > 0; $a--) {
+                               if (is_array($tree->orig_ids_hierarchy[$a])) {
+                                       foreach ($tree->orig_ids_hierarchy[$a] as $theId) {
+                                               if ($this->getBackendUser()->isAdmin() || $this->getBackendUser()->user['uid'] == $tree->recs[$theId]['perms_userid']) {
+                                                       $theIdListArr[] = $theId;
+                                               }
+                                       }
+                                       $lKey = $this->getLevels - $a + 1;
+                                       $options[implode(',', $theIdListArr)] = $labelRecursive . ' ' . $lKey . ' ' . $labelLevels .
+                                               ' (' . count($theIdListArr) . ' ' . $labelPagesAffected . ')';
+                               }
+                       }
+               }
+               return $options;
+       }
+
+       /**
+        * Creates the version selector for the page id inputted.
+        * Requires the core version management extension, "version" to be loaded.
+        *
+        * @param int $id Page id to create selector for.
+        * @param bool $noAction If set, there will be no button for swapping page.
+        * @return string
+        */
+       protected function getVersionSelector($id, $noAction = FALSE) {
+               if (
+                       ExtensionManagementUtility::isLoaded('version') &&
+                       !ExtensionManagementUtility::isLoaded('workspaces')
+               ) {
+                       $versionView = GeneralUtility::makeInstance(\TYPO3\CMS\Version\View\VersionView::class);
+                       return $versionView->getVersionSelector($id, $noAction);
+               }
+               return '';
+       }
+
+       /**
+        * Check access
+        *
+        * @return bool check access
+        */
+       protected function checkAccess() {
+               $access = is_array($this->pageInfo);
+               // Checking access:
+               if ($this->id && $access || $this->getBackendUser()->isAdmin() && !$this->id) {
+                       return TRUE;
+               }
+               return FALSE;
+       }
+}
index 170ff6d..7febb50 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Beuser\Hook;
  */
 
 use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\HttpUtility;
 
 /**
  * Backend user switchback, for logoff_pre_processing hook within
@@ -37,10 +39,10 @@ class SwitchBackUserHook {
         */
        public function switchBack($params, AbstractUserAuthentication $authentication) {
                if ($this->isAHandledBackendSession($authentication)) {
-                       $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
+                       $objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
                        $backendUserSessionRepository = $objectManager->get('TYPO3\\CMS\\Beuser\\Domain\\Repository\\BackendUserSessionRepository');
                        $backendUserSessionRepository->switchBackToOriginalUser($authentication);
-                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($GLOBALS['BACK_PATH'] . 'backend.php');
+                       HttpUtility::redirect($GLOBALS['BACK_PATH'] . 'backend.php');
                }
        }
 
diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/Be/ContainerViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/Be/ContainerViewHelper.php
new file mode 100644 (file)
index 0000000..2e0cb52
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+namespace TYPO3\CMS\Beuser\ViewHelpers\Be;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * View helper which allows you to create extbase based modules in the style of TYPO3 default modules.
+ *
+ * Extends fluid be.container view helper adding a feature to register RequireJS modules.
+ *
+ * @see \TYPO3\CMS\Fluid\ViewHelpers\Be\ContainerViewHelper
+ */
+class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\ContainerViewHelper {
+
+       /**
+        * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate
+        *
+        * @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
+        * @param bool $enableClickMenu If TRUE, loads clickmenu.js required by BE context menus. Defaults to TRUE
+        * @param bool $loadPrototype specifies whether to load prototype library. Defaults to TRUE
+        * @param bool $loadScriptaculous specifies whether to load scriptaculous libraries. Defaults to FALSE
+        * @param string $scriptaculousModule additionales modules for scriptaculous
+        * @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
+        * @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
+        * @param string $extJsAdapter load alternative adapter (ext-base is default adapter)
+        * @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
+        * @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
+        * @param array $includeCssFiles List of custom CSS file to be loaded
+        * @param array $includeJsFiles List of custom JavaScript file to be loaded
+        * @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
+        * @param bool $includeCsh flag for including CSH
+        * @param array $loadRequireJsModules List of require JS modules to register
+        * @return string
+        */
+       public function render(
+               $pageTitle = '',
+               $enableClickMenu = TRUE,
+               $loadPrototype = TRUE,
+               $loadScriptaculous = FALSE,
+               $scriptaculousModule = '',
+               $loadExtJs = FALSE,
+               $loadExtJsTheme = TRUE,
+               $extJsAdapter = '',
+               $enableExtJsDebug = FALSE,
+               $loadJQuery = FALSE,
+               $includeCssFiles = NULL,
+               $includeJsFiles = NULL,
+               $addJsInlineLabels = NULL,
+               $includeCsh = TRUE,
+               $loadRequireJsModules = NULL
+       ) {
+               $doc = $this->getDocInstance();
+               $pageRenderer = $doc->getPageRenderer();
+
+               if (is_array($loadRequireJsModules)) {
+                       foreach ($loadRequireJsModules as $module) {
+                               $pageRenderer->loadRequireJsModule($module);
+                       }
+               }
+
+               return parent::render(
+                       $pageTitle,
+                       $enableClickMenu,
+                       $loadPrototype,
+                       $loadScriptaculous,
+                       $scriptaculousModule,
+                       $loadExtJs,
+                       $loadExtJsTheme,
+                       $extJsAdapter,
+                       $enableExtJsDebug,
+                       FALSE,
+                       $includeCssFiles,
+                       $includeJsFiles,
+                       $addJsInlineLabels,
+                       $includeCsh
+               );
+       }
+}
diff --git a/typo3/sysext/beuser/Resources/Private/Language/locallang_mod_permission.xlf b/typo3/sysext/beuser/Resources/Private/Language/locallang_mod_permission.xlf
new file mode 100644 (file)
index 0000000..0338287
--- /dev/null
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1415814882" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:34Z" product-name="lang">
+       <header/>
+               <body>
+                       <trans-unit id="permissions" xml:space="preserve">
+                               <source>Permissions</source>
+                       </trans-unit>
+                       <trans-unit id="ch_permissions" xml:space="preserve">
+                               <source>Change permissions</source>
+                       </trans-unit>
+                       <trans-unit id="Legend" xml:space="preserve">
+                               <source>Legend</source>
+                       </trans-unit>
+                       <trans-unit id="Owner" xml:space="preserve">
+                               <source>Owner</source>
+                       </trans-unit>
+                       <trans-unit id="Group" xml:space="preserve">
+                               <source>Group</source>
+                       </trans-unit>
+                       <trans-unit id="Everybody" xml:space="preserve">
+                               <source>Everybody</source>
+                       </trans-unit>
+                       <trans-unit id="EditLock" xml:space="preserve">
+                               <source>Lock</source>
+                       </trans-unit>
+                       <trans-unit id="EditLock_descr" xml:space="preserve">
+                               <source>The page and all content is locked for editing by all non-Admin users.</source>
+                       </trans-unit>
+                       <trans-unit id="Save" xml:space="preserve">
+                               <source>Save</source>
+                       </trans-unit>
+                       <trans-unit id="Abort" xml:space="preserve">
+                               <source>Abort</source>
+                       </trans-unit>
+                       <trans-unit id="Edit" xml:space="preserve">
+                               <source>EDIT</source>
+                       </trans-unit>
+                       <trans-unit id="recursive" xml:space="preserve">
+                               <source>Set recursively</source>
+                       </trans-unit>
+                       <trans-unit id="pages_affected" xml:space="preserve">
+                               <source>pages affected</source>
+                       </trans-unit>
+                       <trans-unit id="user_overview" xml:space="preserve">
+                               <source>User overview</source>
+                       </trans-unit>
+                       <trans-unit id="Mode" xml:space="preserve">
+                               <source>Mode</source>
+                       </trans-unit>
+                       <trans-unit id="Depth" xml:space="preserve">
+                               <source>Depth</source>
+                       </trans-unit>
+                       <trans-unit id="levels" xml:space="preserve">
+                               <source>levels</source>
+                       </trans-unit>
+                       <trans-unit id="User" xml:space="preserve">
+                               <source>User</source>
+                       </trans-unit>
+                       <trans-unit id="def" xml:space="preserve">
+                               <source>Definition: 'content' is records from all tables on a page - except from records from the table 'pages' (Pages).</source>
+                       </trans-unit>
+                       <trans-unit id="A_Granted" xml:space="preserve">
+                               <source>Access Granted</source>
+                       </trans-unit>
+                       <trans-unit id="A_Denied" xml:space="preserve">
+                               <source>Access Denied</source>
+                       </trans-unit>
+                       <trans-unit id="1" xml:space="preserve">
+                               <source>Show page</source>
+                       </trans-unit>
+                       <trans-unit id="16" xml:space="preserve">
+                               <source>Edit content</source>
+                       </trans-unit>
+                       <trans-unit id="2" xml:space="preserve">
+                               <source>Edit page</source>
+                       </trans-unit>
+                       <trans-unit id="4" xml:space="preserve">
+                               <source>Delete page</source>
+                       </trans-unit>
+                       <trans-unit id="8" xml:space="preserve">
+                               <source>New pages</source>
+                       </trans-unit>
+                       <trans-unit id="1_t" xml:space="preserve">
+                               <source>Show/Copy page and content.</source>
+                       </trans-unit>
+                       <trans-unit id="16_t" xml:space="preserve">
+                               <source>Change/Add/Delete/Move content.</source>
+                       </trans-unit>
+                       <trans-unit id="2_t" xml:space="preserve">
+                               <source>Change/Move page, eg. change pagetitle etc.</source>
+                       </trans-unit>
+                       <trans-unit id="4_t" xml:space="preserve">
+                               <source>Delete page and content.</source>
+                       </trans-unit>
+                       <trans-unit id="8_t" xml:space="preserve">
+                               <source>Create new pages under this page.</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
+                               <source>Page editing permissions</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
+                               <source>Setting of page permissions is vital for controlling backend user access to pages. You can assign a user and a group as owners of a page and set access permissions for each.</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
+                               <source>Access</source>
+                       </trans-unit>
+                       <trans-unit id="WorkspaceWarning" xml:space="preserve">
+                               <source>Workspace Warning</source>
+                       </trans-unit>
+                       <trans-unit id="WorkspaceWarningText" xml:space="preserve">
+                               <source>Permissions you set in the workspace are effective on the elements only &lt;em&gt;after&lt;/em&gt; they are published! If you need to set permissions which are effective right now, you must do so in the Live workspace. (Permissions are always evaluated on the Live workspace record/placeholder of a draft version)</source>
+                       </trans-unit>
+                       <trans-unit id="notSet" xml:space="preserve">
+                               <source>not set</source>
+                       </trans-unit>
+                       <trans-unit id="deleted" xml:space="preserve">
+                               <source>deleted</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
diff --git a/typo3/sysext/beuser/Resources/Private/Layouts/Permission.html b/typo3/sysext/beuser/Resources/Private/Layouts/Permission.html
new file mode 100644 (file)
index 0000000..4998ba7
--- /dev/null
@@ -0,0 +1,35 @@
+{namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+
+<bu:be.container
+       includeCssFiles="{0: '{f:uri.resource(path:\'Css/style.css\')}'}"
+       loadRequireJsModules="{0: 'TYPO3/CMS/Beuser/Permissions'}"
+       loadPrototype="0"
+       loadExtJsTheme="0"
+       loadJQuery="1"
+>
+       <div class="typo3-fullDoc">
+               <div id="typo3-docheader">
+                       <div class="typo3-docheader-functions">
+                               <div class="left"></div>
+                               <div class="right"></div>
+                       </div>
+                       <div class="typo3-docheader-buttons">
+                               <div class="left">
+                                       <f:render section="iconButtons" />
+                               </div>
+                               <div class="right">
+                                       <f:be.buttons.shortcut />
+                               </div>
+                       </div>
+               </div>
+               <div id="typo3-docbody">
+                       <div id="typo3-inner-docbody">
+                               <f:render section="headline" />
+
+                               <f:flashMessages renderMode="div" />
+
+                               <f:render section="content" />
+                       </div>
+               </div>
+       </div>
+</bu:be.container>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html b/typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html
new file mode 100644 (file)
index 0000000..01ec6e5
--- /dev/null
@@ -0,0 +1,98 @@
+{namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+
+<f:layout name="Permission" />
+
+<f:section name="iconButtons">
+       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><bu:spriteManagerIcon iconName="actions-document-view" /></a>
+</f:section>
+
+<f:section name="headline">
+       <h1>
+               <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:permissions" />:
+               <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Edit" />
+       </h1>
+</f:section>
+
+<f:section name="content">
+       <f:form action="update" name="editform">
+               <h3><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Owner" /></h3>
+               <div class="form-group">
+                       <f:form.select name="data[pages][{id}][perms_userid]" options="{beUserData}" value="{currentBeUser}" />
+               </div>
+
+               <h3><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></h3>
+               <div class="form-group">
+                       <f:form.select name="data[pages][{id}][perms_groupid]" options="{beGroupData}" value="{currentBeGroup}" />
+               </div>
+
+               <table class="t3-table" id="typo3-permissionMatrix">
+                       <thead>
+                       <tr>
+                               <th></th>
+                               <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:1" /></th>
+                               <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:16" /></th>
+                               <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:2" /></th>
+                               <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4" /></th>
+                               <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8" /></th>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       <tr>
+                               <td><strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Owner" /></strong></td>
+                               <td><input type="checkbox" name="check[perms_user][1]" onclick="TYPO3.Permissions.checkChange('check[perms_user]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]')" /></td>
+                               <td><input type="checkbox" name="check[perms_user][5]" onclick="TYPO3.Permissions.checkChange('check[perms_user]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]')" /></td>
+                               <td><input type="checkbox" name="check[perms_user][2]" onclick="TYPO3.Permissions.checkChange('check[perms_user]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]')" /></td>
+                               <td><input type="checkbox" name="check[perms_user][3]" onclick="TYPO3.Permissions.checkChange('check[perms_user]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]')" /></td>
+                               <td><input type="checkbox" name="check[perms_user][4]" onclick="TYPO3.Permissions.checkChange('check[perms_user]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]')" /></td>
+                       </tr>
+                       <tr>
+                               <td><strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></strong></td>
+                               <td><input type="checkbox" name="check[perms_group][1]" onclick="TYPO3.Permissions.checkChange('check[perms_group]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]')" /></td>
+                               <td><input type="checkbox" name="check[perms_group][5]" onclick="TYPO3.Permissions.checkChange('check[perms_group]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]')" /></td>
+                               <td><input type="checkbox" name="check[perms_group][2]" onclick="TYPO3.Permissions.checkChange('check[perms_group]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]')" /></td>
+                               <td><input type="checkbox" name="check[perms_group][3]" onclick="TYPO3.Permissions.checkChange('check[perms_group]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]')" /></td>
+                               <td><input type="checkbox" name="check[perms_group][4]" onclick="TYPO3.Permissions.checkChange('check[perms_group]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]')" /></td>
+                       </tr>
+                       <tr>
+                               <td><strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Everybody" /></strong></td>
+                               <td><input type="checkbox" name="check[perms_everybody][1]" onclick="TYPO3.Permissions.checkChange('check[perms_everybody]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]')" /></td>
+                               <td><input type="checkbox" name="check[perms_everybody][5]" onclick="TYPO3.Permissions.checkChange('check[perms_everybody]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]')" /></td>
+                               <td><input type="checkbox" name="check[perms_everybody][2]" onclick="TYPO3.Permissions.checkChange('check[perms_everybody]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]')" /></td>
+                               <td><input type="checkbox" name="check[perms_everybody][3]" onclick="TYPO3.Permissions.checkChange('check[perms_everybody]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]')" /></td>
+                               <td><input type="checkbox" name="check[perms_everybody][4]" onclick="TYPO3.Permissions.checkChange('check[perms_everybody]', 'tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]')" /></td>
+                       </tr>
+                       </tbody>
+               </table>
+               <f:form.hidden name="data[pages][{id}][perms_user]" value="{pageInfo.perms_user}" />
+               <f:form.hidden name="data[pages][{id}][perms_group]" value="{pageInfo.perms_group}" />
+               <f:form.hidden name="data[pages][{id}][perms_everybody]" value="{pageInfo.perms_everybody}" />
+
+               <f:form.select name="mirror[pages][{id}]" options="{recursiveSelectOptions}" />
+
+               <br/><br/>
+
+               <f:form.hidden name="depth" value="{depth}" />
+               <f:form.submit name="submit" value="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Save')}" />
+               <f:link.action action="index" arguments="{id: id}"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Abort" /></f:link.action>
+
+               <f:form.hidden name="redirect" value="{f:uri.action(action: 'index', arguments: {lastEdited: id, id: returnId})}" />
+       </f:form>
+       <f:if condition="{showHelp}">
+               <h3><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Legend" /></h3>
+               <p>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:1" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:1_t" /> <br />
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:16" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:16_t" /> <br />
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:2" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:2_t" /> <br />
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4_t" /> <br />
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8_t" />
+               </p>
+               <p><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:def" /></p>
+       </f:if>
+       <script type="text/javascript">
+               require(["jquery", "TYPO3/CMS/Beuser/Permissions"], function($, Permissions) {
+                       Permissions.setCheck("check[perms_user]", "tx_beuser_system_beusertxpermission[data][pages][{id}][perms_user]");
+                       Permissions.setCheck("check[perms_group]", "tx_beuser_system_beusertxpermission[data][pages][{id}][perms_group]");
+                       Permissions.setCheck("check[perms_everybody]", "tx_beuser_system_beusertxpermission[data][pages][{id}][perms_everybody]");
+               });
+       </script>
+</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html b/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html
new file mode 100644 (file)
index 0000000..68f1ca7
--- /dev/null
@@ -0,0 +1,102 @@
+{namespace bu = TYPO3\CMS\Beuser\ViewHelpers}
+
+<f:layout name="Permission" />
+
+<f:section name="iconButtons">
+       <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><bu:spriteManagerIcon iconName="actions-document-view" /></a>
+</f:section>
+
+<f:section name="headline">
+       <h1><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:permissions" /></h1>
+</f:section>
+
+<f:section name="content">
+       <div class="form-group">
+               <label for="depth"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Depth" />:</label>
+               <f:form.select id="depth" value="{depth}" options="{depthOptions}" additionalAttributes="{onchange: 'jumpToUrl(\'{depthBaseUrl}\'.replace(\'__DEPTH__\', this.options[this.selectedIndex].value), this);'}" />
+       </div>
+
+       <table class="t3-table" id="typo3-permissionList">
+               <thead>
+               <tr>
+                       <th colspan="2">&nbsp;</th>
+                       <th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Owner" /></th>
+                       <th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></th>
+                       <th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Everybody" /></th>
+                       <th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock" /></th>
+               </tr>
+               </thead>
+               <f:for each="{viewTree}" as="data">
+                       <tr>
+                               <f:if condition="{data.cellAttrib}">
+                                       <f:then>
+                                               <td align="left" nowrap="nowrap" {data.cellAttrib}>
+                                                       <f:format.raw>{data.html}</f:format.raw>
+                                               </td>
+                                       </f:then>
+                                       <f:else>
+                                               <td align="left" nowrap="nowrap" {data.groupName}>
+                                                       <f:format.raw>{data.html}</f:format.raw>
+                                               </td>
+                                       </f:else>
+                               </f:if>
+                               <f:if condition="{data.editPermsAllowed}">
+                                       <f:then>
+                                               <td>
+                                                       <f:if condition="{data.id} > 0">
+                                                               <f:link.action action="edit" arguments="{id: data.id, depth: depth}" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:ch_permissions')}">
+                                                                       <bu:spriteManagerIcon iconName="actions-document-open" />
+                                                               </f:link.action>
+                                                       </f:if>
+                                               </td>
+                                       </f:then>
+                                       <f:else>
+                                               <td></td>
+                                       </f:else>
+                               </f:if>
+                               <td nowrap="nowrap"><f:format.raw>{data.userPermissions}</f:format.raw></td>
+                               <td nowrap="nowrap"><f:format.raw>{data.groupPermissions}</f:format.raw></td>
+                               <td nowrap="nowrap"><f:format.raw>{data.otherPermissions}</f:format.raw></td>
+                               <td nowrap="nowrap">
+                               <f:if condition="{data.id} > 0">
+                                       <span id="el_{data.id}">
+                                               <f:if condition="{data.editLock}">
+                                                       <f:then>
+                                                               <a class="editlock" data-page="{data.pageId}" data-lockstate="1" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock_descr')}">
+                                                                       <bu:spriteManagerIcon iconName="status-warning-lock" />
+                                                               </a>
+                                                       </f:then>
+                                                       <f:else>
+                                                               <a class="editlock" data-page="{data.pageId}" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">
+                                                                       [+]
+                                                               </a>
+                                                       </f:else>
+                                               </f:if>
+                                       </span>
+                               </f:if>
+                       </tr>
+               </f:for>
+       </table>
+
+       <br />
+       <f:format.raw>{cshItem}</f:format.raw>
+
+       <h3><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Legend" />:</h3>
+       <div class="legend">
+               <div class="pull-left">
+                       <f:image src="{f:uri.resource(path:'Images/legend.gif')}" width="90" height="75" alt="" />
+               </div>
+               <small>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:1" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:1_t" /><br/>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:16" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:16_t" /><br/>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:2" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:2_t" /><br/>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:4_t" /><br/>
+                       <strong><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8" /></strong>: <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:8_t" />
+               </small>
+       </div>
+       <p><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:def" /></p>
+       <p>
+               <bu:spriteManagerIcon iconName="status-status-permission-granted" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Granted" /><br/>
+               <bu:spriteManagerIcon iconName="status-status-permission-denied" /> <f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:A_Denied" />
+       </p>
+</f:section>
\ No newline at end of file
index 7ea54b1..785e880 100644 (file)
@@ -45,4 +45,11 @@ form div { clear: both; margin-bottom: 5px; }
 
 /**
  * @end
- */
\ No newline at end of file
+ */
+
+.legend .pull-left {
+    margin-right: 0.5em;
+}
+.t3-table a {
+    cursor: pointer;
+}
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Public/Icons/module-permission.png b/typo3/sysext/beuser/Resources/Public/Icons/module-permission.png
new file mode 100644 (file)
index 0000000..5c80f38
Binary files /dev/null and b/typo3/sysext/beuser/Resources/Public/Icons/module-permission.png differ
diff --git a/typo3/sysext/beuser/Resources/Public/Images/legend.gif b/typo3/sysext/beuser/Resources/Public/Images/legend.gif
new file mode 100644 (file)
index 0000000..c27a7c9
Binary files /dev/null and b/typo3/sysext/beuser/Resources/Public/Images/legend.gif differ
diff --git a/typo3/sysext/beuser/Resources/Public/JavaScript/Permissions.js b/typo3/sysext/beuser/Resources/Public/JavaScript/Permissions.js
new file mode 100644 (file)
index 0000000..2d5acb8
--- /dev/null
@@ -0,0 +1,314 @@
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Javascript functions regarding the permissions module
+ */
+define('TYPO3/CMS/Beuser/Permissions', ['jquery'], function($) {
+
+       var Permissions = {
+               options: {
+                       containerSelector: '#typo3-permissionList'
+               }
+       };
+       var ajaxUrl = TYPO3.settings.ajaxUrls['PermissionAjaxController::dispatch'];
+
+       /**
+        * changes the value of the permissions in the form
+        */
+       Permissions.setCheck = function(checknames, varname) {
+               if (document.editform[varname]) {
+                       var res = document.editform[varname].value;
+                       for (var a = 1; a <= 5; a++) {
+                               document.editform[checknames + '[' + a + ']'].checked = (res & Math.pow(2, a-1));
+                       }
+               }
+       };
+
+       /**
+        * checks for a change of the permissions in the form
+        */
+       Permissions.checkChange = function(checknames, varname) {
+               var res = 0;
+               for (var a = 1; a <= 5; a++) {
+                       if (document.editform[checknames + '[' + a + ']'].checked) {
+                               res|=Math.pow(2,a-1);
+                       }
+               }
+               document.editform[varname].value = res | (checknames === 'tx_beuser_system_beusertxpermission[check][perms_user]' ? 1 : 0);
+               Permissions.setCheck(checknames, varname);
+       };
+
+       /**
+        * wrapper function to call a URL in the current frame
+        */
+       Permissions.jumpToUrl = function(url) {
+               window.location.href = url;
+       };
+
+       /**
+        * changes permissions by sending an AJAX request to the server
+        */
+       Permissions.setPermissions = function($element) {
+               var page = $element.data('page');
+               var who = $element.data('who');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'page': page,
+                               'who': who,
+                               'permissions': $element.data('permissions'),
+                               'mode': $element.data('mode'),
+                               'bits': $element.data('bits')
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#' + page + '_' + who).replaceWith(data);
+               });
+       };
+
+       /**
+        * changes the flag to lock the editing on a page by sending an AJAX request
+        */
+       Permissions.toggleEditLock = function($element) {
+               var page = $element.data('page');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'action': 'toggle_edit_lock',
+                               'page': page,
+                               'editLockState': $element.data('lockstate')
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#el_' + page).replaceWith(data);
+               });
+       };
+
+       /**
+        * Owner-related: Set the new owner of a page by executing an ajax call
+        */
+       Permissions.changeOwner = function($element) {
+               var page = $element.data('page');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'action': 'change_owner',
+                               'page': page,
+                               'ownerUid': $element.data('owner'),
+                               'newOwnerUid': $('#new_page_owner').val()
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#o_' + page).replaceWith(data);
+               });
+       };
+
+       /**
+        * Owner-related: load the selector for selecting
+        * the owner of a page by executing an ajax call
+        */
+       Permissions.showChangeOwnerSelector = function($element) {
+               var page = $element.data('page');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'action': 'show_change_owner_selector',
+                               'page': page,
+                               'ownerUid': $element.data('ownerUid'),
+                               'username': $element.data('username')
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#o_' + page).replaceWith(data);
+               });
+       };
+
+       /**
+        * Owner-related: Update the HTML view and show the original owner
+        */
+       Permissions.restoreOwner = function($element) {
+               var page = $element.data('page');
+               var username = $element.data('username');
+               var usernameHtml = username;
+               if (typeof username === 'undefined') {
+                       username = $('<span>', {
+                               'class': 'not_set',
+                               'text': '[not set]'
+                       });
+                       usernameHtml = username.html();
+                       username = username.text();
+               }
+
+               var html = $('<span/>', {
+                       'id': 'o_' + page
+               });
+               var aSelector = $('<a/>', {
+                       'class': 'ug_selector changeowner',
+                       'data-page': page,
+                       'data-owner': $element.data('owner'),
+                       'data-username': usernameHtml,
+                       'text': username
+               });
+               html.append(aSelector);
+
+               // Replace content
+               $('#o_' + page).replaceWith(html);
+       };
+
+       /**
+        * Group-related: Set the new group by executing an ajax call
+        */
+       Permissions.changeGroup = function($element) {
+               var page = $element.data('page');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'action': 'change_group',
+                               'page': page,
+                               'groupUid': $element.data('group'),
+                               'newGroupUid': $('#new_page_group').val()
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#g_' + page).replaceWith(data);
+               });
+       };
+
+       /**
+        * Group-related: Load the selector by executing an ajax call
+        */
+       Permissions.showChangeGroupSelector = function($element) {
+               var page = $element.data('page');
+
+               $.ajax({
+                       url: ajaxUrl,
+                       type: 'post',
+                       dataType: 'html',
+                       cache: false,
+                       data: {
+                               'action': 'show_change_group_selector',
+                               'page': page,
+                               'groupUid': $element.data('lockstate'),
+                               'groupname': $element.data('groupname')
+                       }
+               }).done(function(data) {
+                       // Replace content
+                       $('#g_' + page).replaceWith(data);
+               });
+       };
+
+       /**
+        * Group-related: Update the HTML view and show the original group
+        */
+       Permissions.restoreGroup = function($element) {
+               var page = $element.data('page');
+               var groupname = $element.data('groupname');
+               var groupnameHtml = groupname;
+               if (typeof groupname === 'undefined') {
+                       groupname = $('<span>', {
+                               'class': 'not_set',
+                               'text': '[not set]'
+                       });
+                       groupnameHtml = groupname.html();
+                       groupname = groupname.text();
+               }
+               var html = $('<span/>', {
+                       'id': 'g_' + page
+               });
+               var aSelector = $('<a/>', {
+                       'class': 'ug_selector changegroup',
+                       'data-page': page,
+                       'data-group': $element.data('group'),
+                       'data-groupname': groupnameHtml,
+                       'text': groupname
+               });
+               html.append(aSelector);
+
+               // Replace content
+               $('#g_' + page).replaceWith(html);
+       };
+
+       /**
+        * initializes events using deferred bound to document
+        * so AJAX reloads are no problem
+        */
+       Permissions.initializeEvents = function() {
+
+               // Click event to change permissions
+               $(Permissions.options.containerSelector).on('click', '.change-permission', function(evt) {
+                       evt.preventDefault();
+                       Permissions.setPermissions($(this));
+               }).on('click', '.editlock', function(evt) {
+                       // Click event for lock state
+                       evt.preventDefault();
+                       Permissions.toggleEditLock($(this));
+               }).on('click', '.changeowner', function(evt) {
+                       // Click event to change owner
+                       evt.preventDefault();
+                       Permissions.showChangeOwnerSelector($(this));
+               }).on('click', '.changegroup', function(evt) {
+                       // click event to change group
+                       evt.preventDefault();
+                       Permissions.showChangeGroupSelector($(this));
+               }).on('click', '.restoreowner', function(evt) {
+                       // Add click handler for restoring previous owner
+                       evt.preventDefault();
+                       Permissions.restoreOwner($(this));
+               }).on('click', '.saveowner', function(evt) {
+                       // Add click handler for saving owner
+                       evt.preventDefault();
+                       Permissions.changeOwner($(this));
+               }).on('click', '.restoregroup', function(evt) {
+                       // Add click handler for restoring previous group
+                       evt.preventDefault();
+                       Permissions.restoreGroup($(this));
+               }).on('click', '.savegroup', function(evt) {
+                       // Add click handler for saving group
+                       evt.preventDefault();
+                       Permissions.changeGroup($(this));
+               });
+       };
+
+       /**
+        * initialize and return the Permissions object
+        */
+       return function() {
+               $(document).ready(function() {
+                       Permissions.initializeEvents();
+               });
+
+               TYPO3.Permissions = Permissions;
+               return Permissions;
+       }();
+});
index d8f669f..db06504 100644 (file)
@@ -2,7 +2,7 @@
 defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
-       // Module Admin > Backend Users
+       // Module System > Backend Users
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
                'TYPO3.CMS.' . $_EXTKEY,
                'system',
@@ -17,4 +17,25 @@ if (TYPO3_MODE === 'BE') {
                        'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf'
                )
        );
-}
+
+       // Module System > Access
+       \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
+               'TYPO3.CMS.' . $_EXTKEY,
+               'system',
+               'tx_Permission',
+               'top',
+               array(
+                       'Permission' => 'index, edit, update'
+               ),
+               array(
+                       'access' => 'admin',
+                       'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/module-permission.png',
+                       'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod_permission.xlf',
+                       'navigationComponentId' => 'typo3-pagetree'
+               )
+       );
+
+       // Register AJAX Controller
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('PermissionAjaxController::dispatch',
+               'TYPO3\\CMS\\Beuser\\Controller\\PermissionAjaxController->dispatch');
+}
\ No newline at end of file
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-62339-MoveExtPermIntoExtBeuser.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-62339-MoveExtPermIntoExtBeuser.rst
new file mode 100644 (file)
index 0000000..e15eea2
--- /dev/null
@@ -0,0 +1,27 @@
+====================================================================
+Breaking: #62339 - Move EXT:perm into EXT:beuser and remove EXT:perm
+====================================================================
+
+Description
+===========
+
+The extension EXT:perm is removed from core, the perms module is moved into EXT:beuser.
+The BE module moved from "Web Access" to "System Access"
+
+
+Impact
+======
+
+Extensions that use EXT:perm or maybe depends on it will cause problems
+
+
+Affected installations
+======================
+
+A TYPO3 instance is affected if a 3rd party extension uses parts the removed extension.
+
+
+Migration
+=========
+
+The logic is moved into EXT:beuser. No special migration is necessary.
\ No newline at end of file
diff --git a/typo3/sysext/lang/locallang_mod_web_perm.xlf b/typo3/sysext/lang/locallang_mod_web_perm.xlf
deleted file mode 100644 (file)
index d55db06..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
-       <file t3:id="1415814882" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:34Z" product-name="lang">
-               <header/>
-               <body>
-                       <trans-unit id="permissions" xml:space="preserve">
-                               <source>Permissions</source>
-                       </trans-unit>
-                       <trans-unit id="ch_permissions" xml:space="preserve">
-                               <source>Change permissions</source>
-                       </trans-unit>
-                       <trans-unit id="Legend" xml:space="preserve">
-                               <source>Legend</source>
-                       </trans-unit>
-                       <trans-unit id="Owner" xml:space="preserve">
-                               <source>Owner</source>
-                       </trans-unit>
-                       <trans-unit id="Group" xml:space="preserve">
-                               <source>Group</source>
-                       </trans-unit>
-                       <trans-unit id="Everybody" xml:space="preserve">
-                               <source>Everybody</source>
-                       </trans-unit>
-                       <trans-unit id="EditLock" xml:space="preserve">
-                               <source>Lock</source>
-                       </trans-unit>
-                       <trans-unit id="EditLock_descr" xml:space="preserve">
-                               <source>The page and all content is locked for editing by all non-Admin users.</source>
-                       </trans-unit>
-                       <trans-unit id="Save" xml:space="preserve">
-                               <source>Save</source>
-                       </trans-unit>
-                       <trans-unit id="Abort" xml:space="preserve">
-                               <source>Abort</source>
-                       </trans-unit>
-                       <trans-unit id="Edit" xml:space="preserve">
-                               <source>EDIT</source>
-                       </trans-unit>
-                       <trans-unit id="recursive" xml:space="preserve">
-                               <source>Set recursively</source>
-                       </trans-unit>
-                       <trans-unit id="pages_affected" xml:space="preserve">
-                               <source>pages affected</source>
-                       </trans-unit>
-                       <trans-unit id="user_overview" xml:space="preserve">
-                               <source>User overview</source>
-                       </trans-unit>
-                       <trans-unit id="Mode" xml:space="preserve">
-                               <source>Mode</source>
-                       </trans-unit>
-                       <trans-unit id="Depth" xml:space="preserve">
-                               <source>Depth</source>
-                       </trans-unit>
-                       <trans-unit id="levels" xml:space="preserve">
-                               <source>levels</source>
-                       </trans-unit>
-                       <trans-unit id="User" xml:space="preserve">
-                               <source>User</source>
-                       </trans-unit>
-                       <trans-unit id="def" xml:space="preserve">
-                               <source>Definition: 'content' is records from all tables on a page - except from records from the table 'pages' (Pages).</source>
-                       </trans-unit>
-                       <trans-unit id="A_Granted" xml:space="preserve">
-                               <source>Access Granted</source>
-                       </trans-unit>
-                       <trans-unit id="A_Denied" xml:space="preserve">
-                               <source>Access Denied</source>
-                       </trans-unit>
-                       <trans-unit id="1" xml:space="preserve">
-                               <source>Show page</source>
-                       </trans-unit>
-                       <trans-unit id="16" xml:space="preserve">
-                               <source>Edit content</source>
-                       </trans-unit>
-                       <trans-unit id="2" xml:space="preserve">
-                               <source>Edit page</source>
-                       </trans-unit>
-                       <trans-unit id="4" xml:space="preserve">
-                               <source>Delete page</source>
-                       </trans-unit>
-                       <trans-unit id="8" xml:space="preserve">
-                               <source>New pages</source>
-                       </trans-unit>
-                       <trans-unit id="1_t" xml:space="preserve">
-                               <source>Show/Copy page and content.</source>
-                       </trans-unit>
-                       <trans-unit id="16_t" xml:space="preserve">
-                               <source>Change/Add/Delete/Move content.</source>
-                       </trans-unit>
-                       <trans-unit id="2_t" xml:space="preserve">
-                               <source>Change/Move page, eg. change pagetitle etc.</source>
-                       </trans-unit>
-                       <trans-unit id="4_t" xml:space="preserve">
-                               <source>Delete page and content.</source>
-                       </trans-unit>
-                       <trans-unit id="8_t" xml:space="preserve">
-                               <source>Create new pages under this page.</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
-                               <source>Page editing permissions</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
-                               <source>Setting of page permissions is vital for controlling backend user access to pages. You can assign a user and a group as owners of a page and set access permissions for each.</source>
-                       </trans-unit>
-                       <trans-unit id="mlang_tabs_tab" xml:space="preserve">
-                               <source>Access</source>
-                       </trans-unit>
-                       <trans-unit id="WorkspaceWarning" xml:space="preserve">
-                               <source>Workspace Warning</source>
-                       </trans-unit>
-                       <trans-unit id="WorkspaceWarningText" xml:space="preserve">
-                               <source>Permissions you set in the workspace are effective on the elements only &lt;em&gt;after&lt;/em&gt; they are published! If you need to set permissions which are effective right now, you must do so in the Live workspace. (Permissions are always evaluated on the Live workspace record/placeholder of a draft version)</source>
-                       </trans-unit>
-                       <trans-unit id="notSet" xml:space="preserve">
-                               <source>not set</source>
-                       </trans-unit>
-                       <trans-unit id="deleted" xml:space="preserve">
-                               <source>deleted</source>
-                       </trans-unit>
-               </body>
-       </file>
-</xliff>
diff --git a/typo3/sysext/perm/Classes/Controller/PermissionAjaxController.php b/typo3/sysext/perm/Classes/Controller/PermissionAjaxController.php
deleted file mode 100644 (file)
index 738063c..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-<?php
-namespace TYPO3\CMS\Perm\Controller;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * This class extends the permissions module in the TYPO3 Backend to provide
- * convenient methods of editing of page permissions (including page ownership
- * (user and group)) via new AjaxRequestHandler facility
- */
-class PermissionAjaxController {
-
-       /**
-        * The local configuration array
-        *
-        * @var array
-        */
-       protected $conf = array();
-
-       /**
-        * The constructor of this class
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_web_perm.xlf');
-               // Configuration, variable assignment
-               $this->conf['page'] = GeneralUtility::_POST('page');
-               $this->conf['who'] = GeneralUtility::_POST('who');
-               $this->conf['mode'] = GeneralUtility::_POST('mode');
-               $this->conf['bits'] = (int)GeneralUtility::_POST('bits');
-               $this->conf['permissions'] = (int)GeneralUtility::_POST('permissions');
-               $this->conf['action'] = GeneralUtility::_POST('action');
-               $this->conf['ownerUid'] = (int)GeneralUtility::_POST('ownerUid');
-               $this->conf['username'] = GeneralUtility::_POST('username');
-               $this->conf['groupUid'] = (int)GeneralUtility::_POST('groupUid');
-               $this->conf['groupname'] = GeneralUtility::_POST('groupname');
-               $this->conf['editLockState'] = (int)GeneralUtility::_POST('editLockState');
-               // User: Replace some parts of the posted values
-               $this->conf['new_owner_uid'] = (int)GeneralUtility::_POST('newOwnerUid');
-               $temp_owner_data = BackendUtility::getUserNames('username, uid', ' AND uid = ' . $this->conf['new_owner_uid']);
-               $this->conf['new_owner_username'] = htmlspecialchars($temp_owner_data[$this->conf['new_owner_uid']]['username']);
-               // Group: Replace some parts of the posted values
-               $this->conf['new_group_uid'] = (int)GeneralUtility::_POST('newGroupUid');
-               $temp_group_data = BackendUtility::getGroupNames('title,uid', ' AND uid = ' . $this->conf['new_group_uid']);
-               $this->conf['new_group_username'] = htmlspecialchars($temp_group_data[$this->conf['new_group_uid']]['title']);
-       }
-
-       /**
-        * The main dispatcher function. Collect data and prepare HTML output.
-        *
-        * @param array $params array of parameters from the AJAX interface, currently unused
-        * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj object of type AjaxRequestHandler
-        * @return void
-        */
-       public function dispatch($params = array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL) {
-               $content = '';
-               // Basic test for required value
-               if ($this->conf['page'] > 0) {
-                       // Init TCE for execution of update
-                       /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
-                       $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-                       $tce->stripslashes_values = 1;
-                       // Determine the scripts to execute
-                       switch ($this->conf['action']) {
-                               case 'show_change_owner_selector':
-                                       $content = $this->renderUserSelector($this->conf['page'], $this->conf['ownerUid'], $this->conf['username']);
-                                       break;
-                               case 'change_owner':
-                                       if (is_int($this->conf['new_owner_uid'])) {
-                                               // Prepare data to change
-                                               $data = array();
-                                               $data['pages'][$this->conf['page']]['perms_userid'] = $this->conf['new_owner_uid'];
-                                               // Execute TCE Update
-                                               $tce->start($data, array());
-                                               $tce->process_datamap();
-                                               $content = self::renderOwnername($this->conf['page'], $this->conf['new_owner_uid'], $this->conf['new_owner_username']);
-                                       } else {
-                                               $ajaxObj->setError('An error occurred: No page owner uid specified.');
-                                       }
-                                       break;
-                               case 'show_change_group_selector':
-                                       $content = $this->renderGroupSelector($this->conf['page'], $this->conf['groupUid'], $this->conf['groupname']);
-                                       break;
-                               case 'change_group':
-                                       if (is_int($this->conf['new_group_uid'])) {
-                                               // Prepare data to change
-                                               $data = array();
-                                               $data['pages'][$this->conf['page']]['perms_groupid'] = $this->conf['new_group_uid'];
-                                               // Execute TCE Update
-                                               $tce->start($data, array());
-                                               $tce->process_datamap();
-                                               $content = self::renderGroupname($this->conf['page'], $this->conf['new_group_uid'], $this->conf['new_group_username']);
-                                       } else {
-                                               $ajaxObj->setError('An error occurred: No page group uid specified.');
-                                       }
-                                       break;
-                               case 'toggle_edit_lock':
-                                       // Prepare data to change
-                                       $data = array();
-                                       $data['pages'][$this->conf['page']]['editlock'] = $this->conf['editLockState'] === 1 ? 0 : 1;
-                                       // Execute TCE Update
-                                       $tce->start($data, array());
-                                       $tce->process_datamap();
-                                       $content = $this->renderToggleEditLock($this->conf['page'], $data['pages'][$this->conf['page']]['editlock']);
-                                       break;
-                               default:
-                                       if ($this->conf['mode'] === 'delete') {
-                                               $this->conf['permissions'] = (int)($this->conf['permissions'] - $this->conf['bits']);
-                                       } else {
-                                               $this->conf['permissions'] = (int)($this->conf['permissions'] + $this->conf['bits']);
-                                       }
-                                       // Prepare data to change
-                                       $data = array();
-                                       $data['pages'][$this->conf['page']]['perms_' . $this->conf['who']] = $this->conf['permissions'];
-                                       // Execute TCE Update
-                                       $tce->start($data, array());
-                                       $tce->process_datamap();
-                                       $content = self::renderPermissions($this->conf['permissions'], $this->conf['page'], $this->conf['who']);
-                       }
-               } else {
-                       $ajaxObj->setError('This script cannot be called directly.');
-               }
-               $ajaxObj->addContent($this->conf['page'] . '_' . $this->conf['who'], $content);
-       }
-
-       /**
-        * Generate the user selector element
-        *
-        * @param int $page The page id to change the user for
-        * @param int $ownerUid The page owner uid
-        * @param string $username The username to display
-        * @return string The html select element
-        */
-       protected function renderUserSelector($page, $ownerUid, $username = '') {
-               // Get usernames
-               $beUsers = BackendUtility::getUserNames();
-               // Init groupArray
-               $groups = array();
-               if (!$GLOBALS['BE_USER']->isAdmin()) {
-                       $beUsers = BackendUtility::blindUserNames($beUsers, $groups, 1);
-               }
-               // Owner selector:
-               $options = '';
-               // Loop through the users
-               foreach ($beUsers as $uid => $row) {
-                       $selected = $uid == $ownerUid ? ' selected="selected"' : '';
-                       $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';
-               }
-               $elementId = 'o_' . $page;
-               $options = '<option value="0"></option>' . $options;
-               $selector = '<select name="new_page_owner" id="new_page_owner">' . $options . '</select>';
-               $saveButton = '<a class="saveowner" data-page="' . $page . '" data-owner="' . $ownerUid . '" data-element-id="' . $elementId . '" title="Change owner">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save') . '</a>';
-               $cancelButton = '<a class="restoreowner" data-page="' . $page . '"  data-owner="' . $ownerUid . '" data-element-id="' . $elementId . '"' . (!empty($username) ? ' data-username="' . htmlspecialchars($username) . '"' : '') . ' title="Cancel">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close') . '</a>';
-               return '<span id="' . $elementId . '">' . $selector . $saveButton . $cancelButton . '</span>';
-       }
-
-       /**
-        * Generate the group selector element
-        *
-        * @param int $page The page id to change the user for
-        * @param int $groupUid The page group uid
-        * @param string $username The username to display
-        * @return string The html select element
-        */
-       protected function renderGroupSelector($page, $groupUid, $groupname = '') {
-               // Get usernames
-               $beGroups = BackendUtility::getListGroupNames('title,uid');
-               $beGroupKeys = array_keys($beGroups);
-               $beGroupsO = ($beGroups = BackendUtility::getGroupNames());
-               if (!$GLOBALS['BE_USER']->isAdmin()) {
-                       $beGroups = BackendUtility::blindGroupNames($beGroupsO, $beGroupKeys, 1);
-               }
-               // Group selector:
-               $options = '';
-               // flag: is set if the page-groupid equals one from the group-list
-               $userset = 0;
-               // Loop through the groups
-               foreach ($beGroups as $uid => $row) {
-                       if ($uid == $groupUid) {
-                               $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 && $groupUid) {
-                       $options = '<option value="' . $groupUid . '" selected="selected">' . htmlspecialchars($beGroupsO[$groupUid]['title']) . '</option>' . $options;
-               }
-               $elementId = 'g_' . $page;
-               $options = '<option value="0"></option>' . $options;
-               $selector = '<select name="new_page_group" id="new_page_group">' . $options . '</select>';
-               $saveButton = '<a class="savegroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '" title="Change group">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save') . '</a>';
-               $cancelButton = '<a class="restoregroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '"' . (!empty($groupname) ? ' data-groupname="' . htmlspecialchars($groupname) . '"' : '') . ' title="Cancel">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close') . '</a>';
-               return '<span id="' . $elementId . '">' . $selector . $saveButton . $cancelButton . '</span>';
-       }
-
-       /**
-        * Print the string with the new owner of a page record
-        *
-        * @param int $page The TYPO3 page id
-        * @param int $ownerUid The new page user uid
-        * @param string $username The TYPO3 BE username (used to display in the element)
-        * @param bool $validUser Must be set to FALSE, if the user has no name or is deleted
-        * @return string The new group wrapped in HTML
-        */
-       static public function renderOwnername($page, $ownerUid, $username, $validUser = TRUE) {
-               $elementId = 'o_' . $page;
-               return '<span id="' . $elementId . '"><a class="ug_selector changeowner" data-page="' . $page . '" data-owner="' . $ownerUid . '" data-username="' . htmlspecialchars($username) . '">' . ($validUser ? ($username == '' ? '<span class=not_set>[' . $GLOBALS['LANG']->getLL('notSet') . ']</span>' : htmlspecialchars(GeneralUtility::fixed_lgd_cs($username, 20))) : '<span class=not_set title="' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($username, 20)) . '">[' . $GLOBALS['LANG']->getLL('deleted') . ']</span>') . '</a></span>';
-       }
-
-       /**
-        * Print the string with the new group of a page record
-        *
-        * @param int $page The TYPO3 page id
-        * @param int $groupUid The new page group uid
-        * @param string $groupname The TYPO3 BE groupname (used to display in the element)
-        * @param bool $validGroup Must be set to FALSE, if the group has no name or is deleted
-        * @return string The new group wrapped in HTML
-        */
-       static public function renderGroupname($page, $groupUid, $groupname, $validGroup = TRUE) {
-               $elementId = 'g_' . $page;
-               return '<span id="' . $elementId . '"><a class="ug_selector changegroup" data-page="' . $page . '" data-group="' . $groupUid . '" data-groupname="' . htmlspecialchars($groupname) . '">' . ($validGroup ? ($groupname == '' ? '<span class=not_set>[' . $GLOBALS['LANG']->getLL('notSet') . ']</span>' : htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupname, 20))) : '<span class=not_set title="' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupname, 20)) . '">[' . $GLOBALS['LANG']->getLL('deleted') . ']</span>') . '</a></span>';
-       }
-
-       /**
-        * Print the string with the new edit lock state of a page record
-        *
-        * @param int $page The TYPO3 page id
-        * @param string $editlockstate The state of the TYPO3 page (locked, unlocked)
-        * @return string The new edit lock string wrapped in HTML
-        */
-       protected function renderToggleEditLock($page, $editLockState) {
-               if ($editLockState === 1) {
-                       $ret = '<span id="el_' . $page . '"><a class="editlock" data-page="' . (int)$page . '" data-lockstate="1" title="The page and all content is locked for editing by all non-Admin users.">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-warning-lock') . '</a></span>';
-               } else {
-                       $ret = '<span id="el_' . $page . '"><a class="editlock" data-page="' . (int)$page . '" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>';
-               }
-               return $ret;
-       }
-
-       /**
-        * Print a set of permissions. Also used in index.php
-        *
-        * @param int $int Permission integer (bits)
-        * @param int $page The TYPO3 page id
-        * @param string $who The scope (user, group or everybody)
-        * @return string HTML marked up x/* indications.
-        */
-       static public function renderPermissions($int, $pageId = 0, $who = 'user') {
-               $str = '';
-               $permissions = array(1, 16, 2, 4, 8);
-               foreach ($permissions as $permission) {
-                       if ($int & $permission) {
-                               $str .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-permission-granted', array(
-                                       'title' => $GLOBALS['LANG']->getLL($permission, TRUE),
-                                       'class' => 'change-permission',
-                                       'data-page' => $pageId,
-                                       'data-permissions' => $int,
-                                       'data-mode' => 'delete',
-                                       'data-who' => $who,
-                                       'data-bits' => $permission,
-                                       'style' => 'cursor:pointer'
-                               ));
-                       } else {
-                               $str .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-permission-denied', array(
-                                       'title' => $GLOBALS['LANG']->getLL($permission, TRUE),
-                                       'class' => 'change-permission',
-                                       'data-page' => $pageId,
-                                       'data-permissions' => $int,
-                                       'data-mode' => 'add',
-                                       'data-who' => $who,
-                                       'data-bits' => $permission,
-                                       'style' => 'cursor:pointer'
-                               ));
-                       }
-               }
-               return '<span id="' . $pageId . '_' . $who . '">' . $str . '</span>';
-       }
-
-}
diff --git a/typo3/sysext/perm/Classes/Controller/PermissionModuleController.php b/typo3/sysext/perm/Classes/Controller/PermissionModuleController.php
deleted file mode 100644 (file)
index 068d2a1..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-<?php
-namespace TYPO3\CMS\Perm\Controller;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
-
-/**
- * Module: Permission setting
- *
- * Script Class for the Web > Access module
- * This module lets you view and change permissions for pages.
- *
- * Variables:
- * $this->MOD_SETTINGS['depth']: int 1-3: decides the depth of the list
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author Andreas Kundoch <typo3@mehrwert.de>
- */
-class PermissionModuleController {
-
-       /**
-        * Number of levels to enable recursive settings for
-        *
-        * @var int
-        */
-       public $getLevels = 10;
-
-       /**
-        * Module config
-        *
-        * @var array
-        */
-       protected $MCONF = array();
-
-       /**
-        * Document Template Object
-        *
-        * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
-        */
-       public $doc;
-
-       /**
-        * Content accumulation
-        *
-        * @var string
-        */
-       public $content;
-
-       /**
-        * Module menu
-        *
-        * @var array
-        */
-       public $MOD_MENU = array();
-
-       /**
-        * Module settings, cleansed.
-        *
-        * @var array
-        */
-       public $MOD_SETTINGS = array();
-
-       /**
-        * Page select permissions
-        *
-        * @var string
-        */
-       public $perms_clause;
-
-       /**
-        * Current page record
-        *
-        * @var array
-        */
-       public $pageinfo;
-
-       /**
-        * Set internally if the current user either OWNS the page OR is admin user!
-        *
-        * @var bool
-        */
-       public $editingAllowed;
-
-       /**
-        * Internal, static: GPvars: Page id.
-        *
-        * @var int
-        */
-       public $id;
-
-       /**
-        * If set, editing of the page permissions will occur (showing the editing screen). Notice:
-        * This value is evaluated against permissions and so it will change internally!
-        *
-        * @var bool
-        */
-       public $edit;
-
-       /**
-        * ID to return to after editing.
-        *
-        * @var int
-        */
-       public $return_id;
-
-       /**
-        * Id of the page which was just edited.
-        *
-        * @var int
-        */
-       public $lastEdited;
-
-       /**
-        * Constructor
-        */
-       public function __construct() {
-               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_web_perm.xlf');
-               $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], TRUE);
-       }
-
-       /**
-        * Initialization of the class
-        *
-        * @return void
-        */
-       public function init() {
-               // Setting GPvars:
-               $this->id = (int)GeneralUtility::_GP('id');
-               $this->edit = GeneralUtility::_GP('edit');
-               $this->return_id = GeneralUtility::_GP('return_id');
-               $this->lastEdited = GeneralUtility::_GP('lastEdited');
-               // Module name;
-               $this->MCONF = $GLOBALS['MCONF'];
-               // Page select clause:
-               $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-               // Initializing document template object:
-               $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->setModuleTemplate('EXT:perm/Resources/Private/Templates/perm.html');
-               $this->doc->form = '<form action="' . $GLOBALS['BACK_PATH'] . 'tce_db.php" method="post" name="editform">';
-
-               $this->doc->addStyleSheet('module', 'sysext/perm/Resources/Public/Styles/styles.css');
-               $this->doc->getPageRenderer()->loadJquery();
-               $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Perm/Permissions');
-
-               // Setting up the context sensitive menu:
-               $this->doc->getContextMenuCode();
-               // Set up menus:
-               $this->menuConfig();
-       }
-
-       /**
-        * Configuration of the menu and initialization of ->MOD_SETTINGS
-        *
-        * @return void
-        */
-       public function menuConfig() {
-               $level = $GLOBALS['LANG']->getLL('levels');
-               $this->MOD_MENU = array(
-                       'depth' => array(
-                               1 => '1 ' . $level,
-                               2 => '2 ' . $level,
-                               3 => '3 ' . $level,
-                               4 => '4 ' . $level,
-                               10 => '10 ' . $level
-                       )
-               );
-               // Clean up settings:
-               $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name']);
-       }
-
-       /**
-        * Main function, creating the content for the access editing forms/listings
-        *
-        * @return void
-        */
-       public function main() {
-               // Access check...
-               // The page will show only if there is a valid page and if this page may be viewed by the user
-               $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
-               $access = is_array($this->pageinfo);
-               // Checking access:
-               if ($this->id && $access || $GLOBALS['BE_USER']->isAdmin() && !$this->id) {
-                       if ($GLOBALS['BE_USER']->isAdmin() && !$this->id) {
-                               $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
-                       }
-                       // This decides if the editform can and will be drawn:
-                       $this->editingAllowed = $this->pageinfo['perms_userid'] == $GLOBALS['BE_USER']->user['uid'] || $GLOBALS['BE_USER']->isAdmin();
-                       $this->edit = $this->edit && $this->editingAllowed;
-                       // If $this->edit then these functions are called in the end of the page...
-                       if ($this->edit) {
-                               $this->doc->postCode .= $this->doc->wrapScriptTags('
-                                       require(["jquery", "TYPO3/CMS/Perm/Permissions"], function($, Permissions) {
-                                               Permissions.setCheck("check[perms_user]", "data[pages][' . $this->id . '][perms_user]");
-                                               Permissions.setCheck("check[perms_group]", "data[pages][' . $this->id . '][perms_group]");
-                                               Permissions.setCheck("check[perms_everybody]", "data[pages][' . $this->id . '][perms_everybody]");
-                                       });
-                               ');
-                       }
-
-                       // Draw the HTML page header.
-                       $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('permissions') . ($this->edit ? ': ' . $GLOBALS['LANG']->getLL('Edit') : ''));
-                       $vContent = $this->doc->getVersionSelector($this->id, 1);
-                       if ($vContent) {
-                               $this->content .= $this->doc->section('', $vContent);
-                       }
-
-                       // Main function, branching out:
-                       if (!$this->edit) {
-                               $this->notEdit();
-                       } else {
-                               $this->doEdit();
-                       }
-
-                       $docHeaderButtons = $this->getButtons();
-                       $markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']);
-                       $markers['CONTENT'] = $this->content;
-
-                       // Build the <body> for the module
-                       $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-               } else {
-                       // If no access or if ID == zero
-                       $this->content = $this->doc->header($GLOBALS['LANG']->getLL('permissions'));
-               }
-               // Renders the module page
-               $this->content = $this->doc->render($GLOBALS['LANG']->getLL('permissions'), $this->content);
-       }
-
-       /**
-        * Outputting the accumulated content to screen
-        *
-        * @return void
-        */
-       public function printContent() {
-               echo $this->doc->insertStylesAndJS($this->content);
-       }
-
-       /**
-        * Create the panel of buttons for submitting the form or otherwise perform operations.
-        *
-        * @return array all available buttons as an assoc. array
-        */
-       protected function getButtons() {
-               $buttons = array(
-                       'view' => '<a href="#" onclick="' . htmlspecialchars(
-                               BackendUtility::viewonclick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))
-                       ) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>',
-                       'shortcut' => ''
-               );
-
-               // Shortcut
-               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                       $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
-               }
-               return $buttons;
-       }
-
-       /*****************************
-        *
-        * Listing and Form rendering
-        *
-        *****************************/
-       /**
-        * 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 = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $GLOBALS['LANG']->getLL('WorkspaceWarningText'), $GLOBALS['LANG']->getLL('WorkspaceWarning'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
-                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
-                       $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
-                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
-                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
-                       $defaultFlashMessageQueue->enqueue($flashMessage);
-               }
-               // 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);
-               }
-
-               // 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;
-               $selector = '<select name="data[pages][' . $this->id . '][perms_userid]">' . $options . '</select>';
-               $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]">' . $options . '</select>';
-
-               $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Group'), $selector, TRUE);
-
-               // Permissions checkbox matrix:
-               $code = '
-                       <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>
-                                       </tr>
-                               </thead>
-                               <tbody>
-                                       <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>
-                                       </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>
-                                       </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>
-                                       </tr>
-                               </tbody>
-                       </table>
-
-                       <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'] . '" />
-                       ' . $this->getRecursiveSelect($this->id, $this->perms_clause) . '
-                       <input type="submit" name="submit" value="' . $GLOBALS['LANG']->getLL('Save', TRUE) . '" />' . '<input type="submit" value="' . $GLOBALS['LANG']->getLL('Abort', TRUE) . '" onclick="' . htmlspecialchars(('TYPO3.Permissions.jumpToUrl(' . GeneralUtility::quoteJSvalue((BackendUtility::getModuleUrl('system_perm') . '&id=' . $this->id), TRUE) . '); return false;')) . '" />
-                       <input type="hidden" name="redirect" value="' . htmlspecialchars((BackendUtility::getModuleUrl('system_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', NULL, '<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);
-               }
-       }
-
-       /**
-        * Showing the permissions in a tree ($this->edit = FALSE)
-        * (Adding content to internal content variable)
-        *
-        * @return void
-        */
-       public function notEdit() {
-               // 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::class);
-               $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'], '');
-
-               // Make header of table:
-               $code = '
-                       <thead>
-                               <tr>
-                                       <th colspan="2">&nbsp;</th>
-                                       <th>' . $GLOBALS['LANG']->getLL('Owner', TRUE) . '</th>
-                                       <th align="center">' . $GLOBALS['LANG']->getLL('Group', TRUE) . '</th>
-                                       <th align="center">' . $GLOBALS['LANG']->getLL('Everybody', TRUE) . '</th>
-                                       <th align="center">' . $GLOBALS['LANG']->getLL('EditLock', TRUE) . '</th>
-                               </tr>
-                       </thead>
-               ';
-
-               // Traverse tree:
-               foreach ($tree->tree as $data) {
-                       $cells = array();
-                       $pageId = $data['row']['uid'];
-
-                       // 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 = PermissionAjaxController::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)), FALSE);
-                       } else {
-                               $userName = PermissionAjaxController::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 = PermissionAjaxController::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)), FALSE);
-                       } else {
-                               $groupName = PermissionAjaxController::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 : '') . '>' .
-                                       $data['HTML'] . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $tLen)) . '</td>';
-
-                       // "Edit permissions" -icon
-                       if ($editPermsAllowed && $pageId) {
-                               $aHref = BackendUtility::getModuleUrl('system_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><a href="' . htmlspecialchars($aHref) . '" title="' . $GLOBALS['LANG']->getLL('ch_permissions', TRUE) . '">' .
-                                       IconUtility::getSpriteIcon('actions-document-open') . '</a></td>';
-                       } else {
-                               $cells[] = '<td></td>';
-                       }
-
-                       $cells[] = '
-                               <td nowrap="nowrap">' . ($pageId ? PermissionAjaxController::renderPermissions($data['row']['perms_user'], $pageId, 'user') . ' ' . $userName : '') . '</td>
-                               <td nowrap="nowrap">' . ($pageId ? PermissionAjaxController::renderPermissions($data['row']['perms_group'], $pageId, 'group') . ' ' . $groupName : '') . '</td>
-                               <td nowrap="nowrap">' . ($pageId ? ' ' . PermissionAjaxController::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '') . '</td>
-                               <td nowrap="nowrap">' . (
-                                       $data['row']['editlock'] ? '<span id="el_' . $pageId . '"><a class="editlock" data-page="' . (int)$pageId . '" data-lockstate="1" title="' . $GLOBALS['LANG']->getLL('EditLock_descr', TRUE) . '">' . IconUtility::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '"><a class="editlock" data-page="' . (int)$pageId . '" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>')) . '</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', NULL, '<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 class="legend">
-                               <div class="pull-left">
-                                       <img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />
-                               </div>
-                               <small>' . $legendText . '</small>
-                       </div>
-               ';
-
-               $code .= '<p>' . $GLOBALS['LANG']->getLL('def', TRUE) . '</p>';
-               $code .= '<p>' . IconUtility::getSpriteIcon('status-status-permission-granted') . $GLOBALS['LANG']->getLL('A_Granted', TRUE) . '<br>';
-               $code .= IconUtility::getSpriteIcon('status-status-permission-denied') . $GLOBALS['LANG']->getLL('A_Denied', TRUE) . '</p>';
-
-               // Adding section with legend code:
-               $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Legend') . ':', $code, TRUE, TRUE);
-       }
-
-       /*****************************
-        *
-        * Helper functions
-        *
-        *****************************/
-       /**
-        * Print a checkbox for the edit-permission form
-        *
-        * @param string $checkName Checkbox name key
-        * @param int $num Checkbox number index
-        * @return string HTML checkbox
-        */
-       public function printCheckBox($checkName, $num) {
-               $onclick = 'TYPO3.Permissions.checkChange(\'check[' . $checkName . ']\', \'data[pages][' . $GLOBALS['SOBE']->id . '][' . $checkName . ']\')';
-               return '<input type="checkbox" name="check[' . $checkName . '][' . $num . ']" onclick="' . htmlspecialchars($onclick) . '" /><br />';
-       }
-
-       /**
-        * Finding tree and offer setting of values recursively.
-        *
-        * @param int $id Page id.
-        * @param string $perms_clause Select clause
-        * @return string Select form element for recursive levels (if any levels are found)
-        */
-       public function getRecursiveSelect($id, $perms_clause) {
-               // Initialize tree object:
-               $tree = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
-               $tree->init('AND ' . $perms_clause);
-               $tree->addField('perms_userid', 1);
-               $tree->makeHTML = 0;
-               $tree->setRecs = 1;
-               // Make tree:
-               $tree->getTree($id, $this->getLevels, '');
-               // If there are a hierarchy of page ids, then...
-               if ($GLOBALS['BE_USER']->user['uid'] && count($tree->orig_ids_hierarchy)) {
-                       // Init:
-                       $label_recur = $GLOBALS['LANG']->getLL('recursive');
-                       $label_levels = $GLOBALS['LANG']->getLL('levels');
-                       $label_pA = $GLOBALS['LANG']->getLL('pages_affected');
-                       $theIdListArr = array();
-                       $opts = '
-                                               <option value=""></option>';
-                       // Traverse the number of levels we want to allow recursive setting of permissions for:
-                       for ($a = $this->getLevels; $a > 0; $a--) {
-                               if (is_array($tree->orig_ids_hierarchy[$a])) {
-                                       foreach ($tree->orig_ids_hierarchy[$a] as $theId) {
-                                               if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->user['uid'] == $tree->recs[$theId]['perms_userid']) {
-                                                       $theIdListArr[] = $theId;
-                                               }
-                                       }
-                                       $lKey = $this->getLevels - $a + 1;
-                                       $opts .= '
-                                               <option value="' . htmlspecialchars(implode(',', $theIdListArr)) . '">' . htmlspecialchars($label_recur . ' ' . $lKey . ' ' . $label_levels, ENT_COMPAT, 'UTF-8', FALSE) . ' (' . count($theIdListArr) . ' ' . $label_pA . ')' . '</option>';
-                               }
-                       }
-                       // Put the selector box together:
-                       $theRecursiveSelect = '<br />
-                                       <select name="mirror[pages][' . $id . ']">
-                                               ' . $opts . '
-                                       </select>
-                               <br /><br />';
-               } else {
-                       $theRecursiveSelect = '';
-               }
-               // Return selector box element:
-               return $theRecursiveSelect;
-       }
-
-}
diff --git a/typo3/sysext/perm/Resources/Private/Styles/styles.less b/typo3/sysext/perm/Resources/Private/Styles/styles.less
deleted file mode 100644 (file)
index afa8826..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-.legend {
-       .pull-left {
-               margin-right: 0.5em;
-       }
-}
-
-a.ug_selector {
-       cursor: pointer;
-       text-decoration: underline;
-
-       .not_set {
-               font-style: italic;
-       }
-}
\ No newline at end of file
diff --git a/typo3/sysext/perm/Resources/Private/Templates/perm.html b/typo3/sysext/perm/Resources/Private/Templates/perm.html
deleted file mode 100644 (file)
index 184ab80..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- ###FULLDOC### begin -->
-<div class="typo3-fullDoc">
-       <div id="typo3-docheader">
-               <div class="typo3-docheader-functions">
-                       <div class="left">###FUNC_MENU###</div>
-                       <div class="right">###PAGEPATH######PAGEINFO###</div>
-               </div>
-               <div class="typo3-docheader-buttons">
-                       <div class="left">###BUTTONLIST_LEFT###</div>
-                       <div class="right">###BUTTONLIST_RIGHT###</div>
-               </div>
-       </div>
-
-       <div id="typo3-docbody">
-               <div id="typo3-inner-docbody">
-                       ###CONTENT###
-               </div>
-       </div>
-</div>
-<!-- ###FULLDOC### end -->
-
-<!-- Grouping the icons on top -->
-
-<!-- ###BUTTON_GROUP_WRAP### -->
-<div class="buttongroup">###BUTTONS###</div>
-<!-- ###BUTTON_GROUP_WRAP### -->
-
-<!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP4### -->###VIEW###<!-- ###BUTTON_GROUP4### -->
-<!-- ###BUTTON_GROUPS_LEFT### -->
-
-<!-- ###BUTTON_GROUPS_RIGHT### -->
-<!-- ###BUTTON_GROUP1### -->###SHORTCUT###<!-- ###BUTTON_GROUP1### -->
-<!-- ###BUTTON_GROUPS_RIGHT### -->
diff --git a/typo3/sysext/perm/Resources/Public/Icons/module-perm.png b/typo3/sysext/perm/Resources/Public/Icons/module-perm.png
deleted file mode 100644 (file)
index 5c80f38..0000000
Binary files a/typo3/sysext/perm/Resources/Public/Icons/module-perm.png and /dev/null differ
diff --git a/typo3/sysext/perm/Resources/Public/JavaScript/Permissions.js b/typo3/sysext/perm/Resources/Public/JavaScript/Permissions.js
deleted file mode 100644 (file)
index ec5dbeb..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Javascript functions regarding the permissions module
- */
-define('TYPO3/CMS/Perm/Permissions', ['jquery'], function($) {
-
-       var Permissions = {
-               options: {
-                       containerSelector: '#typo3-permissionList'
-               }
-       };
-       var ajaxUrl = TYPO3.settings.ajaxUrls['PermissionAjaxController::dispatch'];
-
-       /**
-        * changes the value of the permissions in the form
-        */
-       Permissions.setCheck = function(checknames, varname) {
-               if (document.editform[varname]) {
-                       var res = document.editform[varname].value;
-                       for (var a = 1; a <= 5; a++) {
-                               document.editform[checknames + '[' + a + ']'].checked = (res & Math.pow(2, a-1));
-                       }
-               }
-       };
-
-       /**
-        * checks for a change of the permissions in the form
-        */
-       Permissions.checkChange = function(checknames, varname) {
-               var res = 0;
-               for (var a = 1; a <= 5; a++) {
-                       if (document.editform[checknames + '[' + a + ']'].checked) {
-                               res|=Math.pow(2,a-1);
-                       }
-               }
-               document.editform[varname].value = res | (checknames === 'check[perms_user]' ? 1 : 0);
-               Permissions.setCheck(checknames, varname);
-       };
-
-       /**
-        * wrapper function to call a URL in the current frame
-        */
-       Permissions.jumpToUrl = function(url) {
-               window.location.href = url;
-       };
-
-       /**
-        * changes permissions by sending an AJAX request to the server
-        */
-       Permissions.setPermissions = function($element) {
-               var page = $element.data('page');
-               var who = $element.data('who');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'page': page,
-                               'who': who,
-                               'permissions': $element.data('permissions'),
-                               'mode': $element.data('mode'),
-                               'bits': $element.data('bits')
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#' + page + '_' + who).replaceWith(data);
-               });
-       };
-
-       /**
-        * changes the flag to lock the editing on a page by sending an AJAX request
-        */
-       Permissions.toggleEditLock = function($element) {
-               var page = $element.data('page');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'action': 'toggle_edit_lock',
-                               'page': page,
-                               'editLockState': $element.data('lockstate')
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#el_' + page).replaceWith(data);
-               });
-       };
-
-       /**
-        * Owner-related: Set the new owner of a page by executing an ajax call
-        */
-       Permissions.changeOwner = function($element) {
-               var page = $element.data('page');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'action': 'change_owner',
-                               'page': page,
-                               'ownerUid': $element.data('owner'),
-                               'newOwnerUid': $('#new_page_owner').val()
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#o_' + page).replaceWith(data);
-               });
-       };
-
-       /**
-        * Owner-related: load the selector for selecting
-        * the owner of a page by executing an ajax call
-        */
-       Permissions.showChangeOwnerSelector = function($element) {
-               var page = $element.data('page');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'action': 'show_change_owner_selector',
-                               'page': page,
-                               'ownerUid': $element.data('ownerUid'),
-                               'username': $element.data('username')
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#o_' + page).replaceWith(data);
-               });
-       };
-
-       /**
-        * Owner-related: Update the HTML view and show the original owner
-        */
-       Permissions.restoreOwner = function($element) {
-               var page = $element.data('page');
-               var username = $element.data('username');
-               var usernameHtml = username;
-               if (typeof username === 'undefined') {
-                       username = $('<span>', {
-                               'class': 'not_set',
-                               'text': '[not set]'
-                       });
-                       username = username.text();
-                       usernameHtml = username.html();
-               }
-
-               var html = $('<span/>', {
-                       'id': 'o_' + page
-               });
-               var aSelector = $('<a/>', {
-                       'class': 'ug_selector changeowner',
-                       'data-page': page,
-                       'data-owner': $element.data('owner'),
-                       'data-username': usernameHtml,
-                       'text': username
-               });
-               html.append(aSelector);
-
-               // Replace content
-               $('#o_' + page).replaceWith(html);
-       };
-
-       /**
-        * Group-related: Set the new group by executing an ajax call
-        */
-       Permissions.changeGroup = function($element) {
-               var page = $element.data('page');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'action': 'change_group',
-                               'page': page,
-                               'groupUid': $element.data('group'),
-                               'newGroupUid': $('#new_page_group').val()
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#g_' + page).replaceWith(data);
-               });
-       };
-
-       /**
-        * Group-related: Load the selector by executing an ajax call
-        */
-       Permissions.showChangeGroupSelector = function($element) {
-               var page = $element.data('page');
-
-               $.ajax({
-                       url: ajaxUrl,
-                       type: 'post',
-                       dataType: 'html',
-                       cache: false,
-                       data: {
-                               'action': 'show_change_group_selector',
-                               'page': page,
-                               'groupUid': $element.data('lockstate'),
-                               'groupname': $element.data('groupname')
-                       }
-               }).done(function(data) {
-                       // Replace content
-                       $('#g_' + page).replaceWith(data);
-               });
-       };
-
-       /**
-        * Group-related: Update the HTML view and show the original group
-        */
-       Permissions.restoreGroup = function($element) {
-               var page = $element.data('page');
-               var groupname = $element.data('groupname');
-               var groupnameHtml = groupname;
-               if (typeof groupname === 'undefined') {
-                       groupname = $('<span>', {
-                               'class': 'not_set',
-                               'text': '[not set]'
-                       });
-                       groupname = groupname.text();
-                       groupnameHtml = groupname.html();
-               }
-               var html = $('<span/>', {
-                       'id': 'g_' + page
-               });
-               var aSelector = $('<a/>', {
-                       'class': 'ug_selector changegroup',
-                       'data-page': page,
-                       'data-group': $element.data('group'),
-                       'data-groupname': groupnameHtml,
-                       'text': groupname
-               });
-               html.append(aSelector);
-
-               // Replace content
-               $('#g_' + page).replaceWith(html);
-       };
-
-       /**
-        * initializes events using deferred bound to document
-        * so AJAX reloads are no problem
-        */
-       Permissions.initializeEvents = function() {
-
-               // Click event to change permissions
-               $(Permissions.options.containerSelector).on('click', '.change-permission', function(evt) {
-                       evt.preventDefault();
-                       Permissions.setPermissions($(this));
-               }).on('click', '.editlock', function(evt) {
-                       // Click event for lock state
-                       evt.preventDefault();
-                       Permissions.toggleEditLock($(this));
-               }).on('click', '.changeowner', function(evt) {
-                       // Click event to change owner
-                       evt.preventDefault();
-                       Permissions.showChangeOwnerSelector($(this));
-               }).on('click', '.changegroup', function(evt) {
-                       // click event to change group
-                       evt.preventDefault();
-                       Permissions.showChangeGroupSelector($(this));
-               }).on('click', '.restoreowner', function(evt) {
-                       // Add click handler for restoring previous owner
-                       evt.preventDefault();
-                       Permissions.restoreOwner($(this));
-               }).on('click', '.saveowner', function(evt) {
-                       // Add click handler for saving owner
-                       evt.preventDefault();
-                       Permissions.changeOwner($(this));
-               }).on('click', '.restoregroup', function(evt) {
-                       // Add click handler for restoring previous group
-                       evt.preventDefault();
-                       Permissions.restoreGroup($(this));
-               }).on('click', '.savegroup', function(evt) {
-                       // Add click handler for saving group
-                       evt.preventDefault();
-                       Permissions.changeGroup($(this));
-               });
-       };
-
-       /**
-        * initialize and return the Permissions object
-        */
-       return function() {
-               $(document).ready(function() {
-                       Permissions.initializeEvents();
-               });
-
-               TYPO3.Permissions = Permissions;
-               return Permissions;
-       }();
-});
\ No newline at end of file
diff --git a/typo3/sysext/perm/Resources/Public/Styles/styles.css b/typo3/sysext/perm/Resources/Public/Styles/styles.css
deleted file mode 100644 (file)
index 30fdce3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-.legend .pull-left {
-  margin-right: 0.5em;
-}
-a.ug_selector {
-  cursor: pointer;
-  text-decoration: underline;
-}
-a.ug_selector .not_set {
-  font-style: italic;
-}
diff --git a/typo3/sysext/perm/composer.json b/typo3/sysext/perm/composer.json
deleted file mode 100644 (file)
index 8b4c260..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-       "name": "typo3/cms-perm",
-       "type": "typo3-cms-framework",
-       "description": "TYPO3 Core",
-       "homepage": "http://typo3.org",
-       "license": ["GPL-2.0+"],
-       "version": "7.0.0",
-
-       "require": {
-               "typo3/cms-core": "*"
-       },
-       "replace": {
-               "perm": "*"
-       },
-       "extra": {
-               "typo3/cms": {
-                       "Package": {
-                               "partOfFactoryDefault": true
-                       }
-               }
-       }
-}
diff --git a/typo3/sysext/perm/ext_emconf.php b/typo3/sysext/perm/ext_emconf.php
deleted file mode 100644 (file)
index d84cecb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-$EM_CONF[$_EXTKEY] = array(
-       'title' => 'System>Access',
-       'description' => 'Page editing permissions',
-       'category' => 'module',
-       'state' => 'stable',
-       'uploadfolder' => 0,
-       'createDirs' => '',
-       'clearCacheOnLoad' => 0,
-       'author' => 'Kasper Skaarhoj',
-       'author_email' => 'kasperYYYY@typo3.com',
-       'author_company' => '',
-       'version' => '7.0.0',
-       '_md5_values_when_last_written' => '',
-       'constraints' => array(
-               'depends' => array(
-                       'typo3' => '7.0.0-7.0.99',
-               ),
-               'conflicts' => array(),
-               'suggests' => array(),
-       ),
-);
diff --git a/typo3/sysext/perm/ext_icon.gif b/typo3/sysext/perm/ext_icon.gif
deleted file mode 100644 (file)
index 5c80f38..0000000
Binary files a/typo3/sysext/perm/ext_icon.gif and /dev/null differ
diff --git a/typo3/sysext/perm/ext_tables.php b/typo3/sysext/perm/ext_tables.php
deleted file mode 100644 (file)
index 338035d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-defined('TYPO3_MODE') or die();
-
-if (TYPO3_MODE === 'BE') {
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
-               'system',
-               'perm',
-               'after:BeuserTxBeuser',
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/',
-               array(
-                       'navigationComponentId' => 'typo3-pagetree'
-               )
-       );
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('PermissionAjaxController::dispatch', 'TYPO3\\CMS\\Perm\\Controller\\PermissionAjaxController->dispatch');
-}
diff --git a/typo3/sysext/perm/mod1/clear.gif b/typo3/sysext/perm/mod1/clear.gif
deleted file mode 100644 (file)
index e1d2d83..0000000
Binary files a/typo3/sysext/perm/mod1/clear.gif and /dev/null differ
diff --git a/typo3/sysext/perm/mod1/conf.php b/typo3/sysext/perm/mod1/conf.php
deleted file mode 100644 (file)
index 71fd8fd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-$MCONF['script'] = '_DISPATCH';
-$MLANG['default']['tabs_images']['tab'] = '../Resources/Public/Icons/module-perm.png';
-$MLANG['default']['ll_ref'] = 'LLL:EXT:lang/locallang_mod_web_perm.xlf';
-$MCONF['access'] = 'admin';
-$MCONF['name'] = 'system_perm';
diff --git a/typo3/sysext/perm/mod1/index.php b/typo3/sysext/perm/mod1/index.php
deleted file mode 100644 (file)
index 1914e6b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Module: Permission setting
- */
-
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Perm\Controller\PermissionModuleController::class);
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
diff --git a/typo3/sysext/perm/mod1/perm.gif b/typo3/sysext/perm/mod1/perm.gif
deleted file mode 100644 (file)
index 34b3865..0000000
Binary files a/typo3/sysext/perm/mod1/perm.gif and /dev/null differ
index 4de017b..aebe437 100644 (file)
@@ -1225,8 +1225,8 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                        }
                                }
                                // "Edit Perms" link:
-                               if ($table === 'pages' && $GLOBALS['BE_USER']->check('modules', 'web_perm') && ExtensionManagementUtility::isLoaded('perm')) {
-                                       $href = htmlspecialchars((BackendUtility::getModuleUrl('web_perm') . '&id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1'));
+                               if ($table === 'pages' && $GLOBALS['BE_USER']->check('modules', 'system_BeuserTxPermission') && ExtensionManagementUtility::isLoaded('beuser')) {
+                                       $href = htmlspecialchars((BackendUtility::getModuleUrl('system_BeuserTxPermission') . '&id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1'));
                                        $cells['perms'] = '<a class="btn" href="' . $href . '" title="'
                                                . $GLOBALS['LANG']->getLL('permissions', TRUE) . '">'
                                                . IconUtility::getSpriteIcon('status-status-locked') . '</a>';