Commit 1eb8a6a6 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[BUGFIX] apply CGL

parent e1091a09
Pipeline #8147 passed with stages
in 2 minutes and 56 seconds
......@@ -337,7 +337,7 @@ class Ldap implements \Psr\Log\LoggerAwareInterface
*/
public function getUser($username): array
{
$user = array();
$user = [];
$dn = $this->getDnForUserName($username);
$filter = '(|(objectClass=typo3Person))';
$attributes = ['sn', 'email', 'ou', 'displayName', 'mail', 'uid'];
......
<?php
declare(strict_types=1);
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;
use T3o\T3oLdap\Connectors\Ldap;
/**
* Class GdprController
......@@ -82,7 +82,6 @@ class GdprController extends ActionController
$this->forward('step1');
}
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$this->view->assignMultiple(
......@@ -143,9 +142,8 @@ class GdprController extends ActionController
if ($ldap->userExists($userName)) {
return true;
} else {
return false;
}
return false;
}
/**
......@@ -185,14 +183,14 @@ class GdprController extends ActionController
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. '
LDAP User deletion was performed by:' . $GLOBALS['BE_USER']->name . '
Your TYPO3 website adminstration team
';
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setSubject('[Ticket#' . $data['otrs'] . '] User deletion notificaion : ' . $data['username']);
$mail->setFrom(array('confirm-t3o-account@typo3.org' => 'typo3.org administration'));
$mail->setTo(array('otrs@typo3.org', 'otrs@typo3.org' => 'TYPO3 OTRS Notification Master'));
$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();
}
......@@ -215,8 +213,8 @@ class GdprController extends ActionController
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setSubject('User delection process: ' . $data['username']);
$mail->setFrom(array('confirm-t3o-account@typo3.org' => 'typo3.org administration'));
$mail->setTo(array('admin@typo3.org', 'admin@typo3.org' => 'TYPO3 Serverteam'));
$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();
}
......@@ -231,7 +229,7 @@ class GdprController extends ActionController
throw $e;
}
#$ldap->deleteUser($data['userName']);
//$ldap->deleteUser($data['userName']);
return true;
}
......@@ -241,8 +239,7 @@ class GdprController extends ActionController
$dbConnection = GeneralUtility::makeInstance(ConnectionPool::class);
$dbConnection->getConnectionForTable('fe_users')->delete(
'fe_users',
array('username' => $data['username'])
['username' => $data['username']]
);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment