當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tracker::userIsAdmin方法代碼示例

本文整理匯總了PHP中Tracker::userIsAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracker::userIsAdmin方法的具體用法?PHP Tracker::userIsAdmin怎麽用?PHP Tracker::userIsAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tracker的用法示例。


在下文中一共展示了Tracker::userIsAdmin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateArtifacts

 public function updateArtifacts(PFUser $user, Codendi_Request $request)
 {
     if ($this->tracker->userIsAdmin($user)) {
         $masschange_aids = $request->get('masschange_aids');
         if (empty($masschange_aids)) {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_masschange_detail', 'no_items_selected'));
             $GLOBALS['Response']->redirect(TRACKER_BASE_URL . '/?tracker=' . $this->tracker->getId());
         }
         $unsubscribe = $request->get('masschange-unsubscribe-option');
         if ($unsubscribe) {
             $this->unsubscribeUserFromEachArtifactNotification($user, $request, $masschange_aids);
         }
         $send_notifications = $this->getSendNotificationsFromRequest($request);
         $masschange_data = $request->get('artifact');
         if (!$unsubscribe && empty($masschange_data)) {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_masschange_detail', 'no_items_selected'));
             $GLOBALS['Response']->redirect(TRACKER_BASE_URL . '/?tracker=' . $this->tracker->getId());
         }
         $comment = $request->get('artifact_masschange_followup_comment');
         $masschange_values_extractor = new Tracker_MasschangeDataValueExtractor();
         $new_fields_data = $masschange_values_extractor->getNewValues($masschange_data);
         if (count($new_fields_data) > 0 || $comment !== '') {
             $comment_format = $request->get('comment_formatmass_change');
             $this->tracker->updateArtifactsMasschange($user, $masschange_aids, $new_fields_data, $comment, $send_notifications, $comment_format);
         }
         $GLOBALS['Response']->redirect(TRACKER_BASE_URL . '/?tracker=' . $this->tracker->getId());
     } else {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin', 'access_denied'));
         $GLOBALS['Response']->redirect(TRACKER_BASE_URL . '/?tracker=' . $this->tracker_report->getId());
     }
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:31,代碼來源:MasschangeUpdater.class.php

示例2: userCanViewTracker

 public function userCanViewTracker(PFUser $user, Tracker $tracker)
 {
     if ($user->isSuperUser()) {
         return true;
     }
     if ($tracker->userIsAdmin($user)) {
         return true;
     }
     $project = $tracker->getProject();
     if ($this->userIsRestrictedAndNotMemberOfProject($user, $project) || $this->userIsNotMemberOfPrivateProject($user, $project)) {
         return false;
     }
     foreach ($tracker->getPermissionsByUgroupId() as $ugroup_id => $permission_types) {
         if ($user->isMemberOfUGroup($ugroup_id, $tracker->getGroupId())) {
             return true;
         }
     }
     return false;
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:19,代碼來源:PermissionChecker.class.php


注:本文中的Tracker::userIsAdmin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。