当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::getAccount方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Security\Context::getAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getAccount方法的具体用法?PHP Context::getAccount怎么用?PHP Context::getAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Security\Context的用法示例。


在下文中一共展示了Context::getAccount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editAction

 /**
  * @param \SKL\Post\Domain\Model\Author $author
  * @return void
  */
 public function editAction(Author $author)
 {
     $account = $this->securityContext->getAccount();
     $this->view->assign('usrname', $account->getAccountIdentifier());
     $this->view->assign('listCategories', $this->categoryRepository->findAll());
     $this->view->assign('author', $author);
 }
开发者ID:sengkimlong,项目名称:flow-login,代码行数:11,代码来源:AuthorController.php

示例2: preToolbarRendering

 /**
  * TODO: Document this Method! ( assignVariables )
  */
 public function preToolbarRendering()
 {
     $account = $this->context->getAccount();
     $votes = array();
     $privilege = array('PRIVILEGE_ABSTAIN', 'PRIVILEGE_GRANT', 'PRIVILEGE_DENY');
     $roleVotes = \Debug\Toolbar\Service\DataStorage::get('Security:RoleVotes');
     if (is_array($roleVotes)) {
         foreach ($roleVotes as $key => $value) {
             $vote = array('role' => (string) $value['role']);
             $vote['privilege'] = '';
             if (is_array($value['privileges'])) {
                 foreach ($value['privileges'] as $k => $p) {
                     $vote['privilege'] = $privilege[$p];
                 }
             }
             $votes[$value['role'] . ':' . $vote['privilege']] = $vote;
         }
     } else {
         $roles = $this->context->getRoles();
         foreach ($roles as $key => $value) {
             $vote = array('role' => (string) $value);
             $votes[] = $vote;
         }
     }
     \Debug\Toolbar\Service\Collector::getModule('Security')->getToolbar()->addIcon('user')->addText(is_object($account) ? $account->getAccountIdentifier() : 'Guest')->getPopup()->addPartial('Security', array('roles' => $this->context->getRoles(), 'account' => $this->context->getaccount(), 'votes' => $votes))->getPanel()->addPartial('Security', array('roles' => $this->context->getRoles(), 'account' => $this->context->getaccount(), 'votes' => $votes));
 }
开发者ID:radmiraal,项目名称:Debug.Toolbar,代码行数:29,代码来源:SecurityDebugger.php

示例3: getAccount

 /**
  * Get the account of the first authenticated token.
  *
  * @return \TYPO3\Flow\Security\Account|NULL
  */
 public function getAccount()
 {
     if ($this->securityContext->canBeInitialized()) {
         return $this->securityContext->getAccount();
     }
     return NULL;
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:12,代码来源:SecurityHelper.php

示例4: indexAction

 /**
  * @return void
  */
 public function indexAction()
 {
     $account = $this->securityContext->getAccount();
     $this->view->assign('usrname', $account->getAccountIdentifier());
     $this->view->assign('setups', $this->setupRepository->findAll());
     $this->view->assign('listCategories', $this->categoryRepository->findAll());
 }
开发者ID:sengkimlong,项目名称:flow-login,代码行数:10,代码来源:SetupController.php

示例5: initializeAction

 /**
  * Initializes the controller before invoking an action method.
  *
  */
 public function initializeAction()
 {
     if ($this->securityContext->canBeInitialized()) {
         $account = $this->securityContext->getAccount();
         $this->bearbeiterObj = $this->bearbeiterRepository->findOneByAccount($account);
     }
     $this->cacheInterface = $this->cacheManager->getCache('GermaniaSacra_GermaniaCache');
 }
开发者ID:subugoe,项目名称:germaniasacra,代码行数:12,代码来源:AbstractBaseController.php

示例6: getCurrentUser

 /**
  * Returns the currently logged in user, if any
  *
  * @return User The currently logged in user, or NULL
  */
 public function getCurrentUser()
 {
     $account = $this->securityContext->getAccount();
     if ($account === NULL) {
         return NULL;
     }
     return $this->userRepository->findOneHavingAccount($account);
 }
开发者ID:UpAssist,项目名称:Flowpack.Neos.FrontendLogin,代码行数:13,代码来源:FrontendUserService.php

示例7: getUserWorkspaceName

 /**
  * Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).
  * If no user is logged in this method returns "live".
  *
  * @return string
  */
 public function getUserWorkspaceName()
 {
     $account = $this->securityContext->getAccount();
     if ($account === NULL) {
         return 'live';
     }
     return 'user-' . preg_replace('/[^a-z0-9]/i', '', $account->getAccountIdentifier());
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:14,代码来源:UserService.php

示例8: disqusAction

 /**
  * @param string $title
  * @param string $uri
  * @param string $identifier
  */
 public function disqusAction($title, $uri, $identifier)
 {
     $this->view->assign('title', $title);
     $this->view->assign('uri', $uri);
     $this->view->assign('identifier', $identifier);
     if ($account = $this->securityContext->getAccount()) {
         $this->view->assign('remoteAuth', $this->disqusRemoteAuthService->generateDisqusRemoteAuth($account));
     }
 }
开发者ID:HofUniversityIWS,项目名称:backend,代码行数:14,代码来源:FrontendController.php

示例9: initializeAccountIdentifier

 /**
  * Try to set the current account identifier emitting the events, if possible
  *
  * @return void
  */
 protected function initializeAccountIdentifier()
 {
     if ($this->securityContext->canBeInitialized()) {
         $account = $this->securityContext->getAccount();
         if ($account !== NULL) {
             $this->eventEmittingService->setCurrentAccountIdentifier($account->getAccountIdentifier());
         }
     }
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:14,代码来源:AbstractIntegrationService.php

示例10: initializeAction

 /**
  * Initializes some basic stuff that will basically be needed for each and
  * every action that is executed later on.
  */
 public function initializeAction()
 {
     // get the account of the authenticated user
     $this->account = $this->securityContext->getAccount();
     // set the locale
     $this->locale = $this->localeDetector->detectLocaleFromLocaleTag($this->settings['defaultLanguage']);
     if ($this->l18nService->getConfiguration()->getCurrentLocale() !== $this->locale) {
         $this->l18nService->getConfiguration()->setCurrentLocale($this->locale);
     }
 }
开发者ID:yashodhank,项目名称:panel,代码行数:14,代码来源:BaseController.php

示例11: deleteAction

 /**
  * @param string $session
  */
 public function deleteAction($session)
 {
     $account = $this->securityContext->getAccount();
     /** @var \T3DD\Backend\Domain\Model\Vote $vote */
     $vote = $this->voteRepository->getVoteForAccountAndSession($session, $account);
     if (!$vote) {
         $this->response->setStatus(404);
         return;
     }
     $this->voteRepository->remove($vote);
 }
开发者ID:HofUniversityIWS,项目名称:backend,代码行数:14,代码来源:VoteController.php

示例12: authenticateAction

 /**
  * @throws \TYPO3\Flow\Security\Exception\AuthenticationRequiredException
  * @throws \TYPO3\Flow\Security\Exception\AccessDeniedException
  * @return void
  */
 public function authenticateAction()
 {
     try {
         $this->authenticationManager->authenticate();
         $account = $this->securityContext->getAccount();
         $this->redirect('index', 'Dashboard', NULL, array('user' => $account));
     } catch (\TYPO3\Flow\Security\Exception\AuthenticationRequiredException $exception) {
         $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error('Bitte die korrekten Benutzerdaten eingeben.'));
         //$this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error($exception->getMessage()));
         throw $exception;
     }
 }
开发者ID:alagocki,项目名称:druckverwaltung,代码行数:17,代码来源:LoginController.php

示例13: updateAction

 /**
  * @param Participant $participant
  */
 public function updateAction(Participant $participant)
 {
     $participantEntity = $participant->getPayload();
     if ($participantEntity->getAccount() !== NULL && $participantEntity->getAccount() !== $this->securityContext->getAccount() && !$this->securityContext->hasRole('T3DD.Backend:Administrator')) {
         $this->response->setStatus(403);
         return;
     }
     if (!$participantEntity->isCompleted()) {
         $participantEntity->setCompleted(TRUE);
         $participantEntity->setAccount($this->securityContext->getAccount());
     }
     $this->participantRepository->update($participantEntity);
     $this->view->assign('value', $participant);
 }
开发者ID:HofUniversityIWS,项目名称:backend,代码行数:17,代码来源:ParticipantController.php

示例14: initializeView

 /**
  * Initialize view action
  *
  * @param \TYPO3\Flow\Mvc\View\ViewInterface $view
  * @return void
  */
 protected function initializeView(\TYPO3\Flow\Mvc\View\ViewInterface $view)
 {
     $loggedUser = $this->securityContext->getAccount();
     $currentUrl = $this->request->getHttpRequest()->getUri();
     $view->assign('currentpage', $currentUrl);
     $view->assign('state', $this->base64UrlEncode($currentUrl));
     if ($loggedUser != NULL) {
         $view->assign('loggedInUser', $this->securityContext->getAccount()->getAccountIdentifier());
         $view->assign('currentUser', $this->securityContext->getAccount()->getParty());
     }
     $facebook_appid = $this->facebookService->getAppId();
     $facebook_redirecturi = $this->facebookService->getRedirectUri();
     $vkLoginUrl = $this->vkService->getAuthorizationUri();
     $this->view->assignMultiple(array('vk_url' => $vkLoginUrl, 'google_url' => $this->googlePlusService->getAuthorizationUri(), 'facebook_appid' => $facebook_appid, 'facebook_redirecturi' => $facebook_redirecturi));
 }
开发者ID:e-webking,项目名称:lostfound,代码行数:21,代码来源:StandardController.php

示例15: isValid

 /**
  * The given $value is valid if it is an array of format array(hash:string, phrase:string) and the hash was derived from the entered phrase
  * 
  * @param mixed $value The value that should be validated
  * @return void
  */
 protected function isValid($value)
 {
     if (!($this->options["ignoreWhenLoggedIn"] && $this->securityContext->getAccount())) {
         if (is_array($value)) {
             if (empty($value["hash"]) || empty($value["phrase"])) {
                 $this->addError("Malformed array given; expected array(hash:string, phrase:string)", 422526241);
             } else {
                 if ($this->captchaService->validatePhrase($value["phrase"], $value["hash"]) !== true) {
                     $this->addError("Given captcha phrase mismatches the hash", 422526242);
                 }
             }
         } else {
             $this->addError("This argument must be an array", 422526240);
         }
     }
 }
开发者ID:etg24,项目名称:captcha,代码行数:22,代码来源:CaptchaValidator.php


注:本文中的TYPO3\Flow\Security\Context::getAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。