當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。