...
 
Commits (123)
#ddev-generated: Automatically generated ddev .gitignore.
# You can remove the above line if you want to edit and maintain this file yourself.
/commands/*/*.example
/commands/*/README.txt
/commands/host/launch
/commands/db/mysql
/homeadditions/*.example
/homeadditions/README.txt
/.gitignore
/import.yaml
/docker-compose.yaml
/db_snapshots
/sequelpro.spf
/import-db
/.bgsync*
/config.*.y*ml
/.webimageBuild
/.dbimageBuild
/.bgsyncimageBuild
/.sshimageBuild
/.webimageExtra
/.dbimageExtra
/*-build/Dockerfile.example
#!/bin/bash
## #ddev-generated
## Description: run mysql client in db container
## Usage: mysql [flags] [args]
## Example: "ddev mysql" or "ddev mysql -uroot -proot" or "echo 'SHOW TABLES;' | ddev mysql"
## `ddev mysql --database=mysql -uroot -proot` gets you to the 'mysql' database with root privileges
mysql -udb -pdb $@
APIVersion: v1.5.2
APIVersion: v1.12.1
name: my.typo3.org
type: typo3
docroot: public
......@@ -9,27 +9,27 @@ router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.1"
webcache_enabled: false
mariadb_version: "10.2"
nfs_mount_enabled: false
provider: default
hooks:
post-start:
- exec: bash -c "sudo -E apt-get update"
- exec: bash -c "sudo -E apt-get install --yes --no-install-recommends apt-utils"
- exec: bash -c "sudo -E apt-get install --yes php7.2-ldap -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" && killall -HUP php-fpm"
- exec: cp private/typo3conf/AdditionalConfiguration.ddev.php private/typo3conf/AdditionalConfiguration.php
- exec: composer install
- exec: npm --prefix private/typo3conf/ext/t3olayout/Build install
- exec: npm --prefix private/typo3conf/ext/t3olayout/Build run-script build
- exec: vendor/bin/typo3cms install:generatepackagestates
- exec: vendor/bin/typo3cms install:extensionsetupifpossible
webimage_extra_packages: [php7.2-ldap, build-essential]
use_dns_when_possible: true
timezone: Europe/Berlin
# This config.yaml was created with ddev version v1.5.2
# webimage: drud/ddev-webserver:v1.5.2
# dbimage: drud/ddev-dbserver:v1.5.2-10.2
# dbaimage: drud/phpmyadmin:v1.5.2
# bgsyncimage: drud/ddev-bgsync:v1.5.2
# This config.yaml was created with ddev version v1.12.1
# webimage: drud/ddev-webserver:v1.12.1
# dbimage: drud/ddev-dbserver-mariadb-10.2:v1.12.0
# dbaimage: drud/phpmyadmin:v1.12.0
# bgsyncimage: drud/ddev-bgsync:v1.12.0
# However we do not recommend explicitly wiring these images into the
# config.yaml as they may break future versions of ddev.
# You can update this config.yaml using 'ddev config'.
......@@ -37,13 +37,13 @@ hooks:
# Key features of ddev's config.yaml:
# name: <projectname> # Name of the project, automatically provides
# http://projectname.ddev.local and https://projectname.ddev.local
# http://projectname.ddev.site and https://projectname.ddev.site
# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
# docroot: <relative_path> # Relative path to the directory containing index.php.
# php_version: "7.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3"
# php_version: "7.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4"
# You can explicitly specify the webimage, dbimage, dbaimage lines but this
# is not recommended, as the images are often closely tied to ddev's' behavior,
......@@ -54,18 +54,33 @@ hooks:
# dbaimage: <docker_image>
# bgsyncimage: <docker_image>
# mariadb_version and mysql_version
# ddev can use many versions of mariadb and mysql
# However these directives are mutually exclusive
# mariadb_version: 10.2
# mysql_version: 8.0
# router_http_port: <port> # Port to be used for http (defaults to port 80)
# router_https_port: <port> # Port for https (defaults to 443)
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev exec enable_xdebug" and "ddev exec disable_xdebug" work better,
# as leaving xdebug enabled all the time is a big performance hit.
# webserver_type: nginx-fpm # Can be set to apache-fpm or apache-cgi as well
# timezone: Europe/Berlin
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# additional_hostnames:
# - somename
# - someothername
# would provide http and https URLs for "somename.ddev.local"
# and "someothername.ddev.local".
# would provide http and https URLs for "somename.ddev.site"
# and "someothername.ddev.site".
# additional_fqdns:
# - example.com
......@@ -79,24 +94,76 @@ hooks:
# working_dir:
# web: /var/www/html
# db: /home
# would set the default working directory for the web and db services.
# These values specify the destination directory for ddev ssh and the
# directory in which commands passed into ddev exec are run.
# would set the default working directory for the web and db services.
# These values specify the destination directory for ddev ssh and the
# directory in which commands passed into ddev exec are run.
# omit_containers: ["dba", "ddev-ssh-agent"]
# would omit the dba (phpMyAdmin) and ddev-ssh-agent containers. Currently
# only those two containers can be omitted here.
# Note that these containers can also be omitted globally in the
# Note that these containers can also be omitted globally in the
# ~/.ddev/global_config.yaml or with the "ddev config global" command.
# nfs_mount_enabled: false
# Great performance improvement but requires host configuration first.
# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container
# webcache_enabled: false (deprecated)
# Was only for macOS, but now deprecated.
# See https://ddev.readthedocs.io/en/stable/users/performance/#webcache
# host_https_port: "59002"
# The host port binding for https can be explicitly specified. It is
# dynamic unless otherwise specified.
# This is not used by most people, most people use the *router* instead
# of the localhost port.
# host_webserver_port: "59001"
# The host port binding for the ddev-webserver can be explicitly specified. It is
# dynamic unless otherwise specified.
# This is not used by most people, most people use the *router* instead
# of the localhost port.
# host_db_port: "59002"
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
# unless explicitly specified.
# phpmyadmin_port: "1000"
# The PHPMyAdmin port can be changed from the default 8036
# mailhog_port: "1001"
# The MailHog port can be changed from the default 8025
# webimage_extra_packages: [php-yaml, php7.3-ldap]
# Extra Debian packages that are needed in the webimage can be added here
# dbimage_extra_packages: [telnet,netcat]
# Extra Debian packages that are needed in the dbimage can be added here
# use_dns_when_possible: true
# If the host has internet access and the domain configured can
# successfully be looked up, DNS will be used for hostname resolution
# instead of editing /etc/hosts
# Defaults to true
# project_tld: ddev.site
# The top-level domain used for project URLs
# The default "ddev.site" allows DNS lookup via a wildcard
# If you prefer you can change this to "ddev.local" to preserve
# pre-v1.9 behavior.
# ngrok_args: --subdomain mysite --auth username:pass
# Provide extra flags to the "ngrok http" command, see
# https://ngrok.com/docs#http or run "ngrok http -h"
# provider: default # Currently either "default" or "pantheon"
#
# Many ddev commands can be extended to run tasks after the ddev command is
# executed.
# Many ddev commands can be extended to run tasks before or after the
# ddev command is executed, for example "post-start", "post-import-db",
# "pre-composer", "post-composer"
# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more
# information on the commands that can be extended and the tasks you can define
# for them. Example:
#hooks:
# post-start:
# - exec: composer install -d /var/www/html
\ No newline at end of file
# - exec: composer install -d /var/www/html
......@@ -4,4 +4,3 @@ services:
web:
environment:
- TYPO3_CONTEXT=Development
- DEBIAN_FRONTEND=noninteractive
/vendor/
/var/
/public/
!/public/.well-known/security.txt
!/public/humans.txt
/private/
!/private/typo3conf/LocalConfiguration.php
......
......@@ -49,7 +49,6 @@ set('rsync', [
'timeout' => 300
]);
set('rsync_src', './');
set('keep_releases', 10);
inventory('./.gitlab-ci/deployer/servers.yml');
set('php', '/opt/php/php72/bin/php');
set('bin_folder', 'vendor/bin/');
......
......@@ -6,6 +6,7 @@ master:
writable_mode: chmod
forward_agent: true
deploy_path: ~/ci
keep_releases: 2
develop:
stage: stage
hostname: my-stage-v9.typo3.org
......@@ -14,3 +15,4 @@ develop:
writable_mode: chmod
forward_agent: true
deploy_path: ~/ci/
keep_releases: 2
......@@ -16,6 +16,10 @@
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/t3olayout.git"
},
{
"type": "vcs",
"url": "https://github.com/in2code-de/userprofile.git"
},
{
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/gitlab_api.git"
......@@ -26,22 +30,21 @@
"issues": "https://git-t3o.typo3.org/t3o/my/issues"
},
"require": {
"typo3/cms-redirects": "^9.5",
"helhum/typo3-console": "^5.0",
"dmitryd/typo3-realurl": "^2.1",
"t3o/t3olayout": "^3.0",
"in2code/femanager": "^4.0",
"in2code/userprofile": "^0.2",
"t3o/t3olayout": "^4.0",
"in2code/femanager": "^5.1",
"sjbr/static-info-tables": "^6.5",
"t3o/gitlab_api": "^1.0",
"gordalina/cachetool": "^3.2",
"gordalina/cachetool": "^4.0",
"t3o/t3omy": "@dev",
"t3o/t3o_slack": "@dev",
"t3o/t3o_ldap": "@dev",
"helhum/typo3-secure-web": "^0.2.8"
"in2code/userprofile": "dev-singleview"
},
"config": {
"platform": {
"php": "7.0.30"
"php": "7.2.11"
}
},
"extra": {
......
This diff is collapsed.
rootPageId: 1
base: 'https://my.typo3.org'
baseVariants:
-
base: 'https://my.typo3.org.ddev.site'
condition: 'applicationContext == "Development"'
-
base: 'https://my-stage.typo3.org'
condition: 'applicationContext == "Testing"'
-
base: 'https://my.typo3.org'
condition: 'applicationContext == "Production"'
languages:
-
title: English
enabled: true
languageId: '0'
base: /
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-US
direction: ''
flag: gb
errorHandling:
-
errorCode: '404'
errorHandler: Page
errorContentSource: 't3://page?uid=404'
routes:
-
route: robots.txt
type: staticText
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /fileadmin/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*"
......@@ -9,7 +9,7 @@
"extension"
],
"require": {
"typo3/cms-core": "^8.7"
"typo3/cms-core": "^8.7 || ^9.5"
},
"autoload": {
"psr-4": {
......
......@@ -21,7 +21,7 @@ $EM_CONF[$_EXTKEY] = [
'version' => '0.0.0',
'constraints' => [
'depends' => [
'typo3' => '8.7.0-8.99.99',
'typo3' => '8.7.0',
'php' => '7.0.0-7.99.99',
],
'conflicts' => [],
......
<?php
declare(strict_types = 1);
namespace T3o\T3oLdap\Controller;
use T3o\T3oLdap\Connectors\Ldap;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* Class GdprController
*/
class GdprController extends ActionController
{
public function initializeAction(): void
{
parent::initializeAction();
if (!$GLOBALS['BE_USER']) {
$this->addFlashMessage('no access to this function', 'Access denied', AbstractMessage::ERROR);
$this->forward('message');
}
if ($GLOBALS['BE_USER']->isAdmin() === false) {
$this->addFlashMessage(
'You need Admin rights, to use this function.',
'Access denied',
AbstractMessage::ERROR
);
$this->forward('message');
}
}
/**
*
*/
public function step1Action(): void
{
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$this->view->assignMultiple(
[
'moduleUri' => $uriBuilder->buildUriFromRoute('tce_db'),
'action' => 'step1'
]
);
}
public function step2Action(): void
{
if ($this->request->hasArgument('username')) {
$userName = $this->request->getArgument('username');
} else {
$this->addFlashMessage('No user given', 'Error', AbstractMessage::ERROR);
$this->forward('step1');
}
if ($this->checkLdapUser($userName)) {
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$ldapUser = $this->getLdapUser($userName);
$this->view->assignMultiple(
[
'moduleUri' => $uriBuilder->buildUriFromRoute('tce_db'),
'action' => 'step2',
'user' => $ldapUser
]
);
} else {
$this->addFlashMessage('No user found', 'Error', AbstractMessage::ERROR);
$this->forward('step1');
}
}
public function confirmAction(): void
{
if (!$this->request->hasArgument('user')) {
$this->addFlashMessage('No user found', 'Error', AbstractMessage::ERROR);
$this->forward('step1');
}
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$this->view->assignMultiple(
[
'moduleUri' => $uriBuilder->buildUriFromRoute('tce_db'),
'action' => 'confirm',
'user' => $this->request->getArgument('user'),
'comment' => $this->request->getArgument('comment'),
'otrs' => $this->request->getArgument('otrs'),
'gitlab' => $this->request->getArgument('gitlab')
]
);
}
public function deleteAction(): void
{
if (!$this->request->hasArgument('user')) {
$this->addFlashMessage('No user found', 'Error', AbstractMessage::ERROR);
$this->forward('step1');
}
$user = $this->request->getArgument('user');
$data['username'] = $user['uid'][0];
$data['email'] = $user['mail'][0];
$data['deleted_by'] = $GLOBALS['BE_USER']->user['username'];
$data['delete_date'] = time();
$data['otrs_ticket'] = $this->request->getArgument('otrs');
$data['gitlab_ticket'] = $this->request->getArgument('gitlab');
$data['comment'] = $this->request->getArgument('comment');
try {
$this->sendOtrsMail($data);
$this->createOtrsTicket($data);
$this->deleteLdapUser($data);
$this->deleteLocalUser($data);
$this->createOldUser($data);
$this->addFlashMessage('The user was deleted successfully', 'LDAP deletion', AbstractMessage::OK);
} catch (\Exception $e) {
$this->addFlashMessage('Deletion not successful. Error: ' . $e->getMessage(), 'LDAP deletion', AbstractMessage::ERROR);
}
$this->forward('step1');
}
/**
* @param string $userName
* @return bool
* @throws \Exception
*/
protected function checkLdapUser(string $userName): bool
{
/** @var Ldap $ldap */
try {
$ldap = new Ldap();
} catch (\Exception $e) {
throw $e;
}
return $ldap->userExists($userName);
}
/**
* @param string $userName
* @return array
* @throws \Exception
*/
protected function getLdapUser(string $userName): array
{
/** @var Ldap $ldap */
try {
$ldap = new Ldap();
} catch (\Exception $e) {
throw $e;
}
return $ldap->getUser($userName);
}
protected function createOldUser(array $data): void
{
$dbConnection = GeneralUtility::makeInstance(ConnectionPool::class);
$dbConnection->getConnectionForTable('old_users')->insert('old_users', $data);
}
protected function sendOtrsMail(array $data): void
{
$message = 'Dear data privacy officer,
we like to inform you, that this
LDAP User: ' . $data['username'] . '
was deleted.
The Server Team is informed, and will remove all further account data (wiki, forge, talk, ...).
OTRS Link of initial Ticket from data privacy officer: ' . $data['otrs_ticket'] . '
Gitlab Link of typo3.org website team: ' . $data['gitlab_ticket'] . '
further comment:' . $data['comment'] . '
LDAP User deletion was performed by: ' . $GLOBALS['BE_USER']->name . '
Your TYPO3 website administration team';
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setSubject('[Ticket#' . $data['otrs'] . '] User deletion notification : ' . $data['username']);
$mail->setFrom(['confirm-t3o-account@typo3.org' => 'typo3.org administration']);
$mail->setTo(['otrs@typo3.org', 'otrs@typo3.org' => 'TYPO3 OTRS Notification Master']);
$mail->setBody($message);
$mail->send();
}
protected function createOtrsTicket(array $data): void
{
$message = 'Dear Server Team,
please delete all accounts from this LDAP User:
Username: ' . $data['username'] . '
Mail: ' . $data['email'] . '
OTRS Link of initial Ticket from data privacy officer: ' . $data['otrs_ticket'] . '
Gitlab Link of typo3.org website team: ' . $data['gitlab_ticket'] . '
further comment: ' . $data['comment'] . '
LDAP User deletion was performed by: ' . $GLOBALS['BE_USER']->name . '
Your TYPO3 website administration team';
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setSubject('User delection process: ' . $data['username']);
$mail->setFrom(['confirm-t3o-account@typo3.org' => 'typo3.org administration']);
$mail->setTo(['admin@typo3.org', 'admin@typo3.org' => 'TYPO3 Serverteam']);
$mail->setBody($message);
$mail->send();
}
protected function deleteLdapUser(array $data): bool
{
// delete my.typo3.org user
/** @var Ldap $ldap */
try {
$ldap = new Ldap();
} catch (\Exception $e) {
throw $e;
}
return $ldap->deleteUser($data['userName']);
}
protected function deleteLocalUser(array $data): void
{
$dbConnection = GeneralUtility::makeInstance(ConnectionPool::class);
$dbConnection->getConnectionForTable('fe_users')->delete(
'fe_users',
['username' => $data['username']]
);
}
}
......@@ -42,7 +42,11 @@ class DataHandlerHook
*/
public function processDatamap_afterAllOperations(\TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler)
{
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3o_ldap']);
if (version_compare(TYPO3_version, '9.0', '<')) {
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3o_ldap'] ?? '') ?? [];
} else {
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['t3o_ldap'] ?? [];
}
$enableLdapPasswordUpdates = (int)$extensionConfiguration['enableLdapPasswordUpdates'];
if ($enableLdapPasswordUpdates === 1) {
......
......@@ -25,24 +25,27 @@ class PasswordHashing
*
* @param string $clearText Cleartext representation of the password
* @param string $algorithm The hashing mechanism
* @param string $salt Optional salt
* @param int $rounds The number of rounds for Crypt Salt
* @return bool|string False on failure or the hashed password as string
*/
public function getPasswordHash($clearText, $algorithm = 'crypt', $salt = 'xy')
public function getPasswordHash($clearText, $algorithm = 'crypt_sha512', $rounds = 5000)
{
$ret = false;
if (trim($clearText) !== '') {
switch ($algorithm) {
case 'sha1':
$passwordHash = sha1($clearText, true);
$ret = '{SHA}' . base64_encode($passwordHash);
break;
case 'md5':
$passwordHash = md5($clearText, true);
$ret = '{MD5}' . base64_encode($passwordHash);
break;
case 'crypt':
$passwordHash = crypt($clearText, $salt);
case 'crypt_sha512':
$characters = array_merge(
range('0', '9'),
range('a', 'z'),
range('A', 'Z'),
['.', '/']
);
$salt = '';
$length = count($characters) - 1;
for ($i = 0; $i < 16; $i++) {
$salt .= $characters[rand(0, $length)];
}
$passwordHash = crypt($clearText, '$6$rounds=' . (int)$rounds . '$' . $salt . '$');
$ret = '{CRYPT}' . $passwordHash;
// no break
default:
......
......@@ -12,39 +12,55 @@ namespace T3o\T3oLdap\Utility;
* LICENSE.txt file that was distributed with this source code.
*/
use T3o\T3oLdap\Connectors\Ldap;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Password updating facility.
*/
class PasswordUpdate
class PasswordUpdate implements \Psr\Log\LoggerAwareInterface
{
const PASSWORD_METHODS = ['md5', 'sha1', 'crypt'];
use \Psr\Log\LoggerAwareTrait;
const PASSWORD_METHODS = ['crypt_sha512'];
/**
* Update a password in various places (LDAP, TYPO3)
*
* @param string $username The username to update the password for
* @param string $clearTextPassword Cleartext password to hash and update
* @return bool
*/
public function updatePassword(string $username, string $clearTextPassword)
public function updatePassword(string $username, string $clearTextPassword): bool
{
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3o_ldap']);
$ret = false;
if (version_compare(TYPO3_version, '9.0', '<')) {
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3o_ldap'] ?? '') ?? [];
} else {
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['t3o_ldap'] ?? [];
}
// Check if LDAP updates are enabled in extension configuration
if ((int)$extensionConfiguration['enableLdapPasswordUpdates'] === 1) {
/** @var \T3o\T3oLdap\Connectors\Ldap $ldap */
$ldap = GeneralUtility::makeInstance(\T3o\T3oLdap\Connectors\Ldap::class);
if ($ldap->setLdapPasswords($username, $this->getHashedPasswords($clearTextPassword))) {
GeneralUtility::sysLog(
'Password successfully updated (Mechanisms: ' . strtoupper(implode(', ', self::PASSWORD_METHODS)) . ')',
't3o_ldap',
GeneralUtility::SYSLOG_SEVERITY_INFO
);
/** @var Ldap $ldap */
$ldap = GeneralUtility::makeInstance(Ldap::class);
$passwordUpdateResult = $ldap->setLdapPasswords($username, $this->getHashedPasswords($clearTextPassword));
$this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
if ($passwordUpdateResult === true) {
$this->logger->info('Password successfully updated (Mechanisms: ' . strtoupper(implode(', ', self::PASSWORD_METHODS)) . ')');
$ret = true;
} else {
$this->logger->info('Password has not been updated (Mechanisms: ' . strtoupper(implode(', ', self::PASSWORD_METHODS)) . ')');
}
}
return $ret;
}
/**
* @param string $clearTextPassword
* @return array
*/
public function getHashedPasswords(string $clearTextPassword): array
{
$passwords = [];
......
......@@ -13,6 +13,7 @@ namespace T3o\T3oLdap\Utility;
* LICENSE.txt file that was distributed with this source code.
*/
use T3o\T3oLdap\Connectors\Ldap;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -38,9 +39,9 @@ class UserCreateUpdateDelete
{
$ret = false;
/** @var \T3o\T3oLdap\Connectors\Ldap $ldap */
/** @var Ldap $ldap */
try {
$ldap = new \T3o\T3oLdap\Connectors\Ldap();
$ldap = new Ldap();
} catch (\Exception $e) {
throw $e;
}
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-04-13T15:49:07Z" product-name="femanager">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>GDPR Process</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>GDPR Module initiates a user deletion process</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>GDPR</source>
</trans-unit>
</body>
</file>
</xliff>
<f:be.container
pageTitle="femanager">
<div class="module">
<div class="module-docheader">
<div class="typo3-docheader-functions">
<div class="module-docheader-bar module-docheader-bar-navigation">
<div class="module-docheader-bar-column-left">
</div>
<div class="module-docheader-bar-column-right">
<f:be.pagePath />
</div>
</div>
</div>
<div class="module-docheader-bar module-docheader-bar-buttons">
<div class="module-docheader-bar-column-left">
&nbsp;
</div>
<div class="module-docheader-bar-column-right">
<f:be.buttons.shortcut />
</div>
</div>
</div>
<div class="module-body femanager-backend">
<f:flashMessages as="flashMessages">
<div class="alert alert-warning">
<f:for each="{flashMessages}" as="flashMessage">
<div class="message-body">{flashMessage.message}</div>
</f:for>
</div>
</f:flashMessages>
<f:render section="main" />
</div>
</div>
</f:be.container>
<f:flashMessages as="flashMessages">
<div class="femanager_status">
<div class="femanager_flashmessages">
<f:for each="{flashMessages}" as="flashMessage">
<div class="typo3-message message-{flashMessage.severity}">
<div class="message-body">{flashMessage.message}</div>
</div>
</f:for>
</div>
</div>
</f:flashMessages>
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Backend"/>
<f:section name="main">
<f:render partial="Misc/FlashMessages" arguments="{_all}"/>
<h1>TYPO3 GDRP Process</h1>
<f:be.infobox title="Step 3" state="2">
<p><strong>This user will get deleted:</strong></p>
<ul>
<li>dn: {user.dn}</li>
<li>mail: {user.mail.0}</li>
<li>name: {user.displayname.0}</li>
</ul>
<p><strong>Further informations:</strong></p>
<ul>
<li>OTRS Ticket: {otrs}</li>
<li>Gitlab Ticket: <a href="https://gitlab.typo3.org/t3o-security/my.typo3.org/issues/{gitlab}">{gitlab}</a></li>
<li>Comment: {comment}</li>
</ul>
<p><strong>These actions will performed:</strong></p>
<ul>
<li>The user will get delted in LDAP</li>
<li>The user will get delted in my.typo3.org (local storage)</li>
<li>A mail about the deletion will be send the OTRS System, to inform our data privacy officer</li>
<li>A mail about the deletion will be send out the Server Team (admin@typo3.org), with the deletion request.</li>
<li>The information about the deletion will be logged in the "old user" tabel, with the comment, otrs ticket link, gitlab ticket and ID of the Backend User, who deleted the LDAP user</li>
</ul>
<f:form action="delete" arguments="{_all}">
<f:link.action class="btn btn-default" action="step2" arguments="{_all}">Back</f:link.action>
<f:form.submit class="btn btn-danger" title="confirm deletion" value="delete now">delete now</f:form.submit>
</f:form>
</f:be.infobox>
</div>
</f:section>
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Backend"/>
<f:section name="main">
<h1>TYPO3 GDRP Process</h1>
<f:render partial="Misc/FlashMessages" arguments="{_all}"/>
</f:section>
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Backend"/>
<f:section name="main">
<f:render partial="Misc/FlashMessages" arguments="{_all}"/>
<h1>TYPO3 GDRP Process</h1>
<div class="bg-info" style="padding: 20px;">This is a step by step assistant to delete a user from
LDAP and this local installation. Further task that will be performed:
<ul>
<li>create a task via mail for the server team</li>
<li>inform the privacy officer about the deletion</li>
<li>move the user name to the old user table to prevent a future usage of this username</li>
<li>documentate this deletion in the log</li>
</ul>
</div>
<f:be.infobox title="Step 1" state="-1">
<f:form action="step2">
<label for="username">Please provide the username, that should be deleted:</label>
<f:form.textfield name="username" id="username"></f:form.textfield>
</br>
<f:form.submit class="btn btn-default" title="Continue to step 2" value="Continue">Continue</f:form.submit>
</f:form>
</f:be.infobox>
</f:section>
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Backend"/>
<f:section name="main">
<f:render partial="Misc/FlashMessages" arguments="{_all}"/>
<h1>TYPO3 GDRP Process</h1>
<f:be.infobox title="Step 2" state="1">
<p><strong>Please review the userdata carefully:</strong></p>
<ul>
<li>dn: {user.dn}</li>
<li>mail: {user.mail.0}</li>
<li>name: {user.displayname.0}</li>
</ul>
<f:form action="confirm" arguments="{_all}">
<div class="row">
<div class="form-group col-md-12">
<label for="gitlab">Gitlab issue:</label>
<div class="formengine-field-item t3js-formengine-field-item">
<f:form.textfield name="gitlab"></f:form.textfield> (Please enter the plain ticket number after #)
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<label for="otrs">OTRS Ticket data privacy officer:</label>
<div class="formengine-field-item t3js-formengine-field-item">
<f:form.textfield name="otrs"></f:form.textfield> (Please enter the plain ticket number after #)
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<label for="comment">Comment:</label>
<div class="formengine-field-item t3js-formengine-field-item">
<f:form.textarea cols="100" rows="8" name="comment"></f:form.textarea>
</div>
</div>
</div>
<f:link.action class="btn btn-default" action="step1">Abort</f:link.action>
<f:form.submit class="btn btn-warning" title="Continue to step 3" value="confirm deletion">Confirm</f:form.submit>
</f:form>
</f:be.infobox>
</div>
</f:section>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g>
<rect x="4.373" y="2.758" width="503.755" height="505.546" style="fill:rgb(255,246,0);"/>
<path id="ARC_40_" d="M339.952,195.992C337.616,195.992 335.312,194.976 333.728,193.032C314.952,169.848 286.608,156.552 255.976,156.552L255.96,156.552C225.344,156.552 197.032,169.848 178.28,193.024C175.496,196.464 170.456,196.984 167.032,194.208C163.592,191.424 163.064,186.384 165.848,182.96C187.656,156.016 220.504,140.56 255.968,140.552L255.992,140.552C291.48,140.552 324.352,156.008 346.176,182.952C348.96,186.392 348.424,191.432 345,194.208C343.504,195.408 341.72,195.992 339.952,195.992Z" style="fill-rule:nonzero;"/>
<path id="ARC_41_" d="M256.024,371.432C220.536,371.432 187.672,355.976 165.84,329.032C163.056,325.592 163.584,320.552 167.016,317.776C170.44,315 175.488,315.536 178.264,318.952C197.048,342.136 225.384,355.432 256.016,355.432L256.04,355.432C286.648,355.424 314.96,342.136 333.72,318.96C336.496,315.528 341.544,314.992 344.968,317.776C348.408,320.56 348.936,325.6 346.152,329.024C324.344,355.968 291.496,371.424 256.04,371.432L256.024,371.432Z" style="fill-rule:nonzero;"/>
<path d="M256,455.992C245.016,455.992 233.96,455.08 223.136,453.272C219.28,452.632 216.448,449.296 216.448,445.384L216.448,415.16C200.56,411.208 185.448,404.952 171.432,396.512L150.056,417.888C147.304,420.648 142.936,421.024 139.744,418.736C121.752,405.888 106.112,390.232 93.256,372.24C90.984,369.064 91.344,364.704 94.112,361.936L115.488,340.56C107.04,326.536 100.784,311.416 96.84,295.544L66.608,295.544C62.696,295.544 59.36,292.712 58.72,288.856C55.088,267.048 55.088,244.928 58.72,223.12C59.36,219.264 62.704,216.432 66.608,216.432L96.84,216.432C100.776,200.568 107.04,185.448 115.488,171.408L94.112,150.04C91.344,147.272 90.984,142.912 93.256,139.736C106.104,121.744 121.752,106.096 139.744,93.24C142.936,90.96 147.296,91.328 150.056,94.088L171.432,115.464C185.448,107.024 200.568,100.76 216.448,96.816L216.448,66.6C216.448,62.688 219.28,59.352 223.136,58.712C244.792,55.112 267.216,55.112 288.872,58.712C292.728,59.352 295.56,62.688 295.56,66.6L295.56,96.832C311.448,100.776 326.56,107.032 340.576,115.472L361.952,94.096C364.72,91.328 369.08,90.968 372.256,93.248C390.256,106.096 405.896,121.744 418.752,139.744C421.024,142.92 420.664,147.28 417.904,150.048L396.528,171.424C404.968,185.44 411.232,200.56 415.176,216.44L445.4,216.44C449.312,216.44 452.648,219.272 453.288,223.128C456.92,244.944 456.92,267.048 453.288,288.864C452.648,292.72 449.312,295.552 445.4,295.552L415.168,295.552C411.224,311.44 404.968,326.552 396.528,340.568L417.904,361.944C420.672,364.712 421.032,369.072 418.752,372.248C405.904,390.248 390.256,405.888 372.256,418.744C369.08,421.008 364.72,420.648 361.952,417.896L340.576,396.52C326.56,404.96 311.44,411.224 295.56,415.168L295.56,445.392C295.56,449.304 292.728,452.64 288.872,453.28C278.04,455.08 266.976,455.992 256,455.992ZM232.448,438.48C248.056,440.496 263.952,440.496 279.56,438.48L279.56,408.8C279.56,405.056 282.144,401.824 285.792,400.992L288.904,400.288C305.192,396.576 320.632,390.176 334.784,381.28L337.496,379.576C340.656,377.608 344.768,378.056 347.4,380.704L368.384,401.688C380.888,392.048 392.056,380.872 401.696,368.376L380.712,347.392C378.072,344.76 377.608,340.64 379.584,337.488L381.28,334.784C390.184,320.616 396.584,305.184 400.304,288.88L401,285.784C401.832,282.136 405.064,279.552 408.808,279.552L438.488,279.552C440.512,263.896 440.512,248.096 438.488,232.44L408.808,232.44C405.064,232.44 401.832,229.856 401,226.208L400.296,223.096C396.584,206.808 390.184,191.368 381.288,177.216L379.584,174.504C377.608,171.344 378.072,167.232 380.712,164.6L401.696,143.616C392.056,131.112 380.88,119.944 368.384,110.304L347.4,131.288C344.768,133.936 340.648,134.384 337.496,132.416L334.792,130.72C320.624,121.816 305.192,115.416 288.888,111.696L285.792,111C282.144,110.168 279.56,106.936 279.56,103.192L279.56,73.512C263.952,71.496 248.056,71.496 232.448,73.512L232.448,103.192C232.448,106.936 229.856,110.168 226.208,111L223.096,111.704C206.816,115.416 191.376,121.816 177.224,130.712L174.52,132.408C171.36,134.408 167.24,133.928 164.608,131.288L143.616,110.304C131.112,119.944 119.944,131.12 110.304,143.616L131.288,164.6C133.928,167.24 134.392,171.352 132.408,174.512L130.712,177.216C121.808,191.384 115.408,206.824 111.704,223.104L110.992,226.224C110.16,229.864 106.92,232.44 103.192,232.44L73.512,232.44C71.488,248.096 71.488,263.896 73.512,279.552L103.192,279.552C106.92,279.552 110.16,282.128 110.992,285.768L111.696,288.88C115.408,305.168 121.8,320.616 130.704,334.776L132.4,337.48C134.392,340.648 133.92,344.752 131.28,347.392L110.296,368.376C119.936,380.88 131.104,392.048 143.608,401.688L164.6,380.704C167.24,378.056 171.352,377.592 174.512,379.584L177.208,381.28C191.368,390.176 206.808,396.576 223.104,400.296L226.2,400.992C229.848,401.824 232.44,405.056 232.44,408.8L232.44,438.48L232.448,438.48Z" style="fill-rule:nonzero;"/>
<path d="M233.6,275.992L233.6,235.992L213.6,235.992L213.6,275.992L233.6,275.992ZM197.6,291.992L197.6,219.992L233.6,219.992C242.4,219.992 249.6,227.192 249.6,235.992L249.6,275.992C249.6,284.792 242.4,291.992 233.6,291.992L197.6,291.992Z" style="fill-rule:nonzero;"/>
<path d="M342.96,283.992C342.96,288.392 339.36,291.992 334.96,291.992L334.24,291.992C329.84,291.592 326.56,287.672 326.96,283.272L326.96,227.992C326.96,223.592 330.56,219.992 334.96,219.992L362.96,219.992C371.76,219.992 378.96,227.192 378.96,235.992L378.96,247.992C378.96,254.472 375.04,260.392 368.96,262.792L380.4,279.432C382.888,283.112 381.92,288.072 378.32,290.632C374.64,293.112 369.68,292.144 367.2,288.552L350.32,263.992L342.96,263.992L342.96,283.992ZM362.96,235.992L342.96,235.992L342.96,247.992L362.96,247.992L362.96,235.992Z" style="fill-rule:nonzero;"/>
<path d="M280.24,283.992C280.24,288.392 276.72,291.992 272.24,291.992L271.52,291.992C267.112,291.592 263.84,287.672 264.24,283.272L264.24,227.992C264.24,223.592 267.84,219.992 272.24,219.992L300.24,219.992C309.04,219.992 316.24,227.192 316.24,235.992L316.24,247.992C316.24,256.792 309.04,263.992 300.24,263.992L280.24,263.992L280.24,283.992ZM280.24,235.992L280.24,247.992L300.24,247.992L300.24,235.992L280.24,235.992Z" style="fill-rule:nonzero;"/>
<path d="M146.24,275.992L166.24,275.992L166.24,263.992L158.24,263.992L158.24,247.992L174.24,247.992C178.64,247.992 182.24,251.592 182.24,255.992L182.24,283.992C182.24,288.392 178.64,291.992 174.24,291.992L138.24,291.992C133.84,291.992 130.24,288.392 130.24,283.992L130.24,227.992C130.24,223.592 133.76,219.992 138.24,219.992L174.24,219.992C178.64,219.992 182.24,223.592 182.24,227.992C182.24,232.392 178.64,235.992 174.24,235.992L146.24,235.992L146.24,275.992Z" style="fill-rule:nonzero;"/>
</g>
</svg>
......@@ -35,7 +35,7 @@ $EM_CONF[$_EXTKEY] = [
'constraints' => [
'depends' => [
'php' => '7.0.0-0.0.0',
'typo3' => '8.7.0-8.9.99',
'typo3' => '8.7.0',
'femanager' => '4.1.0-0.0.0'
],
'conflicts' => [
......
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
call_user_func(function () {
/**
* Include Backend Module
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'T3o.T3oLdap',
'system',
'm1',
'top',
[
'Gdpr' => 'step1, step2, confirm, delete, message'
],
[
'access' => 'admin',
'icon' => 'EXT:t3o_ldap/Resources/Public/Icons/gdpr-icon.svg',
'labels' => 'LLL:EXT:t3o_ldap/Resources/Private/Language/locallang_mod.xlf',
]
);
});
......@@ -33,8 +33,10 @@ use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class SlackImportCommandController extends CommandController
class SlackImportCommandController extends CommandController implements \Psr\Log\LoggerAwareInterface
{
use \Psr\Log\LoggerAwareTrait;
/**
* @var \T3o\T3oSlack\Domain\Repository\SlackUserRepository
* @inject
......@@ -113,10 +115,8 @@ class SlackImportCommandController extends CommandController
}
} while ($cursor);
$GLOBALS['BE_USER']->simplelog(
'Import of Slack User sucessful - imported ' . $counter . ' users',
't3o_slack'
);
$this->logger = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->getLogger(__CLASS__);
$this->logger->info('Import of Slack User sucessful - imported ' . $counter . ' users');
}
protected function getTSConfiguration()
......
......@@ -38,7 +38,7 @@ class SlackUserController extends ActionController
* action new
*
* @param \T3o\T3oSlack\Domain\Model\SlackUser $newSlackUser
* @dontvalidate $newSlackUser
* @ignorevalidation $newSlackUser
*/
public function newAction(SlackUser $newSlackUser = null)
{
......@@ -68,7 +68,7 @@ class SlackUserController extends ActionController
* action for errors and messages
*
* @param \T3o\T3oSlack\Domain\Model\SlackUser $newSlackUser
* @dontvalidate $newSlackUser
* @ignorevalidation $newSlackUser
*/
public function messageAction(SlackUser $newSlackUser = null)
{
......@@ -142,7 +142,7 @@ class SlackUserController extends ActionController
$logger->error(
'not handled exception in t3o_slack',
[
'response' => $error
'response' => $error,
]
);
if ($response['error']) {
......@@ -242,7 +242,7 @@ class SlackUserController extends ActionController
/**
* @param \T3o\T3oSlack\Domain\Model\SlackUser $newSlackUser
* @dontvalidate $newSlackUser
* @ignorevalidation $newSlackUser
*/
public function sendConfirmationMailAction($newSlackUser)
{
......@@ -286,7 +286,7 @@ class SlackUserController extends ActionController
/**
* @param \T3o\T3oSlack\Domain\Model\SlackUser $newSlackUser
* @dontvalidate $newSlackUser
* @ignorevalidation $newSlackUser
* @return bool
*/
public function sendConfirmationMail($newSlackUser)
......@@ -308,7 +308,7 @@ class SlackUserController extends ActionController
[
'user' => $user,
'hash' => HashUtility::createHashForUser($user),
'mail' => $newSlackUser->getEmail()
'mail' => $newSlackUser->getEmail(),
],
$femanagerSettings['new.']['email.']['createUserConfirmation.']
);
......
......@@ -22,12 +22,11 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
/**
* Check if a property of the userprofile is visible in the current context
*
* @param int $frontendUserUID
* @return string
*/
public function render(int $frontendUserUID)
public function render()
{
$feUser = $this->slackFrontendUserRepository->findByUid($frontendUserUID);
$feUser = $this->slackFrontendUserRepository->findByUid((int)$this->arguments['frontendUserUID']);
$slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId());
if ($slackUser) {
......@@ -38,7 +37,7 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
}
} else {
// @todo render link to register for slack
if ($GLOBALS['TSFE']->fe_user->user['uid'] == $frontendUserUID) {
if ($GLOBALS['TSFE']->fe_user->user['uid'] === (int)$this->arguments['frontendUserUID']) {
// @todo add TS configuration
$content = '<a href="https://my.typo3.org/?id=23">Get your TYPO3 Slack Account</a>';
} else {
......@@ -48,4 +47,13 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
return $content;
}
/**
* Initialize
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('frontendUserUID', 'integer', 'UID of the FrontendUser which should get displayed');
}
}
......@@ -33,7 +33,7 @@ Otherwise your changes will be overwritten the next time you save the extension
<f:form.submit class="btn btn-primary" value="Create TYPO3 Slack account"/>
</f:form>
<p>If you have already a TYPO3 Slack Ascount, you can connect your account with your TYPO3.org user profile.</p>
<p>If you have already a TYPO3 Slack Account, you can connect your account with your TYPO3.org user profile.</p>
<f:link.action action="connect" class="btn btn-secondary">Connect now</f:link.action>
......
......@@ -9,7 +9,7 @@
"issues": "https://github.com/TYPO3-typo3org/t3o_slack/issues"
},
"require": {
"typo3/cms-core": "8.5.0 - 8.9.99"
"typo3/cms-core": "^8.7 || ^9.5"
},
"autoload": {
"psr-4": {
......
......@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = [
'version' => '1.1.4',
'constraints' => [
'depends' => [
'typo3' => '8.5.0-8.99.99',
'typo3' => '8.7.0',
],
'conflicts' => [],
'suggests' => [],
......
......@@ -28,11 +28,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
*/
protected $termsVersion = '';
/**
* @var string
*/
protected $hashMd5 = '';
/**
* @var string
*/
......@@ -41,7 +36,7 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
/**
* @var string
*/
protected $hashCrypt = '';
protected $hashCryptSha512 = '';
/**
* @return string
......@@ -107,16 +102,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this->termsVersion = $termsVersion;
}
public function getHashMd5(): string
{
return $this->hashMd5;
}
public function setHashMd5(string $hashMd5)
{
$this->hashMd5 = $hashMd5;
}
public function getHashSha1(): string
{
return $this->hashSha1;
......@@ -127,13 +112,13 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this->hashSha1 = $hashSha1;
}
public function getHashCrypt(): string
public function getHashCryptSha512(): string
{
return $this->hashCrypt;
return $this->hashCryptSha512;
}
public function setHashCrypt(string $hashCrypt)
public function setHashCryptSha512(string $hashCryptSha512): void
{
$this->hashCrypt = $hashCrypt;
$this->hashCryptSha512 = $hashCryptSha512;
}
}
......@@ -173,6 +173,7 @@ class FeManagerHooks
$plainTextPassword = '';
if ($user->_isDirty('password') && $user->getPassword() !== '') {
$plainTextPassword = $user->getPassword();
$user->setPassword($this->getRandomPassword());
\In2code\Femanager\Utility\UserUtility::convertPassword($user, '');
}
$this->ldapUserCreateUpdateDelete->updateUser($user, true, $plainTextPassword);
......@@ -222,6 +223,7 @@ class FeManagerHooks
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$userRepository = $objectManager->get(\In2code\Femanager\Domain\Repository\UserRepository::class);
$plainTextPassword = $user->getPassword();
$user->setPassword($this->getRandomPassword());
\In2code\Femanager\Utility\UserUtility::hashPassword($user, '');
$userRepository->add($user);
$this->persistenceManager->persistAll();
......@@ -288,7 +290,8 @@ class FeManagerHooks
protected function getTSConfiguration()
{
// init ConfigurationManager
$configurationManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$configurationManager = $objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
// load complete ts
$tsSettings = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
......@@ -327,6 +330,11 @@ class FeManagerHooks
return true;
}
private function getRandomPassword(): string
{
return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Crypto\Random::class)->generateRandomHexString(20);
}
/**
* @return string
*/
......
......@@ -97,7 +97,7 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
$this->persistenceManager->persistAll();
$this->addFlashMessage(
'The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS,
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
'Old User transfer'
);
$this->sendRecoveryMail($oldUser->getEmail(), $oldUser->getUsername());
......@@ -125,7 +125,7 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
$this->sendRecoveryMail($feUser->getEmail(), $feUser->getUsername());
$this->addFlashMessage(
'The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS,
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
'LDAP Transfer'
);
} else {
......
......@@ -27,7 +27,6 @@ namespace T3o\T3omy\Hooks;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
......@@ -102,7 +101,9 @@ class RecordListWorkflowFeUsers implements RecordListHookInterface
'id' => $row['pid']
];
$href = BackendUtility::getModuleUrl('web_list', $urlParameters);
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$href = $uriBuilder->buildUriFromRoute('web_list', $urlParameters);
$class = 'btn btn-default';
return '<a class="' . $class . '" href="' . $href . '">'
......
......@@ -27,7 +27,6 @@ namespace T3o\T3omy\Hooks;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
......@@ -101,7 +100,9 @@ class RecordListWorkflowOldUsers implements RecordListHookInterface
],
];
$href = BackendUtility::getModuleUrl('web_list', $urlParameters);
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$href = $uriBuilder->buildUriFromRoute('web_list', $urlParameters);
$class = 'btn btn-default';
return '<a class="' . $class . '" href="' . $href . '">'
......
......@@ -25,12 +25,11 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper
/**
* Checks if the user is online in slack
*
* @param int $frontendUserUID
* @return string
*/
public function render($frontendUserUID)
public function render()
{
$feUser = $this->slackFrontendUserRepository->findByUid($frontendUserUID);
$feUser = $this->slackFrontendUserRepository->findByUid((int)$this->arguments['frontendUserUID']);
$slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId());
if ($slackUser) {
......@@ -45,4 +44,13 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper
}
return $status;
}
/**
* Initialize
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('frontendUserUID', 'integer', 'UID of the FrontendUser which should get displayed');
}
}
......@@ -32,23 +32,9 @@ $feUsersColumns = [
'type' => 'input'
],
],
'hash_md5' => [
'hash_crypt_sha512' => [
'exclude' => 0,
'label' => 'MD5 Hash of password',
'config' => [
'type' => 'none'
],
],
'hash_sha1' => [
'exclude' => 0,
'label' => 'SHA1 Hash of password',
'config' => [
'type' => 'none'
],
],
'hash_crypt' => [
'exclude' => 0,
'label' => 'Crypt Hash of password',
'label' => 'Crypt SHA512 Hash of password',
'config' => [
'type' => 'none'
],
......@@ -56,7 +42,7 @@ $feUsersColumns = [
];
$fields = 'github, twitter, facebook, terms_version';
$passwordHashFields = 'hash_md5, hash_sha1, hash_crypt';
$passwordHashFields = 'hash_crypt_sha512';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'fe_users',
......
......@@ -17,7 +17,7 @@ return [
],
'types' => [
'1' => [
'showitem' => 'uid, username, email, '
'showitem' => 'uid, username, email, deleted_by, delete_date, otrs_ticket, gitlab_ticket, comment'
],
],
'palettes' => [
......@@ -44,5 +44,61 @@ return [
'eval' => 'trim'
],
],
'deleted_by' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3omy/Resources/Private/Language/locallang.xlf:' .
'old-users.deleted_by',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'readOnly' => 1
],
],
'delete_date' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3omy/Resources/Private/Language/locallang.xlf:' .
'old-users.delete_date',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'dbType' => 'datetime',
'eval' => 'datetime',
'readOnly' => 1
],
],
'otrs_ticket' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3omy/Resources/Private/Language/locallang.xlf:' .
'old-users.otrs_ticket',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'readOnly' => 1
],
],
'gitlab_ticket' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3omy/Resources/Private/Language/locallang.xlf:' .
'old-users.gitlab_ticket',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'readOnly' => 1
],
],
'comment' => [
'exclude' => 0,
'label' => 'LLL:EXT:t3omy/Resources/Private/Language/locallang.xlf:' .
'old-users.comment',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'readOnly' => 1
],
],
],
];
......@@ -15,6 +15,9 @@ plugin.tx_femanager {
uniqueInLdap = 1
notInOldUserTable = 1
lowerChars = 1