Commit 10edaade authored by Stefan Busemann's avatar Stefan Busemann

[BUGFIX] Remove Debug statement

parent abc26fae
Pipeline #5973 passed with stages
in 2 minutes and 12 seconds
......@@ -109,7 +109,6 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
{
$recoverUser = GeneralUtility::_GP('web_list');
if (($table === 'old_users') && $recoverUser['uid'] > 0 && $recoverUser['command'] == 'recoverOldUser') {
$this->oldUserRepository = $this->getUserRepository(OldUserRepository::class);
$oldUser = $this->oldUserRepository->findByUid($recoverUser['uid']);
......@@ -117,8 +116,11 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
if ($oldUser && $this->recoverUser($oldUser)) {
$this->oldUserRepository->remove($oldUser);
$this->persistenceManager->persistAll();
$this->addFlashMessage('The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS, 'Old User transfer');
$this->addFlashMessage(
'The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS,
'Old User transfer'
);
$this->sendRecoveryMail($oldUser->getEmail(), $oldUser->getUsername());
}
}
......@@ -136,18 +138,25 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
$ldapOperation = $this->objectManager->get(FeManagerHooks::class);
$ldapOperation->createUser($feUser);
$this->sendRecoveryMail($feUser->getEmail(), $feUser->getUsername());
$this->addFlashMessage('The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS, 'LDAP Transfer');
$this->addFlashMessage(
'The user is created in LDAP',
\TYPO3\CMS\Core\Messaging\FlashMessage::SUCCESS,
'LDAP Transfer'
);
} else {
$this->addFlashMessage('This user has no valid mail',
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, 'LDAP Transfer');
$this->addFlashMessage(
'This user has no valid mail',
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
'LDAP Transfer'
);
}
} else {
$this->addFlashMessage('This user can not be via repository',
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, 'LDAP Transfer');
$this->addFlashMessage(
'This user can not be via repository',
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
'LDAP Transfer'
);
}
}
}
}
......@@ -156,7 +165,7 @@ class ReactivateUserHook implements \TYPO3\CMS\Backend\RecordList\RecordListGetT
* Send out the inforamation, that the user has to reset his password
*
* @param string $receiverMail
* @param String $userName
* @param string $userName
*/
public function sendRecoveryMail(string $receiverMail, String $userName)
{
......@@ -183,7 +192,7 @@ TYPO3 Association, Sihlbruggstrasse 105, CH-6340 Baar, Switzerland
}
/**
* @param String $repositoryClass
* @param string $repositoryClass
* @return object
*/
public function getUserRepository(String $repositoryClass)
......@@ -192,22 +201,20 @@ TYPO3 Association, Sihlbruggstrasse 105, CH-6340 Baar, Switzerland
$this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
return $this->objectManager->get($repositoryClass);
}
/**
* @param string $flashMessage
* @param $severity
* @param string $messageHeader
* @return void
*/
public function addFlashMessage(string $flashMessage, $severity, string $messageHeader)
{
$this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$flashMessageService = $this->objectManager->get(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
$messageQueue = $flashMessageService->getMessageQueueByIdentifier();
$flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$flashMessage,
$messageHeader, // [optional] the header
$severity,
......@@ -217,4 +224,3 @@ TYPO3 Association, Sihlbruggstrasse 105, CH-6340 Baar, Switzerland
$messageQueue->addMessage($flashMessage);
}
}
......@@ -93,7 +93,6 @@ class RecordListWorkflowFeUsers implements RecordListHookInterface
*/
protected function getWorkflowButton($row)
{
#\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($row, __FILE__ . '@' . __LINE__);
$urlParameters = [
'web_list' => [
'uid' => $row['uid'],
......
......@@ -68,7 +68,7 @@ $dispatcher->connect(
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed'][] = \T3o\T3omy\Hooks\FeManagerHooks::class . '->writePassword';
// Hook to look, if a user does exist in "old_users" table
#$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'][] = \T3o\T3omy\Hooks\ReactivateUserHook::class . '->reactivateOldUser';
//$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'][] = \T3o\T3omy\Hooks\ReactivateUserHook::class . '->reactivateOldUser';
// Hook to process reactivate process via BE
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = \T3o\T3omy\Hooks\ReactivateUserHook::class;
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