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


PHP PFUser::getId方法代码示例

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


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

示例1: 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

示例2: account_add_user_obj_to_group

/**
 * Add a new user into a given project
 * 
 * @param Integer $group_id Project id
 * @param PFUser    $user     User to add
 * 
 * @return Boolean
 */
function account_add_user_obj_to_group($group_id, PFUser $user)
{
    //user was found but if it's a pending account adding
    //is not allowed
    if (!$user->isActive() && !$user->isRestricted()) {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_account', 'account_notactive', $user->getUserName()));
        return false;
    }
    //if not already a member, add it
    $res_member = db_query("SELECT user_id FROM user_group WHERE user_id=" . $user->getId() . " AND group_id='" . db_ei($group_id) . "'");
    if (db_numrows($res_member) < 1) {
        //not already a member
        db_query("INSERT INTO user_group (user_id,group_id) VALUES (" . db_ei($user->getId()) . "," . db_ei($group_id) . ")");
        //if no unix account, give them a unix_uid
        if ($user->getUnixStatus() == 'N' || !$user->getUnixUid()) {
            $user->setUnixStatus('A');
            $um = UserManager::instance();
            $um->assignNextUnixUid($user);
            $um->updateDb($user);
        }
        // Raise an event
        $em = EventManager::instance();
        $em->processEvent('project_admin_add_user', array('group_id' => $group_id, 'user_id' => $user->getId(), 'user_unix_name' => $user->getUserName()));
        $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('include_account', 'user_added'));
        account_send_add_user_to_group_email($group_id, $user->getId());
        group_add_history('added_user', $user->getUserName(), $group_id, array($user->getUserName()));
        return true;
    } else {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_account', 'user_already_member'));
    }
    return false;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:40,代码来源:account.php

示例3: 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

示例4: __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

示例5: createChangesetId

 private function createChangesetId(Tracker_Artifact $artifact, PFUser $submitter, $submitted_on)
 {
     $email = null;
     if ($submitter->isAnonymous()) {
         $email = $submitter->getEmail();
     }
     return $this->changeset_dao->create($artifact->getId(), $submitter->getId(), $email, $submitted_on);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:InitialChangesetCreatorBase.class.php

示例6: 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

示例7: 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

示例8: addUserDeletionForecastDate

 /**
  * Add forecast date for suspended user
  *
  * @param PFUser user
  *
  */
 public function addUserDeletionForecastDate(PFUser $user)
 {
     $directoryCleanUpDao = $this->getLDAPDirectoryCleanUpDao();
     $deletionDate = $_SERVER['REQUEST_TIME'] + $this->retentionPeriod * 24 * 60 * 60;
     $creationResult = $directoryCleanUpDao->createForecastDeletionDate($user->getId(), $deletionDate);
     if (!$creationResult) {
         $this->getBackendLogger()->error("[LDAP Clean Up] Error when adding forecast deletion date to user " . $user->getUserName());
     } else {
         $this->getBackendLogger()->info("[LDAP Clean Up] Forecast deletion date added to user  " . $user->getUserName());
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:LDAP_CleanUpManager.class.php

示例9: __construct

 public function __construct(PFUser $owner, $id, $url, $hostname, $name)
 {
     $this->id = $id;
     $this->url = $url;
     $this->hostname = $hostname;
     $this->owner = $owner;
     $this->name = $name;
     $this->ssh_key = $owner->getAuthorizedKeysRaw() ? $owner->getAuthorizedKeysRaw() : '';
     $this->owner_name = $owner->getName();
     $this->owner_id = $owner->getId();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:Mirror.class.php

示例10: __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

示例11: userIsGitAdmin

 public function userIsGitAdmin(PFUser $user, Project $project)
 {
     $database_result = $this->getCurrentGitAdminPermissionsForProject($project);
     if (db_numrows($database_result) < 1) {
         $database_result = $this->getDefaultGitAdminPermissions();
     }
     $has_permission = false;
     while (!$has_permission && ($row = db_fetch_array($database_result))) {
         $has_permission = ugroup_user_is_member($user->getId(), $row['ugroup_id'], $project->getID());
     }
     return $has_permission;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:GitPermissionsManager.class.php

示例12: update

 public function update(Tracker $tracker, SimpleXMLElement $artifact_xml, array $submitted_values, PFUser $user, $submitted_on)
 {
     $artifact_xml->changeset->submitted_on = date('c', $submitted_on);
     $artifact_xml->changeset->submitted_by = $user->getId();
     foreach ($artifact_xml->changeset->field_change as $field_change) {
         $field_name = (string) $field_change['field_name'];
         $field = $this->formelement_factory->getUsedFieldByNameForUser($tracker->getId(), $field_name, $user);
         if ($field && isset($submitted_values[$field->getId()])) {
             $submitted_value = $submitted_values[$field->getId()];
             $this->visitor->update($field_change, $field, $submitted_value);
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:ChangesetXMLUpdater.class.php

示例13: getPaginatedUserPages

 /** @return PaginatedWikiPages */
 public function getPaginatedUserPages(PFUser $user, $project_id, $limit, $offset, $pagename)
 {
     $pages = array();
     if ($pagename !== '') {
         $row_pages = $this->dao->searchPaginatedUserWikiPagesByPagename($project_id, $limit, $offset, $pagename);
     } else {
         $row_pages = $this->dao->searchPaginatedUserWikiPages($project_id, $limit, $offset);
     }
     foreach ($row_pages as $page) {
         $wiki_page = new PHPWikiPage($project_id, $page['pagename']);
         if ($wiki_page->isAutorized($user->getId())) {
             $pages[] = $wiki_page;
         }
     }
     return new PaginatedPHPWikiPages($pages);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:PaginatedPHPWikiPagesFactory.class.php

示例14: displayHeader

 public function displayHeader(Tracker_IFetchTrackerSwitcher $layout, Codendi_Request $request, PFUser $current_user, Tracker_Report $report, $report_can_be_modified)
 {
     $link_artifact_id = (int) $request->get('link-artifact-id');
     if ($report_can_be_modified) {
         $title = '';
         $breadcrumbs = array();
         $params = array('body_class' => array('in_tracker_report'));
         $toolbar = null;
         $report->getTracker()->displayHeader($layout, $title, $breadcrumbs, $toolbar, $params);
     }
     if ($request->get('pv')) {
         return;
     }
     $reports = $this->report_factory->getReportsByTrackerId($report->tracker_id, $current_user->getId());
     if ($link_artifact_id) {
         $this->displayHeaderInArtifactLinkModal($layout, $request, $current_user, $report, $reports, $link_artifact_id);
     } else {
         $this->displayHeaderInReport($request, $current_user, $report, $reports, $report_can_be_modified);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:Tracker_Report_HeaderRenderer.php

示例15: getUserTemporaryFilePrefix

 private function getUserTemporaryFilePrefix()
 {
     return self::TEMP_FILE_PREFIX . $this->user->getId() . '_';
 }
开发者ID:magarnier,项目名称:tuleap,代码行数:4,代码来源:TemporaryFileManager.class.php


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