You are here

function bbb_api_generate_querystring in BigBlueButton 6

Same name in this branch
  1. 6 includes/api-0.64.bbb.inc \bbb_api_generate_querystring()
  2. 6 includes/api-0.7.bbb.inc \bbb_api_generate_querystring()
Same name and namespace in other branches
  1. 7 includes/api.bbb.inc \bbb_api_generate_querystring()

Generate a signed query string

12 calls to bbb_api_generate_querystring()
bbb_api_create in includes/api-0.64.bbb.inc
Create Meeting (create)
bbb_api_create in includes/api-0.7.bbb.inc
Create Meeting (create)
bbb_api_end in includes/api-0.64.bbb.inc
End Meeting (end)
bbb_api_end in includes/api-0.7.bbb.inc
End Meeting (end)
bbb_api_getMeetingInfo in includes/api-0.64.bbb.inc
Get Meeting Info (getMeetingInfo)

... See full list

File

includes/api-0.64.bbb.inc, line 208
Big Blue Button - Enables universities and colleges to deliver a high-quality learning experience.

Code

function bbb_api_generate_querystring($call, $params = array(), $salty = 1) {
  $query = array();

  // URL encoding the parameters
  foreach ($params as $key => $value) {
    $query[] = $key . '=' . drupal_urlencode(trim($value));
  }

  // Putting it together
  $query_string = implode('&', $query);
  switch ($salty) {
    case 0:
      $query_string = $query_string;
      break;
    case 1:

      // Security until v0.64
      $query_string = $query_string . '&checksum=' . sha1($query_string . BBB_API_SECURITY_SALT);
      break;
    case 2:

      // Security since v0.70
      $query_string = $query_string . '&checksum=' . sha1($call . $query_string . BBB_API_SECURITY_SALT);
      break;
  }
  return $query_string;
}