/**
	*This method calls getMeetings on the bigbluebutton server, then calls getMeetingInfo for each meeting 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 meetings. Each element in the array is an array containing a meetingID, 
		  moderatorPW, attendeePW, hasBeenForciblyEnded, running.
	*/
	public function getMeetingsArray( $URL, $SALT ) {
		$xml = bbb_wrap_simplexml_load_file( BigBlueButton::getMeetingsURL( $URL, $SALT ) );

		if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) {//The meetings were returned
			return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
		}
		else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created
		
			foreach ($xml->meetings->meeting as $meeting)
			{
            //$meetings[] = BigBlueButton::getMeetingInfo($meeting->meetingID, $meeting->moderatorPW, $URL, $SALT);
				$meetings[] = array( 'meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running );
			}

			return $meetings;

		}
		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;
		}
	}
Пример #2
0
}
else { ?>
	<!-- primeira exibição da página -->
	<h2>Criar sala de conferência</h2>
	<form method="post">
		<p>Informe seu login (ex.: fulano.silva): <input type="text" name="criador"/></p>
		<p>Nome da sala: <input type="text" name="sala"/></p>
		Logins dos convidados (ex.: fulano.silva):<ul>
		<? for($i = 1; $i <= 8; ++$i) { ?>
			<li><?=$i?> <input type="text" name="convidado_<?=$i?>"/>
				<label><input type="checkbox" name="mod_<?=$i?>"/> moderador</label></li>
		<? } ?>
		</ul>
		<input type="submit" value="Criar sala"/>
	</form>
	<hr/>

	Salas atualmente abertas:<ul>
	<?php
	$ret = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingsURL($url, $salt));
	if(!count($ret->meetings->meeting))
		echo '<li><i>(nenhuma)</i></li>';
	else
		foreach($ret->meetings->meeting as $meeting)
			echo '<li>'.$meeting->meetingID.'</li>';
	?>
	</ul>
<? } ?>

</body>
</html>