/**
  * @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 authorized monograph.
     $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
     if (!is_a($monograph, 'Monograph')) {
         return AUTHORIZATION_DENY;
     }
     // Check whether a valid workflow stage has been defined for this policy.
     if ($this->_stageId < WORKFLOW_STAGE_ID_SUBMISSION || $this->_stageId > WORKFLOW_STAGE_ID_PRODUCTION) {
         return AUTHORIZATION_DENY;
     }
     // Get the authorized user group.
     $userGroup = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_GROUP);
     if (!is_a($userGroup, 'UserGroup')) {
         return AUTHORIZATION_DENY;
     }
     // Check whether the user is assigned to the submission in
     // the current user group for the given workflow step.
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     if (!$signoffDao->signoffExists('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monograph->getId(), $user->getId(), $this->_stageId, $userGroup->getId())) {
         return AUTHORIZATION_DENY;
     }
     // Access has been authorized.
     return AUTHORIZATION_PERMIT;
 }
 /**
  * Display terms of use for Dataverse configured for journal.
  * @param array $args
  * @param Request $request
  */
 function termsOfUse($args, &$request)
 {
     $router =& $request->getRouter();
     $journal =& $router->getContext($request);
     $dataversePlugin =& PluginRegistry::getPlugin('generic', DATAVERSE_PLUGIN_NAME);
     $templateMgr =& TemplateManager::getManager();
     if ($dataversePlugin->getSetting($journal->getId(), 'fetchTermsOfUse')) {
         // Try fetching terms of use from DV. If not available, use DV terms cached on last fetch
         $termsOfUse = $dataversePlugin->getTermsOfUse();
         $templateMgr->assign('termsOfUse', $termsOfUse ? $termsOfUse : $this->getSetting($journal->getId(), 'dvTermsOfUse'));
     } else {
         // Get terms of use configured by JM
         $templateMgr->assign('termsOfUse', $dataversePlugin->getSetting($journal->getId(), 'termsOfUse'));
     }
     $templateMgr->display($dataversePlugin->getTemplatePath() . '/termsOfUse.tpl');
 }
Example #3
0
            $file = $pathArr[1];
            $classFile = WEBROOT . "/{$dir}/{$file}.php";
            if (is_file($classFile) && !class_exists($class)) {
                require $classFile;
                return true;
            }
        }
        //lib
        $classFile = __DIR__ . "/lib/{$class}.class.php";
        if (is_file($classFile) && !class_exists($class)) {
            require $classFile;
            return true;
        }
    }
}
spl_autoload_register('classAutoLoader');
#全局变量
try {
    #获取路由
    $objRequest = new Request();
    $routerArr = $objRequest->getRouter();
    #处理路由,解析action
    $controller = $routerArr['controller'];
    $uri = $routerArr['uri'];
    $class = "Controller_{$controller}";
    $objCntl = new $class();
    $objCntl->parseAction($uri);
    #其他
} catch (AcaciaException $e) {
    Common::dump("Sys Error ,msg: " . $e->getMessage());
}