Commit 425a3937 authored by Jonathan IROULIN's avatar Jonathan IROULIN Committed by Thomas Löffler

Use extbase User Model Repository

parent 0b618283
......@@ -65,7 +65,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
protected $persistenceManager;
/**
* @var Tx_TerFe2_Domain_Repository_UserRepository
* @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
*/
protected $ownerRepository;
......@@ -85,7 +85,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->tagRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_TagRepository');
$this->versionRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_VersionRepository');
$this->authorRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_AuthorRepository');
$this->ownerRepository = $this->objectManager->get(Tx_TerFe2_Domain_Repository_UserRepository::class);
$this->ownerRepository = $this->objectManager->get(\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository::class);
$this->providerManager = $this->objectManager->get('Tx_TerFe2_Provider_ProviderManager');
$this->session = $this->objectManager->get('Tx_TerFe2_Persistence_Session');
$this->persistenceManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
......@@ -196,7 +196,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$versionHistoryCount = (!empty($this->settings['versionHistoryCount']) ? $this->settings['versionHistoryCount'] : 5);
$skipLatestVersion = (isset($this->settings['skipLatestVersion']) ? $this->settings['skipLatestVersion'] : TRUE);
$loggedInUser = $this->ownerRepository->findCurrent();
//$loggedInUser = $this->ownerRepository->findCurrent();
if ($extension !== NULL &&
$extension instanceof Tx_TerFe2_Domain_Model_Extension &&
......@@ -212,8 +212,8 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->view->assign('loggedInUser', $loggedInUser);
/** @var Tx_TerFe2_Service_Documentation $documentationService */
$documentationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_TerFe2_Service_Documentation');
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
//$documentationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_TerFe2_Service_Documentation');
//$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
$this->view->assign('documentationLink', $documentationLink);
$GLOBALS['TSFE']->getPageRenderer()->addMetaTag('<meta name="description" content="' . htmlspecialchars($extension->getLastVersion()->getDescription()) . '" />');
......
......@@ -42,7 +42,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
protected $versionRepository;
/**
* @var Tx_TerFe2_Domain_Repository_UserRepository
* @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
*/
protected $userRepository;
......@@ -119,9 +119,9 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$extension = $this->extensionRepository->findOneByExtKey($extensionKey);
$message = '';
if ($extension instanceof Tx_TerFe2_Domain_Model_Extension && $extension->getFrontendUser()) {
/** @var Tx_Ajaxlogin_Domain_Model_User $frontendUser */
/** @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser */
$frontendUser = $this->userRepository->findOneByUsername($extension->getFrontendUser());
if ($frontendUser instanceof Tx_Ajaxlogin_Domain_Model_User) {
if ($frontendUser instanceof \TYPO3\CMS\Extbase\Domain\Model\FrontendUser) {
$message = $this->resolveWSErrorMessage(
$error . '.message',
array(
......
<?php
class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
class \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
{
/**
* Find an Object using the UID of the current fe_user
* @return Tx_Ajaxlogin_Domain_Model_User the current fe_user or null if none
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser the current fe_user or null if none
*/
public function findCurrent()
{
......@@ -23,7 +23,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
/**
* Find an Object using the UID of the current fe_user
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByForgotHashAndEmail($forgotHash, $email)
{
......@@ -43,7 +43,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
/**
* Find an Object using the UID of the current fe_user
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByVerificationHashAndEmail($verificationHash, $email)
{
......@@ -62,7 +62,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
}
/**
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByEmail($email)
{
......@@ -80,7 +80,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
}
/**
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByUsername($username)
{
......@@ -101,7 +101,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
/**
* Find an Object using the UID of the current fe_user
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByEnableHash($enableHash)
{
......@@ -143,7 +143,7 @@ class Tx_TerFe2_Domain_Repository_UserRepository extends \TYPO3\CMS\Extbase\Doma
/**
* @param $uid
*
* @return Tx_Ajaxlogin_Domain_Model_User
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findUserByUid($uid)
{
......
......@@ -73,6 +73,11 @@ plugin.tx_terfe2 {
}
}
}
\TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
mapping {
tableName = fe_users
}
}
}
}
......
......@@ -175,7 +175,6 @@
<td>
{owner.name}
<br/>
<terfe2:userImage user="{owner}" alt="{owner.name}" size="mid"/>
</td>
</tr>
</f:if>
......
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