/**
  * @param string $key the key for additionalHeaderData; useful for overriding
  * @return string
  */
 public function render($key = NULL)
 {
     $feUserObj = Tools::getActualUser($this->feUserRepository);
     if ($feUserObj != NULL) {
         if ($this->isAdminUser($feUserObj)) {
             return $this->renderThenChild();
         } else {
             return $this->renderElseChild();
         }
     } else {
         return $this->renderElseChild();
     }
 }
 public function evaluationPageAction()
 {
     \SLUB\Vk2\Utils\Tools::renderOpenlayersDependencies($this->settings);
     \SLUB\Vk2\Utils\Tools::renderClientSettings($this->settings);
     $user = Tools::getActualUser($this->feUserRepository);
     $usergroup = Tools::getUsergroupsForUser($user);
     if (in_array('vk2-admin', $usergroup)) {
         // user is authenticated
         // do nothing
         return;
     } else {
         // user is not authenticated
         // redirect to main page
         $this->redirect('show', 'Main', NULL);
     }
 }
 /**
  * Proxies the get georeference user history request (user view) to the backend service
  * @return string json
  */
 public function georeferenceUserHistoryAction()
 {
     $user = Tools::getActualUser($this->feUserRepository);
     # check if it is allowed
     $this->checkIfAllowed($user);
     # generate request url
     $url = $GLOBALS['TSFE']->tmpl->setup['config.']['georefBackend'] . $this->userEndpoint . '/' . $user->getUsernameURLEncoded() . '/history';
     // generate request
     $request = GeneralUtility::makeInstance('t3lib_http_Request', $url);
     $request->setMethod('GET');
     $response = $request->send()->getBody();
     # create response
     $this->view->assign('value', json_decode($response, TRUE));
 }