You are here

function bbb_is_meeting_owner in BigBlueButton 7

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

Check if user is meeting owner

File

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

Code

function bbb_is_meeting_owner($nid, $account = NULL) {
  if (!$account) {
    global $user;
    $account = $user;
  }
  $sql = "SELECT COUNT(nid) FROM {bbb_meetings} bm\n           INNER JOIN {node} n ON bm.nid = n.nid\n           WHERE n.uid = :uid\n             AND nid = :nid";
  $owner = db_result(db_query($sql, array(
    ':uid' => $account->uid,
    ':nid' => $nid,
  )));
  return $owner ? TRUE : FALSE;
}