本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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']);
}
}
示例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;
}