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

Use extbase User Model Repository

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