Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
t3o
my.typo3.org
Commits
681d2100
Commit
681d2100
authored
Jul 22, 2018
by
Thomas Löffler
Browse files
WIP: Current WIP for reactivation process
parent
975d581a
Pipeline
#5001
failed with stages
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
html/typo3conf/ext/t3omy/Classes/Domain/Repository/OldUserRepository.php
View file @
681d2100
...
...
@@ -11,4 +11,14 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
*/
class
OldUserRepository
extends
Repository
{
public
function
__construct
()
{
$objectManager
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Object\ObjectManager
::
class
);
parent
::
__construct
(
$objectManager
);
$querySettings
=
$objectManager
->
get
(
\
TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
::
class
);
$querySettings
->
setRespectStoragePage
(
false
);
$this
->
setDefaultQuerySettings
(
$querySettings
);
}
}
html/typo3conf/ext/t3omy/Classes/Hooks/ReactivateUserHook.php
View file @
681d2100
...
...
@@ -39,27 +39,37 @@ class ReactivateUserHook
/**
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
public
function
reactivateOldUser
()
public
function
reactivateOldUser
(
array
$params
,
\
TYPO3\CMS\Felogin\Controller\FrontendLoginController
$frontendLoginController
)
{
$this
->
objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$this
->
persistenceManager
=
$this
->
objectManager
->
get
(
PersistenceManager
::
class
);
$this
->
oldUserRepository
=
$this
->
objectManager
->
get
(
OldUserRepository
::
class
);
// check if there is a fitting user in old user table
$username
=
GeneralUtility
::
_GP
(
'user'
);
/** @var /T3o/T3omy/Domain/Model/OldUser $oldUser */
$oldUser
=
$this
->
oldUserRepository
->
findOneByUsername
(
GeneralUtility
::
_POST
(
'user'
));
if
(
$oldUser
)
{
if
(
$this
->
recoverUser
(
$oldUser
))
{
$this
->
oldUserRepository
->
remove
(
$oldUser
);
$this
->
persistenceManager
->
persistAll
();
$uriBuilder
=
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder
::
class
);
if
(
$username
)
{
$oldUser
=
$this
->
oldUserRepository
->
findOneByUsername
(
GeneralUtility
::
_POST
(
'user'
));
if
(
$oldUser
)
{
$uriBuilder
=
$this
->
objectManager
->
get
(
\
TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder
::
class
);
$configurationManager
=
$this
->
objectManager
->
get
(
\
TYPO3\CMS\Extbase\Configuration\ConfigurationManager
::
class
);
$configurationManager
->
setContentObject
(
$frontendLoginController
->
cObj
);
$uriBuilder
->
injectConfigurationManager
(
$configurationManager
);
$uriBuilder
->
initializeObject
();
$uri
=
$uriBuilder
->
reset
()
->
setTargetPageUid
(
37
)
->
setTargetPageUid
(
38
)
->
setTargetPageType
(
0
)
->
setCreateAbsoluteUri
(
true
)
->
buildFrontendUri
();
\
TYPO3\CMS\Core\Utility\HttpUtility
::
redirect
(
$uri
,
\
TYPO3\CMS\Core\Utility\HttpUtility
::
HTTP_STATUS_303
);
// $frontendLoginController->LOCAL_LANG['']
\
TYPO3\CMS\Extbase\Utility\DebuggerUtility
::
var_dump
(
$uri
);
\
TYPO3\CMS\Extbase\Utility\DebuggerUtility
::
var_dump
(
$frontendLoginController
->
LOCAL_LANG
);
// if ($this->recoverUser($oldUser)) {
// $this->oldUserRepository->remove($oldUser);
// $this->persistenceManager->persistAll();
// }
}
}
}
...
...
@@ -71,6 +81,7 @@ class ReactivateUserHook
*/
public
function
recoverUser
(
OldUser
$oldUser
):
bool
{
return
true
;
$userRepository
=
$this
->
objectManager
->
get
(
UserRepository
::
class
);
$random
=
GeneralUtility
::
makeInstance
(
\
TYPO3\CMS\Core\Crypto\Random
::
class
);
...
...
@@ -86,7 +97,7 @@ class ReactivateUserHook
$ldapOperation
=
$this
->
objectManager
->
get
(
FeManagerHooks
::
class
);
$ldapOperation
->
createUser
(
$frontendUser
);
//
$ldapOperation->createUser($frontendUser);
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment