本文整理匯總了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;
}