Exemplo n.º 1
0
 /**
  * @param \TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser Target backendUser to switch active session to
  * @param boolean $emulate Return to current session or logout after target session termination?
  * @return string
  */
 public function render(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser, $emulate = FALSE)
 {
     if ($backendUser->getIsAdministrator()) {
         return '';
     }
     $title = $GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $backendUser->getUserName() . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', TRUE);
     return '<a href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid(), 'switchBackUser' => $emulate)) . '" target="_top" title="' . htmlspecialchars($title) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch')) . '</a>';
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function setAdminToFalseSetsAdmin()
 {
     $this->fixture->setIsAdministrator(FALSE);
     $this->assertFalse($this->fixture->getIsAdministrator(), 'Admin status is not false, after setting to false.');
 }