Commit 89fd74a7 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

Merge branch 'develop' into 'master'

Day of the jogging pants release

See merge request !192
parents 41c2b43c 7e647abe
Pipeline #8384 passed with stages
in 7 minutes
APIVersion: v1.12.0
APIVersion: v1.12.1
name: my.typo3.org
type: typo3
docroot: public
......@@ -9,7 +9,7 @@ router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.1"
mariadb_version: "10.2"
nfs_mount_enabled: false
provider: default
hooks:
......@@ -20,12 +20,12 @@ hooks:
- 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]
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.12.0
# 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
......
......@@ -357,16 +357,16 @@
},
{
"name": "doctrine/dbal",
"version": "v2.10.0",
"version": "v2.10.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "0c9a646775ef549eb0a213a4f9bd4381d9b4d934"
"reference": "c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/0c9a646775ef549eb0a213a4f9bd4381d9b4d934",
"reference": "0c9a646775ef549eb0a213a4f9bd4381d9b4d934",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8",
"reference": "c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8",
"shasum": ""
},
"require": {
......@@ -445,7 +445,7 @@
"sqlserver",
"sqlsrv"
],
"time": "2019-11-03T16:50:43+00:00"
"time": "2020-01-04T12:56:21+00:00"
},
{
"name": "doctrine/event-manager",
......@@ -981,25 +981,25 @@
},
{
"name": "helhum/typo3-composer-setup",
"version": "v0.5.4",
"version": "v0.5.5",
"source": {
"type": "git",
"url": "https://github.com/helhum/typo3-composer-setup.git",
"reference": "d8a7db5fc160bd652aae2837b324b26f7b5ed6d4"
"reference": "623a1c4ad5183621489838bad094df270a1ff2c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/helhum/typo3-composer-setup/zipball/d8a7db5fc160bd652aae2837b324b26f7b5ed6d4",
"reference": "d8a7db5fc160bd652aae2837b324b26f7b5ed6d4",
"url": "https://api.github.com/repos/helhum/typo3-composer-setup/zipball/623a1c4ad5183621489838bad094df270a1ff2c2",
"reference": "623a1c4ad5183621489838bad094df270a1ff2c2",
"shasum": ""
},
"require": {
"typo3/cms-composer-installers": "^1.4 || ^2.0",
"typo3/minimal": "^7 || ^8 || ^9"
"typo3/minimal": "^7 || ^8 || ^9 || ^10"
},
"require-dev": {
"typo3-console/php-server-command": "^0.1.0",
"typo3/cms-core": "^8.7.10 || ^9.5.2"
"typo3/cms-core": "^8.7.10 || ^9.5.2 || ^10.2.0"
},
"suggest": {
"helhum/typo3-console": "TYPO3 Console is highly recommended for any TYPO3 composer setup.",
......@@ -1032,20 +1032,20 @@
}
],
"description": "Set up required entry points for TYPO3 web directory",
"time": "2018-12-16T11:45:46+00:00"
"time": "2019-12-11T13:21:23+00:00"
},
{
"name": "helhum/typo3-console",
"version": "v5.7.2",
"version": "v5.8.2",
"source": {
"type": "git",
"url": "https://github.com/TYPO3-Console/TYPO3-Console.git",
"reference": "2e6b9eb9910fc79d24b0ed6ce5317503669d9535"
"reference": "f6a43797fbcdec5ae5e3a2576948ab50c8623082"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3-Console/TYPO3-Console/zipball/2e6b9eb9910fc79d24b0ed6ce5317503669d9535",
"reference": "2e6b9eb9910fc79d24b0ed6ce5317503669d9535",
"url": "https://api.github.com/repos/TYPO3-Console/TYPO3-Console/zipball/f6a43797fbcdec5ae5e3a2576948ab50c8623082",
"reference": "f6a43797fbcdec5ae5e3a2576948ab50c8623082",
"shasum": ""
},
"require": {
......@@ -1125,7 +1125,7 @@
"console",
"typo3"
],
"time": "2019-08-22T10:03:46+00:00"
"time": "2019-12-16T14:05:44+00:00"
},
{
"name": "helhum/typo3-console-plugin",
......@@ -1911,16 +1911,16 @@
},
{
"name": "symfony/cache",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "de737c81ea95018d11a3ef908ad2ebf203741b96"
"reference": "6af64bab165e588300378a87bcd2df3c7c31c144"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/de737c81ea95018d11a3ef908ad2ebf203741b96",
"reference": "de737c81ea95018d11a3ef908ad2ebf203741b96",
"url": "https://api.github.com/repos/symfony/cache/zipball/6af64bab165e588300378a87bcd2df3c7c31c144",
"reference": "6af64bab165e588300378a87bcd2df3c7c31c144",
"shasum": ""
},
"require": {
......@@ -1986,7 +1986,7 @@
"caching",
"psr6"
],
"time": "2019-12-01T10:50:45+00:00"
"time": "2019-12-16T10:45:21+00:00"
},
{
"name": "symfony/cache-contracts",
......@@ -2048,16 +2048,16 @@
},
{
"name": "symfony/console",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201"
"reference": "82437719dab1e6bdd28726af14cb345c2ec816d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/f0aea3df20d15635b3cb9730ca5eea1c65b7f201",
"reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201",
"url": "https://api.github.com/repos/symfony/console/zipball/82437719dab1e6bdd28726af14cb345c2ec816d0",
"reference": "82437719dab1e6bdd28726af14cb345c2ec816d0",
"shasum": ""
},
"require": {
......@@ -2120,7 +2120,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2019-12-01T10:06:17+00:00"
"time": "2019-12-17T10:32:23+00:00"
},
{
"name": "symfony/contracts",
......@@ -2268,16 +2268,16 @@
},
{
"name": "symfony/expression-language",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/expression-language.git",
"reference": "8a1028a65623a8f7bba582b60e4fd308e6f43001"
"reference": "539e7ff0b635c8b90d8127bc929da781a96eab2d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/expression-language/zipball/8a1028a65623a8f7bba582b60e4fd308e6f43001",
"reference": "8a1028a65623a8f7bba582b60e4fd308e6f43001",
"url": "https://api.github.com/repos/symfony/expression-language/zipball/539e7ff0b635c8b90d8127bc929da781a96eab2d",
"reference": "539e7ff0b635c8b90d8127bc929da781a96eab2d",
"shasum": ""
},
"require": {
......@@ -2315,11 +2315,11 @@
],
"description": "Symfony ExpressionLanguage Component",
"homepage": "https://symfony.com",
"time": "2019-11-12T14:53:53+00:00"
"time": "2019-12-10T10:33:21+00:00"
},
{
"name": "symfony/finder",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
......@@ -2368,7 +2368,7 @@
},
{
"name": "symfony/intl",
"version": "v5.0.1",
"version": "v5.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/intl.git",
......@@ -2793,16 +2793,16 @@
},
{
"name": "symfony/process",
"version": "v4.4.0",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06"
"reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/75ad33d9b6f25325ebc396d68ad86fd74bcfbb06",
"reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06",
"url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b",
"reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b",
"shasum": ""
},
"require": {
......@@ -2838,20 +2838,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2019-10-28T20:30:34+00:00"
"time": "2019-12-06T10:06:46+00:00"
},
{
"name": "symfony/routing",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "51f3f20ad29329a0bdf5c0e2f722d3764b065273"
"reference": "628bcafae1b2043969378dcfbf9c196539a38722"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/51f3f20ad29329a0bdf5c0e2f722d3764b065273",
"reference": "51f3f20ad29329a0bdf5c0e2f722d3764b065273",
"url": "https://api.github.com/repos/symfony/routing/zipball/628bcafae1b2043969378dcfbf9c196539a38722",
"reference": "628bcafae1b2043969378dcfbf9c196539a38722",
"shasum": ""
},
"require": {
......@@ -2914,7 +2914,7 @@
"uri",
"url"
],
"time": "2019-12-01T08:39:58+00:00"
"time": "2019-12-12T12:53:52+00:00"
},
{
"name": "symfony/service-contracts",
......@@ -2976,7 +2976,7 @@
},
{
"name": "symfony/var-exporter",
"version": "v5.0.1",
"version": "v5.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
......@@ -3036,16 +3036,16 @@
},
{
"name": "symfony/yaml",
"version": "v4.4.1",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "76de473358fe802578a415d5bb43c296cf09d211"
"reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211",
"reference": "76de473358fe802578a415d5bb43c296cf09d211",
"url": "https://api.github.com/repos/symfony/yaml/zipball/a08832b974dd5fafe3085a66d41fe4c84bb2628c",
"reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c",
"shasum": ""
},
"require": {
......@@ -3091,7 +3091,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2019-11-12T14:51:11+00:00"
"time": "2019-12-10T10:33:21+00:00"
},
{
"name": "t3o/gitlab_api",
......@@ -3181,11 +3181,11 @@
},
{
"name": "t3o/t3olayout",
"version": "4.1.2",
"version": "4.1.4",
"source": {
"type": "git",
"url": "https://git-t3o.typo3.org/t3o/t3olayout.git",
"reference": "cfe35453fe11b3cc5a2643a013c489e6fcfc53cb"
"reference": "2f5d41666aa2b6caeef7209ccc32d779cb42c3d0"
},
"require": {
"causal/ig_ldap_sso_auth": "^3.4",
......@@ -3234,7 +3234,7 @@
"keywords": [
"TYPO3 CMS"
],
"time": "2019-11-22T13:28:24+00:00"
"time": "2020-01-15T09:21:47+00:00"
},
{
"name": "t3o/t3omy",
......@@ -3513,21 +3513,21 @@
},
{
"name": "typo3/cms-composer-installers",
"version": "v2.2.3",
"version": "v2.2.4",
"source": {
"type": "git",
"url": "https://github.com/TYPO3/CmsComposerInstallers.git",
"reference": "7ecc2253e2d97a52824fcdd4e2f632bae9936810"
"reference": "17243f398bf027ba56be6507c11ab957b15bbe3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3/CmsComposerInstallers/zipball/7ecc2253e2d97a52824fcdd4e2f632bae9936810",
"reference": "7ecc2253e2d97a52824fcdd4e2f632bae9936810",
"url": "https://api.github.com/repos/TYPO3/CmsComposerInstallers/zipball/17243f398bf027ba56be6507c11ab957b15bbe3b",
"reference": "17243f398bf027ba56be6507c11ab957b15bbe3b",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": ">=7.0.0 <=7.4"
"php": ">=7.0.0 <7.5"
},
"conflict": {
"composer/installers": "<1.0.24 || >1.0.24"
......@@ -3576,7 +3576,7 @@
"installer",
"typo3"
],
"time": "2019-09-24T22:09:42+00:00"
"time": "2019-12-18T20:02:06+00:00"
},
{
"name": "typo3/cms-core",
......
......@@ -2,7 +2,7 @@ rootPageId: 1
base: 'https://my.typo3.org'
baseVariants:
-
base: 'http://my.typo3.org.ddev.site'
base: 'https://my.typo3.org.ddev.site'
condition: 'applicationContext == "Development"'
-
base: 'https://my-stage.typo3.org'
......
......@@ -329,6 +329,26 @@ class Ldap implements \Psr\Log\LoggerAwareInterface
return $ret;
}
/**
* return data of user that exists in LDAP
*
* @param string $username The username
* @return array
*/
public function getUser($username): array
{
$user = [];
$dn = $this->getDnForUserName($username);
$filter = '(|(objectClass=typo3Person))';
$attributes = ['sn', 'email', 'ou', 'displayName', 'mail', 'uid'];
$searchResult = @ldap_search($this->ldapConnection, $dn, $filter, $attributes);
if ($searchResult) {
$info = ldap_get_entries($this->ldapConnection, $searchResult);
$user = $info[0];
}
return $user;
}
/**
* Update a user in LDAP
*
......
<?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);