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


PHP PKPRequest::getUser方法代码示例

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


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

示例1: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the section editor submission.
     $sectionEditorSubmission =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE);
     if (!is_a($sectionEditorSubmission, 'SectionEditorSubmission')) {
         return AUTHORIZATION_DENY;
     }
     // Section editors can only access submissions in their series
     // that they have been explicitly assigned to.
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($sectionEditorSubmission->getJournalId(), $sectionEditorSubmission->getSectionId());
     $foundAssignment = false;
     foreach ($sectionEditors as $sectionEditor) {
         if ($sectionEditor->getId() == $user->getId()) {
             $foundAssignment = true;
         }
     }
     if ($foundAssignment) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:31,代码来源:SectionSubmissionAssignmentPolicy.inc.php

示例2: effect

 /**
  * @copydoc AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the context
     $router = $this->_request->getRouter();
     $context = $router->getContext($this->_request);
     if (!is_a($context, 'Context')) {
         return AUTHORIZATION_DENY;
     }
     // Get the submission
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     if (!is_a($submission, 'Submission')) {
         return AUTHORIZATION_DENY;
     }
     import('lib.pkp.classes.security.authorization.internal.SectionAssignmentRule');
     if (SectionAssignmentRule::effect($context->getId(), $submission->getSectionId(), $user->getId())) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:28,代码来源:SectionAssignmentPolicy.inc.php

示例3: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the press
     $router = $this->_request->getRouter();
     $press = $router->getContext($this->_request);
     if (!is_a($press, 'Press')) {
         return AUTHORIZATION_DENY;
     }
     // Get the monograph
     $monograph = $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     if (!is_a($monograph, 'Monograph')) {
         return AUTHORIZATION_DENY;
     }
     import('classes.security.authorization.internal.SeriesAssignmentRule');
     if (SeriesAssignmentRule::effect($press->getId(), $monograph->getSeriesId(), $user->getId())) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:austinvernsonger,项目名称:omp,代码行数:28,代码来源:SeriesAssignmentPolicy.inc.php

示例4: effect

 /**
  * @copydoc AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the journal
     $router = $this->_request->getRouter();
     $context = $router->getContext($this->_request);
     if (!is_a($context, 'Journal')) {
         return AUTHORIZATION_DENY;
     }
     // Get the article
     $article = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     if (!is_a($article, 'Article')) {
         return AUTHORIZATION_DENY;
     }
     import('classes.security.authorization.internal.SectionAssignmentRule');
     if (SectionAssignmentRule::effect($context->getId(), $article->getSectionId(), $user->getId())) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:jalperin,项目名称:ojs,代码行数:28,代码来源:SectionAssignmentPolicy.inc.php

示例5: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the press
     $router =& $this->_request->getRouter();
     $press =& $router->getContext($this->_request);
     if (!is_a($press, 'Press')) {
         return AUTHORIZATION_DENY;
     }
     // Get the monograph
     $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     if (!is_a($monograph, 'Monograph')) {
         return AUTHORIZATION_DENY;
     }
     // Series editors can access all submissions in their series.
     // Even those they've not been explicitly assigned to.
     $seriesEditorsDao =& DAORegistry::getDAO('SeriesEditorsDAO');
     if ($seriesEditorDao->editorExists($press->getId(), $monograph->getSeriesId(), $user->getId())) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:30,代码来源:SeriesAssignmentPolicy.inc.php

示例6: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the copyeditor submission
     $copyeditorSubmission =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE);
     if (!is_a($copyeditorSubmission, 'CopyeditorSubmission')) {
         return AUTHORIZATION_DENY;
     }
     // Copyeditors can only access submissions
     // they have been explicitly assigned to.
     if ($copyeditorSubmission->getUserIdBySignoffType('SIGNOFF_COPYEDITING_INITIAL') != $user->getId()) {
         return AUTHORIZATION_DENY;
     }
     return AUTHORIZATION_PERMIT;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:22,代码来源:CopyeditorSubmissionAssignmentPolicy.inc.php

示例7: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the submission
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     if (!is_a($submission, 'Submission')) {
         return AUTHORIZATION_DENY;
     }
     // Check authorship of the submission.
     if ($submission->getUserId() === $user->getId()) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:22,代码来源:SubmissionAuthorPolicy.inc.php

示例8: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the monograph
     $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     if (!is_a($monograph, 'Monograph')) {
         return AUTHORIZATION_DENY;
     }
     // Check authorship of the monograph.
     if ($monograph->getUserId() === $user->getId()) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:22,代码来源:MonographAuthorPolicy.inc.php

示例9: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // A signoff should already be in the context.
     $signoff = $this->getAuthorizedContextObject(ASSOC_TYPE_SIGNOFF);
     if (!is_a($signoff, 'Signoff')) {
         return AUTHORIZATION_DENY;
     }
     // Check that there is a currently logged in user.
     $user = $this->_request->getUser();
     if (!is_a($user, 'User')) {
         return AUTHORIZATION_DENY;
     }
     // Check if the signoff is assigned to the user.
     if ($signoff->getUserId() == $user->getId()) {
         return AUTHORIZATION_PERMIT;
     }
     // Otherwise, deny.
     return AUTHORIZATION_DENY;
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:22,代码来源:SignoffAssignedToUserAccessPolicy.inc.php

示例10: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // A query should already be in the context.
     $query = $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);
     if (!is_a($query, 'Query')) {
         return AUTHORIZATION_DENY;
     }
     // Check that there is a currently logged in user.
     $user = $this->_request->getUser();
     if (!is_a($user, 'User')) {
         return AUTHORIZATION_DENY;
     }
     // Determine if the query is assigned to the user.
     $queryDao = DAORegistry::getDAO('QueryDAO');
     if ($queryDao->getParticipantIds($query->getId(), $user->getId())) {
         return AUTHORIZATION_PERMIT;
     }
     // Otherwise, deny.
     return AUTHORIZATION_DENY;
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:23,代码来源:QueryAssignedToUserAccessPolicy.inc.php

示例11: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the section editor submission.
     $sectionEditorSubmission =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE);
     if (!is_a($sectionEditorSubmission, 'SectionEditorSubmission')) {
         return AUTHORIZATION_DENY;
     }
     // Section editors can only access submissions in their series
     // that they have been explicitly assigned to.
     // 1) Retrieve the edit assignments
     $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
     $editAssignments =& $editAssignmentDao->getEditAssignmentsByArticleId($sectionEditorSubmission->getId());
     if (!is_a($editAssignments, 'DAOResultFactory')) {
         return AUTHORIZATION_DENY;
     }
     $editAssignmentsArray =& $editAssignments->toArray();
     // 2) Check whether the user is the article's editor,
     //    otherwise deny access.
     $foundAssignment = false;
     foreach ($editAssignmentsArray as $editAssignment) {
         if ($editAssignment->getEditorId() == $user->getId()) {
             if ($editAssignment->getCanEdit()) {
                 $foundAssignment = true;
             }
             break;
         }
     }
     if ($foundAssignment) {
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:41,代码来源:SectionSubmissionAssignmentPolicy.inc.php

示例12: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user =& $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the monograph
     $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     if (!is_a($monograph, 'Monograph')) {
         return AUTHORIZATION_DENY;
     }
     // Check if a review assignment exists between the submission and the user
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     /* @var $reviewAssignmentDao ReviewAssignmentDAO */
     $reviewAssignment =& $reviewAssignmentDao->getReviewAssignment($monograph->getId(), $user->getId(), $monograph->getCurrentRound());
     if (is_a($reviewAssignment, 'ReviewAssignment')) {
         // Save the review assignment to the authorization context.
         $this->addAuthorizedContextObject(ASSOC_TYPE_REVIEW_ASSIGNMENT, $reviewAssignment);
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:27,代码来源:ReviewAssignmentAccessPolicy.inc.php

示例13: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the submission
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     if (!is_a($submission, 'Submission')) {
         return AUTHORIZATION_DENY;
     }
     // Check authorship of the submission. Any ROLE_ID_AUTHOR assignment will do.
     $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     $submitterAssignments = $stageAssignmentDao->getBySubmissionAndStageId($submission->getId(), null, null, $user->getId());
     while ($assignment = $submitterAssignments->next()) {
         $userGroup = $userGroupDao->getById($assignment->getUserGroupId());
         if ($userGroup->getRoleId() == ROLE_ID_AUTHOR) {
             return AUTHORIZATION_PERMIT;
         }
     }
     return AUTHORIZATION_DENY;
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:27,代码来源:SubmissionAuthorPolicy.inc.php

示例14: effect

 /**
  * @see AuthorizationPolicy::effect()
  */
 function effect()
 {
     // Get the user
     $user = $this->_request->getUser();
     if (!is_a($user, 'PKPUser')) {
         return AUTHORIZATION_DENY;
     }
     // Get the submission
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     if (!is_a($submission, 'Submission')) {
         return AUTHORIZATION_DENY;
     }
     // Check if a review assignment exists between the submission and the user
     $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
     /* @var $reviewAssignmentDao ReviewAssignmentDAO */
     $reviewAssignment = $reviewAssignmentDao->getLastReviewRoundReviewAssignmentByReviewer($submission->getId(), $user->getId());
     if (is_a($reviewAssignment, 'ReviewAssignment')) {
         // Save the review assignment to the authorization context.
         $this->addAuthorizedContextObject(ASSOC_TYPE_REVIEW_ASSIGNMENT, $reviewAssignment);
         return AUTHORIZATION_PERMIT;
     } else {
         return AUTHORIZATION_DENY;
     }
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:27,代码来源:ReviewAssignmentAccessPolicy.inc.php

示例15: allowedToCreateUser

 /**
  * Determines whether the current user can create user accounts from authors present
  * in the grid.
  * @param PKPRequest $request
  * @return boolean
  */
 function allowedToCreateUser($request)
 {
     $submission = $this->getSubmission();
     $user = $request->getUser();
     $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     $stageAssignments = $stageAssignmentDao->getBySubmissionAndStageId($submission->getId(), $submission->getStageId(), null, $user->getId());
     while ($stageAssignment = $stageAssignments->next()) {
         $userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId());
         if (in_array($userGroup->getRoleId(), array(ROLE_ID_MANAGER, ROLE_ID_EDITOR))) {
             return true;
             break;
         }
     }
     return false;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:22,代码来源:AuthorGridRow.inc.php


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