Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions Classes/Controller/GroupAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,35 @@ public function getGroupEdit()

$content = '';

// the default field to show
$showColumn = 'hidden,title,db_mountpoints,file_mountpoints,subgroup,members,description,TSconfig';
$defaultShowColumnArray = [
'hidden',
'title',
'db_mountpoints',
'file_mountpoints',
'subgroup',
'members',
'description',
'TSconfig',
];
$showColumnArray = [];

if (!empty($this->getBackendUser()->groupData['non_exclude_fields'])) {
$nonExcludeFields = GeneralUtility::trimExplode(',', $this->getBackendUser()->groupData['non_exclude_fields'], true);
foreach ($nonExcludeFields as $field) {
if (strpos($field, 'be_groups:') === 0) {
list($_, $field) = explode(':', $field, 2);
$showColumnArray[] = $field;
}
}
}
if (!empty($showColumnArray)) {
$showColumn = implode(',', array_merge(
array_intersect($defaultShowColumnArray, $showColumnArray),
array_diff($showColumnArray, $defaultShowColumnArray)
));
} else {
$showColumn = implode(',', $defaultShowColumnArray);
}

// get hideColumnGroup from TS and remove it from the showColumn
if ($this->getBackendUser()->userTS['tc_beuser.']['hideColumnGroup']) {
Expand Down
32 changes: 31 additions & 1 deletion Classes/Controller/UserAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,37 @@ public function getUserEdit()
$content = '';

// the default field to show
$showColumn = 'disable,username,password,usergroup,realName,email,lang,name,first_name,last_name';
$defaultShowColumnArray = [
'disable',
'username',
'password',
'usergroup',
'realName',
'email',
'lang',
'name',
'first_name',
'last_name',
];
$showColumnArray = [];

if (!empty($this->getBackendUser()->groupData['non_exclude_fields'])) {
$nonExcludeFields = GeneralUtility::trimExplode(',', $this->getBackendUser()->groupData['non_exclude_fields'], true);
foreach ($nonExcludeFields as $field) {
if (strpos($field, 'be_users:') === 0) {
list($_, $field) = explode(':', $field, 2);
$showColumnArray[] = $field;
}
}
}
if (!empty($showColumnArray)) {
$showColumn = implode(',', array_merge(
array_intersect($defaultShowColumnArray, $showColumnArray),
array_diff($showColumnArray, $defaultShowColumnArray)
));
} else {
$showColumn = implode(',', $defaultShowColumnArray);
}

// get hideColumnGroup from TS and remove it from the showColumn
if ($this->getBackendUser()->userTS['tc_beuser.']['hideColumnGroup']) {
Expand Down
30 changes: 30 additions & 0 deletions Classes/Form/FormDataProvider/BackendExcludeTableDisable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace dkd\TcBeuser\Form\FormDataProvider;

use TYPO3\CMS\Backend\Form\FormDataProviderInterface;

class BackendExcludeTableDisable extends BackendExcludeTableEnable implements FormDataProviderInterface
{
/**
* Add form data to result array
*
* @param array $result Initialized result array
* @return array Result filled with more data
*/
public function addData(array $result)
{
if ($result['tableName'] !== 'be_groups') {
return $result;
}

if (static::$tcaBackup !== null) {
foreach (static::$tcaBackup as $table => $configuration) {
$GLOBALS['TCA'][$table] = $configuration;
}
static::$tcaBackup = null;
}

return $result;
}

}
42 changes: 42 additions & 0 deletions Classes/Form/FormDataProvider/BackendExcludeTableEnable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
namespace dkd\TcBeuser\Form\FormDataProvider;

use TYPO3\CMS\Backend\Form\FormDataProviderInterface;

class BackendExcludeTableEnable implements FormDataProviderInterface
{
/**
* @var array
*/
protected static $tcaBackup;

/**
* Add form data to result array
*
* @param array $result Initialized result array
* @return array Result filled with more data
*/
public function addData(array $result)
{
if ($result['tableName'] !== 'be_groups') {
return $result;
}

if (static::$tcaBackup === null) {
static::$tcaBackup = [
'be_groups' => $GLOBALS['TCA']['be_groups'],
'be_users' => $GLOBALS['TCA']['be_users'],
];
}

foreach (static::$tcaBackup as $table => $_) {
$GLOBALS['TCA'][$table]['ctrl']['rootLevel'] = 0;
foreach ($GLOBALS['TCA'][$table]['columns'] as &$fieldConfig) {
$fieldConfig['exclude'] = 1;
}
}

return $result;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. |img-2| image:: ../../Images/manual_html_m121583cf.png
:height: 455
:width: 652
.. |img-3| image:: ../../Images/manual_html_105994d.png
:height: 360
:width: 170
.. :align: left
.. :border: 0
.. :name: Grafik2

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. include:: Images.txt

.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.

.. ==================================================
.. DEFINE SOME TEXTROLES
.. --------------------------------------------------
.. role:: underline
.. role:: typoscript(code)
.. role:: ts(typoscript)
:class: typoscript
.. role:: php(code)


Flexible Benutzer- und Gruppenfelder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Über die Gruppeneinstellungen des aktuellen Users lassen sich die
Felder bestimmen, welche über die Module „Benutzer-Admin“ und
„Gruppen-Admin“ editiert werden können.

Die Extension stellt beim Bearbeiten einer Backend-Benutzergruppe unter
dem Feld "Erlaubte Ausschlussfelder" Einstellungsmöglichkeiten für
"Backend-Benutzer" und "Backend-Benutzergruppe" zur Verfügung. Die hier
ausgewählten Felder stehen den Benutzern der Gruppe als Felder in den
"TC Tools"-Modulen zur Verfügung.

Um z.B. die Standardfelder (Inaktiv, Benutzername, Passwort, Gruppe,
Name, E-Mail, Standardsprache) beim „Benutzer-Admin“ um
Datenbankfreigaben (db_mountpoints) und Dateifreigaben (file_mountpoints)
zu erweitern, müssen die Standardfelder, sowie die Felder
Datenbankfreigaben und Dateifreigaben unter dem Punkt
"Erlaubte Ausschlussfelder" für Backend-Benutzer ausgewählt werden.

|img-3|

1 change: 1 addition & 0 deletions Documentation/Benutzerhandbuch/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Benutzerhandbuch
AlphabetischeAuflistungDerBackend-user/Index
SortierungNachKriterien/Index
FilterungDeaktivierterBackend-user/Index
FlexibleBenutzerUndGruppenFelder/Index
SucheNachBackend-user/Index
NeuenBenutzerAnlegen/Index
FrontendBenutzerImportieren/Index
Expand Down
Binary file added Documentation/Images/manual_html_105994d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,22 @@
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Backend\\Controller\\ContentElement\\ElementInformationController'] = array(
'className' => 'dkd\\TcBeuser\\Xclass\\RecordInfoController'
);

//add formdataprovider to enable exclude of be_users fields
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\dkd\TcBeuser\Form\FormDataProvider\BackendExcludeTableEnable::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems::class,
],
'before' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class,
]
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\dkd\TcBeuser\Form\FormDataProvider\BackendExcludeTableDisable::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class,
],
'before' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems::class,
]
];
}