當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OpenVBX::validateRequest方法代碼示例

本文整理匯總了PHP中OpenVBX::validateRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::validateRequest方法的具體用法?PHP OpenVBX::validateRequest怎麽用?PHP OpenVBX::validateRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenVBX的用法示例。


在下文中一共展示了OpenVBX::validateRequest方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validate_rest_request

 /**
  * Validate that an incoming rest request is from Twilio
  *
  * @param string $failure_message
  * @return void
  */
 function validate_rest_request($failure_message = 'Could not validate this request. Goodbye.')
 {
     $ci =& get_instance();
     if ($ci->tenant->type == VBX_Settings::AUTH_TYPE_CONNECT) {
         return;
     }
     if (!OpenVBX::validateRequest()) {
         $response = new TwimlResponse();
         $response->say($failure_message, array('voice' => $ci->vbx_settings->get('voice', $ci->tenant->id), 'language' => $ci->vbx_settings->get('voice_language', $ci->tenant->id)));
         $response->hangup();
         $response->respond();
         exit;
     }
 }
開發者ID:tjoozey,項目名稱:openvbx,代碼行數:20,代碼來源:twilio_helper.php

示例2: deauthorize

 /**
  * Twilio calls us when a user deauthorizes our connect account
  *
  * @return void
  */
 public function deauthorize()
 {
     $header = '405';
     // method not allowed
     if (OpenVBX::validateRequest() || 1 == 1) {
         if ($account_sid = $this->input->post('AccountSid')) {
             $result = $this->db->select('tenants.*')->from('tenants')->join('settings', 'tenants.id = settings.tenant_id')->where('settings.name = "twilio_sid"')->where('settings.value = "' . $this->db->escape_str($account_sid) . '"')->limit(1)->get()->result();
             if (!empty($result)) {
                 $tenant = current($result);
                 if ($tenant->id) {
                     log_message('info', 'AccountSid "' . $account_sid . '" deauthorized on ' . date('r') . ' (server tz: ' . date_default_timezone_get() . ')');
                     $this->setup_connect_tenant('deauthorized_client', $tenant->id);
                     $header = '204';
                     // accepted, but no content to return
                 }
             }
             $header = '400';
             // sid not found so its a bad request
         }
     }
     set_status_header($header);
     exit;
 }
開發者ID:ryanlarrabure,項目名稱:OpenVBX,代碼行數:28,代碼來源:connect.php


注:本文中的OpenVBX::validateRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。