Пример #1
0
 /**
  *This method returns an array of the attendees in the specified webinar.
  *
  *@param meetingID -- the unique webinar identifier used to store the webinar in the bigbluebutton server
  *@param modPW -- the moderator password of the webinar
  *@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, returns an array containing a returncode, messageKey, message.
  *	- If SUCCESS, returns an array of array containing the userID, fullName, role of each attendee
  */
 public function getUsersArray($meetingID, $modPW, $URL, $SALT)
 {
     $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getWebinarInfoURL($meetingID, $modPW, $URL, $SALT));
     if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {
         //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->attendees->attendee as $attendee) {
                 $users[] = array('userID' => $attendee->userID, 'fullName' => $attendee->fullName, 'role' => $attendee->role);
             }
             return $users;
         } 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;
             }
         }
     }
 }