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


PHP UserManager::getCurrentUser方法代码示例

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


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

示例1: continueSession

 /**
  *
  * @see session_continue
  * 
  * @param String $session_key
  * 
  * @return User
  */
 public function continueSession($session_key)
 {
     $user = $this->user_manager->getCurrentUser($session_key);
     if ($user->isLoggedIn()) {
         return $user;
     }
     throw new Exception('Invalid session', '3001');
 }
开发者ID:nterray,项目名称:tuleap,代码行数:16,代码来源:SOAP_RequestValidator.class.php

示例2: askForMigration

 /**
  * Launch the migration of a TV3 to a TV5
  *
  * @param Project $project
  * @param $tracker_id
  * @param $name
  * @param $description
  * @param $short_name
  *
  * @return bool true if everything seems right
  */
 public function askForMigration(Project $project, $tracker_id, $name, $description, $short_name)
 {
     if (!$this->tracker_factory->validMandatoryInfoOnCreate($name, $description, $short_name, $project->getGroupId())) {
         return false;
     }
     $this->system_event_manager->queueTV3Migration($this->user_manager->getCurrentUser(), $project, $tracker_id, $name, $description, $short_name);
     return true;
 }
开发者ID:ndjido,项目名称:tuleap,代码行数:19,代码来源:MigrationManager.php

示例3: continueSession

 /**
  *
  * @see session_continue
  * 
  * @param String $sessionKey
  * 
  * @return User
  */
 private function continueSession($sessionKey)
 {
     $user = $this->userManager->getCurrentUser($sessionKey);
     if ($user->isLoggedIn()) {
         return $user;
     }
     throw new SoapFault('3001', 'Invalid session');
 }
开发者ID:nterray,项目名称:tuleap,代码行数:16,代码来源:User_SOAPServer.class.php

示例4: request

 public function request()
 {
     $valid = new Valid_String('repo_name');
     $valid->required();
     $repositoryName = null;
     if ($this->request->valid($valid)) {
         $repositoryName = trim($this->request->get('repo_name'));
     }
     $valid = new Valid_UInt('repo_id');
     $valid->required();
     if ($this->request->valid($valid)) {
         $repoId = $this->request->get('repo_id');
     } else {
         $repoId = 0;
     }
     $user = $this->userManager->getCurrentUser();
     //define access permissions
     $this->definePermittedActions($repoId, $user);
     //check permissions
     if (empty($this->permittedActions) || !$this->isAPermittedAction($this->action)) {
         $this->addError($this->getText('controller_access_denied'));
         $this->redirect('/plugins/git/?group_id=' . $this->groupId);
         return;
     }
     $this->_informAboutPendingEvents($repoId);
     $this->_dispatchActionAndView($this->action, $repoId, $repositoryName, $user);
 }
开发者ID:LouisRenWeiWei,项目名称:tuleap,代码行数:27,代码来源:Git.class.php

示例5: logPriorityChange

 private function logPriorityChange($moved_artifact_id, $artifact_higher_id, $artifact_lower_id, $context_id, $project_id, $old_global_rank)
 {
     $artifact = $this->tracker_artifact_factory->getArtifactById($moved_artifact_id);
     if ($artifact) {
         $tracker = $artifact->getTracker();
         if ($tracker && $tracker->arePriorityChangesShown()) {
             $this->priority_history_dao->logPriorityChange($moved_artifact_id, $artifact_higher_id, $artifact_lower_id, $context_id, $project_id, $this->user_manager->getCurrentUser()->getId(), time(), $old_global_rank);
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:Tracker_Artifact_PriorityManager.class.php

示例6: filterOnProjectIds

 private function filterOnProjectIds(array &$project_filter, array $group_ids)
 {
     foreach ($group_ids as $group_id) {
         if ($group_id === ElasticSearch_SearchResultProjectsFacetCollection::USER_PROJECTS_IDS_KEY) {
             $this->filterOnProjectIds($project_filter, $this->user_manager->getCurrentUser()->getProjects());
             return;
         }
         $project_filter[] = array('term' => array('group_id' => (int) $group_id));
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:SearchClientFacade.class.php

示例7: getSearchResults

 public function getSearchResults(array $result)
 {
     $results = array();
     $validator = new ElasticSearch_1_2_ResultValidator();
     if (!isset($result['hits']['hits'])) {
         return $results;
     }
     $user = $this->user_manager->getCurrentUser();
     foreach ($result['hits']['hits'] as $hit) {
         $project = $this->project_manager->getProject($this->extractGroupIdFromHit($hit));
         $index = $this->extractIndexFromHit($hit);
         if ($project->isError()) {
             continue;
         }
         try {
             $this->url_verification->userCanAccessProject($user, $project);
         } catch (Project_AccessPrivateException $exception) {
             continue;
         }
         switch ($index) {
             case fulltextsearchPlugin::SEARCH_DOCMAN_TYPE:
                 if (!$validator->isDocmanResultValid($hit)) {
                     continue;
                 }
                 $results[] = new ElasticSearch_SearchResultDocman($hit, $project);
                 break;
             case fulltextsearchPlugin::SEARCH_WIKI_TYPE:
                 if (!$validator->isWikiResultValid($hit)) {
                     continue;
                 }
                 $wiki = new Wiki($project->getID());
                 if ($wiki->isAutorized($user->getId())) {
                     $results[] = new ElasticSearch_SearchResultWiki($hit, $project);
                 }
                 break;
             case fulltextsearchPlugin::SEARCH_TRACKER_TYPE:
                 if (!$validator->isArtifactResultValid($hit)) {
                     continue;
                 }
                 $artifact = Tracker_ArtifactFactory::instance()->getArtifactById($hit['fields']['id'][0]);
                 if ($artifact->userCanView($user)) {
                     $results[] = new ElasticSearch_SearchResultTracker($hit, $project, $artifact);
                 }
                 break;
             default:
         }
     }
     return $results;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:49,代码来源:ResultFactory.class.php

示例8: getMilestoneContentItems

 private function getMilestoneContentItems()
 {
     $backlog_item_collection_factory = new AgileDashboard_Milestone_Backlog_BacklogItemCollectionFactory(new AgileDashboard_BacklogItemDao(), $this->artifact_factory, $this->tracker_form_element_factory, $this->milestone_factory, $this->planning_factory, new AgileDashboard_Milestone_Backlog_BacklogItemBuilder());
     $strategy_factory = new AgileDashboard_Milestone_Backlog_BacklogStrategyFactory(new AgileDashboard_BacklogItemDao(), $this->artifact_factory, $this->planning_factory);
     return $backlog_item_collection_factory->getAllCollection($this->user_manager->getCurrentUser(), $this->milestone, $strategy_factory->getSelfBacklogStrategy($this->milestone), '');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:Pane.class.php

示例9: setCurrentUserIfUserIsNotDefined

 private function setCurrentUserIfUserIsNotDefined(&$user)
 {
     if (!isset($user)) {
         $user = $this->user_manager->getCurrentUser();
     }
 }
开发者ID:amanikamail,项目名称:tuleap,代码行数:6,代码来源:Tracker_Artifact_ChangesetValue_ArtifactLink.class.php

示例10: __construct

 public function __construct(UserManager $user_manager, Codendi_Request $request)
 {
     $this->user = $user_manager->getCurrentUser();
     $this->request = $request;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:5,代码来源:PluginController.class.php


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