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


PHP PFUser类代码示例

本文整理汇总了PHP中PFUser的典型用法代码示例。如果您正苦于以下问题:PHP PFUser类的具体用法?PHP PFUser怎么用?PHP PFUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: checkUserIsSiteadmin

 private function checkUserIsSiteadmin(PFUser $user, Response $response)
 {
     if (!$user->isSuperUser()) {
         $response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'perm_denied'));
         $response->redirect('/');
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:TrackerPluginConfigRouter.php

示例2: generateTokenForUser

 /**
  * @return Rest_Token
  */
 public function generateTokenForUser(PFUser $user)
 {
     $number_generator = new RandomNumberGenerator();
     $token = $number_generator->getNumber();
     $this->token_dao->addTokenForUserId($user->getId(), $token, $_SERVER['REQUEST_TIME']);
     return new Rest_Token($user->getId(), $token);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:TokenManager.class.php

示例3: __construct

 public function __construct(PFUser $user)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $user_name = $hp->purify($user->getRealName());
     $steps = array(new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'welcome_title'), $GLOBALS['Language']->getText('my_tour', 'welcome', $user_name)), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'my_personal_page_title'), $GLOBALS['Language']->getText('my_tour', 'my_personal_page'), 'bottom', 'ul.nav > li:first-child'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'projects_title'), $GLOBALS['Language']->getText('my_tour', 'projects'), 'bottom', 'ul.nav > li.projects-nav'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'help_title'), $GLOBALS['Language']->getText('my_tour', 'help'), 'bottom', 'ul.nav > li.help-nav'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'search_title'), $GLOBALS['Language']->getText('my_tour', 'search'), 'bottom', 'ul.nav.pull-right > form'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'user_menu_title'), $GLOBALS['Language']->getText('my_tour', 'user_menu'), 'bottom', 'ul.nav.pull-right > li.user-menu'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'end_tour_title'), $GLOBALS['Language']->getText('my_tour', 'end_tour')));
     parent::__construct(self::TOUR_NAME, $steps);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:WelcomeTour.class.php

示例4: addUserAsProjectAdmin

 public function addUserAsProjectAdmin(Project $project, PFUser $user)
 {
     $project_id = $this->da->escapeInt($project->getId());
     $user_id = $this->da->escapeInt($user->getId());
     $sql = "UPDATE user_group\n                SET admin_flags = 'A'\n                WHERE group_id = {$project_id}\n                  AND user_id = {$user_id}";
     return $this->update($sql);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:UserPermissionsDao.class.php

示例5: __construct

 public function __construct(PFUser $current_user, Project $project, $milestone_id)
 {
     $this->user_id = $current_user->getId();
     $this->lang = $this->getLanguageAbbreviation($current_user);
     $this->project_id = $project->getId();
     $this->milestone_id = $milestone_id;
     $this->view_mode = $current_user->getPreference('agiledashboard_planning_item_view_mode_' . $this->project_id);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:8,代码来源:PlanningV2Presenter.class.php

示例6: userPasswordHasExpired

 private function userPasswordHasExpired(PFUser $user)
 {
     $expiration_date = $this->getPasswordExpirationDate();
     if ($expiration_date && $user->getLastPwdUpdate() < $expiration_date) {
         return true;
     }
     return false;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:PasswordExpirationChecker.class.php

示例7: __construct

 public function __construct(Project $project, PFUser $pfuser, $suffix)
 {
     parent::__construct($pfuser->toRow());
     $this->setStatus(PFUser::STATUS_RESTRICTED);
     $this->setRealName(self::REAL_NAME);
     $this->setUserName(self::NAME_PREFIX . $project->getUnixName() . $suffix);
     $this->project = $project;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:GenericUser.class.php

示例8: removePair

 /**
  * Remove all pair done with user account
  */
 public function removePair(PFUser $user)
 {
     $user_id = $user->getId();
     $dar = $this->dao->searchOpenidUrlsForUserId($user_id);
     if ($dar->count()) {
         $row = $dar->getRow();
         $this->dao->removeConnexionStringForUserId($row['connexion_string'], $user_id);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:AccountManager.class.php

示例9: getDispatchableFromRequest

 /**
  * Return the Tracker object that correspond to the given request
  *
  * @param Codendi_Request $request The request
  * @param PFUser            $user    Who access the request
  * 
  * @return Tracker_Dispatchable_Interface
  */
 function getDispatchableFromRequest(Codendi_Request $request, PFUser $user)
 {
     if ((int) $request->get('aid')) {
         if ($artifact = $this->getArtifactFactory()->getArtifactByid($request->get('aid'))) {
             return $artifact;
         } else {
             throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
         }
     } else {
         if ((int) $request->get('report')) {
             $store_in_session = true;
             if ($request->exist('store_in_session')) {
                 $store_in_session = (bool) $request->get('store_in_session');
             }
             if ($report = $this->getArtifactReportFactory()->getReportById($request->get('report'), $user->getId(), $store_in_session)) {
                 return $report;
             } else {
                 throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'report_not_exist'));
             }
         } else {
             if ((int) $request->get('tracker') || (int) $request->get('atid')) {
                 $tracker_id = (int) $request->get('tracker');
                 if (!$tracker_id) {
                     $tracker_id = (int) $request->get('atid');
                 }
                 if ($tracker = $this->getTrackerFactory()->getTrackerByid($tracker_id)) {
                     return $tracker;
                 } else {
                     throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'tracker_not_exist'));
                 }
             } else {
                 if ((int) $request->get('formElement')) {
                     if ($formElement = $this->getTracker_FormElementFactory()->getFormElementByid($request->get('formElement'))) {
                         return $formElement;
                     }
                 } else {
                     if ($request->get('func') == 'new-artifact-link') {
                         if ($artifact = Tracker_ArtifactFactory::instance()->getArtifactByid($request->get('id'))) {
                             return $artifact;
                         } else {
                             throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
                         }
                     } else {
                         if ((int) $request->get('link-artifact-id')) {
                             if ($artifact = Tracker_ArtifactFactory::instance()->getArtifactByid($request->get('link-artifact-id'))) {
                                 return $artifact;
                             } else {
                                 throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
                             }
                         }
                     }
                 }
             }
         }
     }
     throw new Tracker_NoMachingResourceException();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:65,代码来源:Tracker_URL.class.php

示例10: createArtifact

 private function createArtifact(PFUser $current_user)
 {
     $email = null;
     if ($current_user->isAnonymous()) {
         $email = $this->request->get('email');
     }
     $fields_data = $this->request->get('artifact');
     $this->tracker->augmentDataFromRequest($fields_data);
     return $this->tracker_artifact_factory->createArtifact($this->tracker, $fields_data, $current_user, $email);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:CreateArtifactFromModal.class.php

示例11: notifyOnDisable

 /**
  * Send a mail when PDF Watermarking is disabled.
  * 
  * @param Docman_Item $item
  * @param PFUser        $currentUser
  * 
  * @return void
  */
 public function notifyOnDisable($item, $currentUser, $defaultUrl)
 {
     $admins = $this->getPeopleToNotifyWhenWatermarkingIsDisabled($item);
     $link = get_server_url() . $defaultUrl . '&action=details&id=' . $item->getId();
     $mail = new Mail();
     $mail->setTo(implode(',', $admins));
     $mail->setSubject($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_subject', array($item->getTitle())));
     $mail->setBody($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_body', array($item->getTitle(), $currentUser->getRealname(), $link)));
     $mail->send();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:18,代码来源:DocmanWatermark_ItemFactory.class.php

示例12: exportUser

 public function exportUser(PFUser $user, SimpleXMLElement $members_node, $child_name)
 {
     if ($user->getLdapId()) {
         $member_node = $members_node->addChild($child_name, $user->getLdapId());
         $member_node->addAttribute('format', 'ldap');
     } else {
         $member_node = $members_node->addChild($child_name, $user->getUserName());
         $member_node->addAttribute('format', 'username');
     }
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:10,代码来源:UserXMLExporter.class.php

示例13: createArtifact

 /**
  * Add an artefact in the tracker
  *
  * @param Tracker_IDisplayTrackerLayout  $layout
  * @param Codendi_Request                $request
  * @param PFUser                         $user
  *
  * @return Tracker_Artifact the new artifact
  */
 private function createArtifact(Tracker_IDisplayTrackerLayout $layout, $request, $user)
 {
     $email = null;
     if ($user->isAnonymous()) {
         $email = $request->get('email');
     }
     $fields_data = $request->get('artifact');
     $this->tracker->augmentDataFromRequest($fields_data);
     return $this->artifact_factory->createArtifact($this->tracker, $fields_data, $user, $email);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:19,代码来源:CreateArtifact.class.php

示例14: getVariantForUser

 public function getVariantForUser(PFUser $user)
 {
     $variant = $user->getPreference(self::PREFERENCE_NAME);
     if (!$variant) {
         return $this->default;
     }
     if (!$this->isAllowed($variant)) {
         return $this->default;
     }
     return $variant;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:ThemeVariant.class.php

示例15: __construct

 public function __construct(PFUser $current_user, Project $project, $milestone_id, $milestone_representation, $paginated_backlog_items_representations, $paginated_milestones_representations)
 {
     $this->user_id = $current_user->getId();
     $this->lang = $this->getLanguageAbbreviation($current_user);
     $this->project_id = $project->getId();
     $this->milestone_id = $milestone_id;
     $this->view_mode = $current_user->getPreference('agiledashboard_planning_item_view_mode_' . $this->project_id);
     $this->milestone_representation = json_encode($milestone_representation);
     $this->paginated_backlog_items_representations = json_encode($paginated_backlog_items_representations);
     $this->paginated_milestones_representations = json_encode($paginated_milestones_representations);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:PlanningV2Presenter.class.php


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