You are here

function bbb_redirect in BigBlueButton 7

Same name and namespace in other branches
  1. 6 bbb.module \bbb_redirect()

Redirect to meeting

2 calls to bbb_redirect()
bbb_meeting_attend in ./bbb.module
Redirect to big blue button instance; Menu callback
bbb_meeting_moderate in ./bbb.module
Redirect to big blue button instance; Menu callback
1 string reference to 'bbb_redirect'
bbb_menu in ./bbb.module
Implement HOOK_menu().

File

./bbb.module, line 847
Big Blue Button - Enables universities and colleges to deliver a high-quality learning experience.

Code

function bbb_redirect($node, $mode = 'attend') {
  $meeting = bbb_get_meeting($node->nid, NULL, FALSE);
  switch ($mode) {
    case 'attend':

      // Get redirect URL
      $url = parse_url($meeting->url[$mode]);
      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':' . $url['port'] : '') . $url['path'] . '?' . $url['query'];
      header('Location: ' . $fullurl, TRUE, 301);
      break;
    case 'moderate':

      // Get redirect URL
      $url = parse_url($meeting->url[$mode]);
      $fullurl = $url['scheme'] . '://' . $url['host'] . (isset($url['port']) ? ':' . $url['port'] : '') . $url['path'] . '?' . $url['query'];
      header('Location: ' . $fullurl, TRUE, 301);
      break;
  }
}