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


PHP Validation::isSiteAdmin方法代码示例

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


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

示例1: display

 /**
  * Display the form.
  * @param $request Request
  */
 function display($request)
 {
     $canOnlyRead = true;
     $canOnlyReview = false;
     if (Validation::isReviewer()) {
         $canOnlyRead = false;
         $canOnlyReview = true;
     }
     if (Validation::isSiteAdmin() || Validation::isJournalManager() || Validation::isEditor() || Validation::isSectionEditor()) {
         $canOnlyRead = false;
         $canOnlyReview = false;
     }
     $templateMgr =& TemplateManager::getManager();
     // Remove the notification setting categories that the user will not be receiving (to simplify the form)
     $notificationSettingCategories = $this->_getNotificationSettingCategories();
     if ($canOnlyRead || $canOnlyReview) {
         unset($notificationSettingCategories['submissions']);
     }
     if ($canOnlyRead) {
         unset($notificationSettingCategories['reviewing']);
     }
     $templateMgr->assign('notificationSettingCategories', $notificationSettingCategories);
     $templateMgr->assign('notificationSettings', $this->_getNotificationSettingsMap());
     $templateMgr->assign('titleVar', __('common.title'));
     return parent::display($request);
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:30,代码来源:NotificationSettingsForm.inc.php

示例2: display

 /**
  * Display the form.
  * @param $request Request
  */
 function display($request)
 {
     $conferenceDao = DAORegistry::getDAO('ConferenceDAO');
     $conferences =& $conferenceDao->getNames();
     $canOnlyRead = true;
     $canOnlyReview = false;
     if (Validation::isReviewer()) {
         $canOnlyRead = false;
         $canOnlyReview = true;
     }
     if (Validation::isSiteAdmin() || Validation::isConferenceManager() || Validation::isDirector()) {
         $canOnlyRead = false;
         $canOnlyReview = false;
     }
     // Remove the notification setting categories that the user will not be receiving (to simplify the form)
     $notificationSettingCategories = $this->_getNotificationSettingCategories();
     if ($canOnlyRead || $canOnlyReview) {
         unset($notificationSettingCategories['submissions']);
     }
     if ($canOnlyRead) {
         unset($notificationSettingCategories['reviewing']);
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('notificationSettingCategories', $notificationSettingCategories);
     $templateMgr->assign('notificationSettings', $this->_getNotificationSettingsMap());
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('canOnlyRead', $canOnlyRead);
     $templateMgr->assign('canOnlyReview', $canOnlyReview);
     return parent::display($request);
 }
开发者ID:artkuo,项目名称:ocs,代码行数:34,代码来源:NotificationSettingsForm.inc.php

示例3: display

 /**
  * @see ReportPlugin::display()
  */
 function display(&$args, &$request)
 {
     parent::display($args, $request);
     $journal =& $request->getJournal();
     if (!Validation::isSiteAdmin()) {
         Validation::redirectLogin();
     }
     $this->setBreadcrumbs();
     if ($request->getUserVar('type')) {
         $oldStats = (bool) $request->getUserVar('useOldCounterStats');
         $year = (string) $request->getUserVar('year');
         $type = (string) $request->getUserVar('type');
         switch ($type) {
             case 'report':
                 $this->_report($request, $year, $oldStats);
                 break;
             case 'reportxml':
                 $this->_reportXml($request, $year, $oldStats);
                 break;
             case 'sushixml':
                 $this->_sushiXML($oldStats);
                 break;
         }
     } else {
         $years = $this->_getYears();
         $legacyYears = $this->_getYears(true);
         $templateManager =& TemplateManager::getManager();
         $templateManager->assign('years', $years);
         if (!empty($legacyYears)) {
             $templateManager->assign('legacyYears', $legacyYears);
         }
         $templateManager->display($this->getTemplatePath() . 'index.tpl');
     }
 }
开发者ID:jasonzou,项目名称:OJS-2.4.6,代码行数:37,代码来源:CounterReportPlugin.inc.php

示例4: validate

 /**
  * Validate that user has admin privileges and is not trying to access the admin module with a journal selected.
  * Redirects to the user index page if not properly authenticated.
  */
 function validate()
 {
     parent::validate();
     if (!Validation::isSiteAdmin() || Request::getRequestedJournalPath() != 'index') {
         Validation::redirectLogin();
     }
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:11,代码来源:AdminHandler.inc.php

示例5: plugins

 /**
  * Display a list of plugins along with management options.
  */
 function plugins($args)
 {
     $category = isset($args[0]) ? $args[0] : null;
     parent::validate();
     $categories = PluginRegistry::getCategories();
     if (isset($category)) {
         // The user specified a category of plugins to view;
         // get the plugins in that category only.
         $plugins =& PluginRegistry::loadCategory($category);
     } else {
         // No plugin specified; display all.
         $plugins = array();
         foreach ($categories as $category) {
             $newPlugins =& PluginRegistry::loadCategory($category);
             if (isset($newPlugins)) {
                 $plugins = array_merge($plugins, PluginRegistry::loadCategory($category));
             }
         }
     }
     parent::setupTemplate(true);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('plugins', $plugins);
     $templateMgr->assign_by_ref('categories', $categories);
     $templateMgr->assign('isSiteAdmin', Validation::isSiteAdmin());
     $templateMgr->assign('helpTopicId', 'journal.managementPages.plugins');
     $templateMgr->display('manager/plugins/plugins.tpl');
 }
开发者ID:Jouper,项目名称:jouper,代码行数:30,代码来源:PluginHandler.inc.php

示例6: index

 /**
  * Display the site or press index page.
  * (If a site admin is logged in and no presses exist, redirect to the
  * press administration page -- this may be useful upon install.)
  *
  * @param $args array
  * @param $request Request
  */
 function index($args, $request)
 {
     $targetPress = $this->getTargetContext($request);
     $press = $request->getPress();
     $user = $request->getUser();
     if ($user && !$targetPress && Validation::isSiteAdmin()) {
         // If the user is a site admin and no press exists,
         // send them to press administration to create one.
         return $request->redirect(null, 'admin', 'contexts');
     }
     // Public access.
     $this->setupTemplate($request);
     $templateMgr = TemplateManager::getManager($request);
     if ($press) {
         // Display the current press home.
         $this->_displayPressIndexPage($press, $templateMgr);
     } elseif ($targetPress) {
         // We're not on a press homepage, but there's one
         // available; redirect there.
         $request->redirect($targetPress->getPath());
     } else {
         // A target press couldn't be determined for some reason.
         if ($user) {
             // Redirect to user profile.
             $request->redirect(null, 'user', 'profile');
         } else {
             // Not logged in. Redirect to login page.
             $request->redirect(null, 'login');
         }
     }
 }
开发者ID:PublishingWithoutWalls,项目名称:omp,代码行数:39,代码来源:IndexHandler.inc.php

示例7: plugins

 /**
  * Display a list of plugins along with management options.
  * @param $args array
  * @param $request PKPRequest
  */
 function plugins($args, &$request)
 {
     $category = isset($args[0]) ? $args[0] : null;
     $categories = PluginRegistry::getCategories();
     $templateMgr =& TemplateManager::getManager();
     $this->validate();
     if (isset($category) && in_array($category, $categories)) {
         // The user specified a category of plugins to view;
         // get the plugins in that category only.
         $mainPage = false;
         $plugins =& PluginRegistry::loadCategory($category);
         $this->setupTemplate(false);
         $templateMgr->assign('pageTitle', 'plugins.categories.' . $category);
         $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs($request, true));
     } else {
         // No plugin specified; display all.
         $mainPage = true;
         $plugins = array();
         foreach ($categories as $category) {
             $newPlugins =& PluginRegistry::loadCategory($category);
             if (isset($newPlugins)) {
                 $plugins = array_merge($plugins, PluginRegistry::loadCategory($category));
             }
         }
         $this->setupTemplate(true);
         $templateMgr->assign('pageTitle', 'manager.plugins.pluginManagement');
         $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs($request, false));
     }
     $templateMgr->assign_by_ref('plugins', $plugins);
     $templateMgr->assign_by_ref('categories', $categories);
     $templateMgr->assign('mainPage', $mainPage);
     $templateMgr->assign('isSiteAdmin', Validation::isSiteAdmin());
     $templateMgr->assign('helpTopicId', 'journal.managementPages.plugins');
     $templateMgr->display('manager/plugins/plugins.tpl');
 }
开发者ID:reconciler,项目名称:ojs,代码行数:40,代码来源:PluginHandler.inc.php

示例8: validate

 /**
  * Validate that user has permissions to manage the selected journal.
  * Redirects to user index page if not properly authenticated.
  */
 function validate()
 {
     parent::validate();
     $journal =& Request::getJournal();
     if (!$journal || !Validation::isJournalManager() && !Validation::isSiteAdmin()) {
         Validation::redirectLogin();
     }
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:12,代码来源:ManagerHandler.inc.php

示例9: addArchiveFormChecks

 function addArchiveFormChecks(&$form)
 {
     $this->import('OAIHarvester');
     $oaiHarvester = new OAIHarvester($this->archive);
     $form->addCheck(new FormValidator($form, 'harvesterUrl', 'required', 'plugins.harvesters.oai.archive.form.harvesterUrlRequired'));
     $form->addCheck(new FormValidatorInSet($form, 'oaiIndexMethod', 'optional', 'plugins.harvesters.oai.archive.form.oaiIndexMethodRequired', array(OAI_INDEX_METHOD_LIST_RECORDS, OAI_INDEX_METHOD_LIST_IDENTIFIERS)));
     $form->addCheck(new FormValidatorCustom($form, 'harvesterUrl', 'required', 'plugins.harvester.oai.archive.form.harvesterUrlInvalid', array(&$oaiHarvester, 'validateHarvesterURL'), array(Request::getUserVar('isStatic'))));
     $form->addCheck(new FormValidatorEmail($form, 'adminEmail', Validation::isSiteAdmin() ? 'optional' : 'required', 'plugins.harvesters.oai.archive.form.adminEmailInvalid'));
     $form->addCheck(new FormValidatorCustom($form, 'harvesterUrl', 'required', 'plugins.harvester.oai.archive.form.harvesterUrlDuplicate', array(&$this, 'duplicateHarvesterUrlDoesNotExist'), array(Request::getUserVar('archiveId'))));
 }
开发者ID:jalperin,项目名称:harvester,代码行数:10,代码来源:OAIHarvesterPlugin.inc.php

示例10: displayMenuOption

 function displayMenuOption($hookName, $args)
 {
     if (!Validation::isSiteAdmin()) {
         return false;
     }
     $params =& $args[0];
     $smarty =& $args[1];
     $output =& $args[2];
     $output .= '<li>&#187; <a href="' . Request::url(null, 'counter') . '">' . __('plugins.generic.counter') . '</a></li>';
     return false;
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:11,代码来源:CounterPlugin.inc.php

示例11: validate

 /**
  * The site setting option 'preventManagerPluginManagement' must not be set for
  * journal managers to be able to manage plugins.
  * @param $request PKPRequest
  */
 function validate($request)
 {
     parent::validate();
     if (!Validation::isSiteAdmin()) {
         $site =& $request->getSite();
         $preventManagerPluginManagement = $site->getSetting('preventManagerPluginManagement');
         if ($preventManagerPluginManagement) {
             $request->redirect(null, 'manager', 'plugins');
         }
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:16,代码来源:PluginManagementHandler.inc.php

示例12: register

 /**
  * Register the plugin, if enabled; note that this plugin
  * runs under both Conference and Site contexts.
  * @param $category string
  * @param $path string
  * @return boolean
  */
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         $this->addLocaleData();
         if ($this->getEnabled() && Validation::isSiteAdmin()) {
             HookRegistry::register('Templates::Admin::Index::AdminFunctions', array($this, 'addLink'));
             HookRegistry::register('LoadHandler', array($this, 'handleRequest'));
         }
         return true;
     }
     return false;
 }
开发者ID:utlib,项目名称:ojs,代码行数:19,代码来源:BackupPlugin.inc.php

示例13: index

 /**
  * Display user index page.
  */
 function index()
 {
     $this->validate();
     $templateMgr =& TemplateManager::getManager();
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $user =& Request::getUser();
     $site =& Request::getSite();
     $this->setupTemplate();
     $templateMgr->assign('isSiteAdmin', Validation::isSiteAdmin());
     $templateMgr->assign('userRoles', $roleDao->getRolesByUserId($user->getId()));
     $templateMgr->assign('enableSubmit', $site->getSetting('enableSubmit'));
     $templateMgr->display('user/index.tpl');
 }
开发者ID:jalperin,项目名称:harvester,代码行数:16,代码来源:UserHandler.inc.php

示例14: TemplateManager

 /**
  * Constructor.
  * Initialize template engine and assign basic template variables.
  * @param $request PKPRequest FIXME: is optional for backwards compatibility only - make mandatory
  */
 function TemplateManager($request = null)
 {
     // FIXME: for backwards compatibility only - remove
     if (!isset($request)) {
         // FIXME: Trigger a deprecation warning when enough instances of this
         // call have been fixed to not clutter the error log.
         $request =& Registry::get('request');
     }
     assert(is_a($request, 'PKPRequest'));
     parent::PKPTemplateManager($request);
     if (!defined('SESSION_DISABLE_INIT')) {
         /**
          * Kludge to make sure no code that tries to connect to
          * the database is executed (e.g., when loading
          * installer pages).
          */
         $site =& $request->getSite();
         $siteFilesDir = $request->getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
         $this->assign('sitePublicFilesDir', $siteFilesDir);
         $this->assign('publicFilesDir', $siteFilesDir);
         $this->assign('isAdmin', Validation::isSiteAdmin());
         // assign an empty home context
         $this->assign('homeContext', array());
         $siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
         if (file_exists($siteStyleFilename)) {
             $this->addStyleSheet($request->getBaseUrl() . '/' . $siteStyleFilename);
         }
         // Load and apply theme plugin, if chosen
         $themePluginPath = $site->getSetting('theme');
         if (!empty($themePluginPath)) {
             // Load and activate the theme
             $themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
             if ($themePlugin) {
                 $themePlugin->activate($this);
             }
         }
         // Add the site-wide logo, if set for this locale or the primary locale
         $this->assign('displayPageHeaderTitle', $site->getLocalizedPageHeaderTitle());
         $customLogo = $site->getSetting('customLogo');
         if ($customLogo) {
             $this->assign('displayPageHeaderLogo', $customLogo);
         }
         $this->assign('siteTitle', $site->getLocalizedTitle());
         $this->assign('enableSubmit', $site->getSetting('enableSubmit'));
         // Add java script for notifications
         $user =& $request->getUser();
         if ($user) {
             $this->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.pnotify.js');
         }
     }
 }
开发者ID:ramonsodoma,项目名称:harvester,代码行数:56,代码来源:TemplateManager.inc.php

示例15: getManagementVerbs

 /**
  * Generic plug-ins implement the enabled/disabled logic
  * by default. This is necessary so that we can make sure
  * that disabled plug-ins will not have to be instantiated.
  *
  * Call this method with a list of management verbs (if any)
  * generated by the custom plug-in.
  *
  * @see Plugin::getManagementVerbs()
  */
 function getManagementVerbs()
 {
     // Site plug-ins can only be administered by site admins
     if ($this->isSitePlugin() && !Validation::isSiteAdmin()) {
         return array();
     }
     $verbs = parent::getManagementVerbs();
     if ($this->getEnabled()) {
         $verbs[] = array('disable', __('common.disable'));
     } else {
         $verbs[] = array('enable', __('common.enable'));
     }
     return $verbs;
 }
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:24,代码来源:GenericPlugin.inc.php


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