Пример #1
0
 /**
 *This method calls getWebinars on the bigbluebutton server, then calls getWebinarInfo for each webinar and concatenates the result.
 *
 *@param URL -- the url of the bigbluebutton server
 *@param SALT -- the security salt of the bigbluebutton server
 *
 *@return 
 *	- Null if the server is unreachable
 *	- If FAILED then returns an array containing a returncode, messageKey, message.
 *	- If SUCCESS then returns an array of all the webinars. Each element in the array is an array containing a meetingID, 
 	  moderatorPW, attendeePW, hasBeenForciblyEnded, running.
 */
 public function getWebinarsArray($URL, $SALT)
 {
     $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getWebinarsURL($URL, $SALT));
     if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) {
         //The webinars were returned
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
     } else {
         if ($xml && $xml->returncode == 'SUCCESS') {
             //If there were webinars already created
             foreach ($xml->webinars->webinar as $webinar) {
                 //$webinars[] = BigBlueButton::getWebinarInfo($webinar->meetingID, $webinar->moderatorPW, $URL, $SALT);
                 $webinars[] = array('meetingID' => $webinar->meetingID, 'moderatorPW' => $webinar->moderatorPW, 'attendeePW' => $webinar->attendeePW, 'hasBeenForciblyEnded' => $webinar->hasBeenForciblyEnded, 'running' => $webinar->running);
             }
             return $webinars;
         } else {
             if ($xml) {
                 //If the xml packet returned failure it displays the message to the user
                 return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
             } else {
                 //If the server is unreachable, then prompts the user of the necessary action
                 return null;
             }
         }
     }
 }