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


PHP CRM_Core_Key::validate方法代码示例

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


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

示例1: key

 function key($name, $addSequence = FALSE, $ignoreKey = FALSE)
 {
     $config = CRM_Core_Config::singleton();
     if ($ignoreKey || isset($config->keyDisable) && $config->keyDisable) {
         return NULL;
     }
     $key = CRM_Utils_Array::value('qfKey', $_REQUEST, NULL);
     if (!$key && $_SERVER['REQUEST_METHOD'] === 'GET') {
         $key = CRM_Core_Key::get($name, $addSequence);
     } else {
         $key = CRM_Core_Key::validate($key, $name, $addSequence);
     }
     if (!$key) {
         $this->invalidKey();
     }
     $this->_key = $key;
     return $key;
 }
开发者ID:hguru,项目名称:224Civi,代码行数:18,代码来源:Controller.php

示例2: key

 function key($name, $addSequence = false, $ignoreKey = false)
 {
     $config =& CRM_Core_Config::singleton();
     if ($ignoreKey || isset($config->keyDisable) && $config->keyDisable) {
         return null;
     }
     require_once 'CRM/Core/Key.php';
     $key = CRM_Utils_Array::value('qfKey', $_REQUEST, null);
     if (!$key) {
         $key = CRM_Core_Key::get($name, $addSequence);
     } else {
         $key = CRM_Core_Key::validate($key, $name, $addSequence);
     }
     if (!$key) {
         CRM_Core_Error::fatal('Could not find valid Key');
     }
     $this->_key = $key;
     return $key;
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:19,代码来源:Controller.php

示例3: key

 function key($name, $addSequence = false, $ignoreKey = false)
 {
     $config =& CRM_Core_Config::singleton();
     if ($ignoreKey || isset($config->keyDisable) && $config->keyDisable) {
         return null;
     }
     require_once 'CRM/Core/Key.php';
     $key = CRM_Utils_Array::value('qfKey', $_REQUEST, null);
     if (!$key) {
         $key = CRM_Core_Key::get($name, $addSequence);
     } else {
         $key = CRM_Core_Key::validate($key, $name, $addSequence);
     }
     if (!$key) {
         $msg = ts('We can\'t load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site adminstrator for assistance.') . '<br /><br />' . ts('Error type: Could not find a valid key.');
         CRM_Core_Error::fatal($msg);
     }
     $this->_key = $key;
     return $key;
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:20,代码来源:Controller.php

示例4: checkMenuItem

 static function checkMenuItem(&$item)
 {
     if (!array_key_exists('access_callback', $item)) {
         CRM_Core_Error::backtrace();
         CRM_Core_Error::fatal();
     }
     // if component_id is present, ensure it is enabled
     if (isset($item['component_id']) && $item['component_id']) {
         $config = CRM_Core_Config::singleton();
         if (is_array($config->enableComponentIDs) && in_array($item['component_id'], $config->enableComponentIDs)) {
             // continue with process
         } else {
             return FALSE;
         }
     }
     // the following is imitating drupal 6 code in includes/menu.inc
     if (empty($item['access_callback']) || is_numeric($item['access_callback'])) {
         return (bool) $item['access_callback'];
     }
     // check whether the following Ajax requests submitted the right key
     // FIXME: this should be integrated into ACLs proper
     if (CRM_Utils_Array::value('page_type', $item) == 3) {
         if (!CRM_Core_Key::validate($_REQUEST['key'], $item['path'])) {
             return FALSE;
         }
     }
     // check if callback is for checkMenu, if so optimize it
     if (is_array($item['access_callback']) && $item['access_callback'][0] == 'CRM_Core_Permission' && $item['access_callback'][1] == 'checkMenu') {
         $op = CRM_Utils_Array::value(1, $item['access_arguments'], 'and');
         return self::checkMenu($item['access_arguments'][0], $op);
     } else {
         return call_user_func_array($item['access_callback'], $item['access_arguments']);
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:34,代码来源:Permission.php

示例5: key

 function key($name, $addSequence = false, $ignoreKey = false)
 {
     $config = CRM_Core_Config::singleton();
     if ($ignoreKey || isset($config->keyDisable) && $config->keyDisable) {
         return null;
     }
     require_once 'CRM/Core/Key.php';
     $key = CRM_Utils_Array::value('qfKey', $_REQUEST, null);
     if (!$key) {
         $key = CRM_Core_Key::get($name, $addSequence);
     } else {
         $key = CRM_Core_Key::validate($key, $name, $addSequence);
     }
     if (!$key) {
         $msg = ts('We can\'t load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site adminstrator for assistance.') . '<br /><br />' . ts('Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.') . '<br /><br />' . ts('Error type: Could not find a valid session key.');
         CRM_Core_Error::fatal($msg);
     }
     $this->_key = $key;
     return $key;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:20,代码来源:Controller.php


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