diff --git a/Changelog.txt b/Changelog.txt index 8cc2e2a..96e673e 100755 --- a/Changelog.txt +++ b/Changelog.txt @@ -48,4 +48,13 @@ BigBLueButton-ILIAS Plugin Changelog - improve German translations 2021 Version 1.0.15 - Add commas (a fix to the db error) - - update version \ No newline at end of file + - update version +2012 Version 2.0_Beta + - Many Bug Fixes(commans in DB, Disable syntax chack whole saving a password,...) + - Enable phone calls + - Enable to upload presenations + - Display multiple formats + - Enable mp4 download in case available + - set the maximum number of participants + - set the maximum duration of the meeting + - Add a Guest link and a guest page \ No newline at end of file diff --git a/classes/bbb-api/bbb_api.php b/classes/bbb-api/bbb_api.php deleted file mode 100755 index f448f83..0000000 --- a/classes/bbb-api/bbb_api.php +++ /dev/null @@ -1,698 +0,0 @@ -isActive()) { - $proxyHost = ilProxySettings::_getInstance()->getHost(); - $proxyPort = ilProxySettings::_getInstance()->getPort(); - $proxyURL = $proxyHost . ":" . $proxyPort; - curl_setopt($ch, CURLOPT_PROXY, $proxyURL); - } - - $data = curl_exec($ch); - curl_close($ch); - - if ($data) { - return (new SimpleXMLElement($data)); - } else { - return false; - } - } - - return (simplexml_load_file($url)); -} - - - -/* -@param -$userName = userName AND meetingID (string) -$welcomeString = welcome message (string) - -$modPW = moderator password (string) -$vPW = viewer password (string) -$voiceBridge = voice bridge (integer) -$logout = logout url (url) -*/ -// create a meeting and return the url to join as moderator - - -// TODO:: -// create some set methods -class BigBlueButton -{ - public $userName = array(); - public $meetingID; // the meeting id - - public $welcomeString; - // the next 2 fields are maybe not needed?!? - public $modPW; // the moderator password - public $attPW; // the attendee pw - - public $securitySalt; // the security salt; gets encrypted with sha1 - public $URL; // the url the bigbluebutton server is installed - public $sessionURL; // the url for the administrator to join the sessoin - public $userURL; - - public $conferenceIsRunning = false; - - // this constructor is used to create a BigBlueButton Object - // use this object to create servers - // Use is either 0 arguments or all 7 arguments - public function __construct() - { - $numargs = func_num_args(); - if ($numargs == 0) { - # echo "Constructor created"; - } - // pass the information to the class variables - elseif ($numargs >= 6) { - $this->userName = func_get_arg(0); - $this->meetingID = func_get_arg(1); - $this->welcomeString = func_get_arg(2); - $this->modPW = func_get_arg(3); - $this->attPW = func_get_arg(4); - $this->securitySalt = func_get_arg(5); - $this->URL = func_get_arg(6); - - - $arg_list = func_get_args(); - #debug output for the number of arguments - # for ($i = 0; $i < $numargs; $i++) { - # echo "Argument $i is: " . $arg_list[$i] . "
\n"; - # } - - // $this->createMeeting( $this->userName, $this->meetingID, $this->welcomeString, $this->modPW, $this->attPW, $this->securitySalt, $this->URL ); - // echo "Object created"; - // echo '
'; - }// end else if - } - - //------------------------------------------------GET URLs------------------------------------------------- - /** - *This method returns the url to join the specified meeting. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param username -- the display name to be used when the user joins the meeting - *@param PW -- the attendee or moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to join the meeting - */ - public static function joinURL($meetingID, $userName, $PW, $SALT, $URL) - { - $url_join = $URL."api/join?"; - $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW); - return ($url_join.$params.'&checksum='.sha1("join".$params.$SALT)); - } - - - /** - *This method returns the url to join the specified meeting. - * - *@param name -- a name fot the meeting - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param attendeePW -- the attendee of the meeting - *@param moderatorPW -- the moderator of the meeting - *@param welcome -- the welcome message that gets displayed on the chat window - *@param logoutURL -- the URL that the bbb client will go to after users logouut - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - *@param record -- default false, creates an recordable meeting - * - *@return The url to join the meeting - */ - public static function createMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = false) - { - $url_create = $URL."api/create?"; - $voiceBridge = 70000 + rand(0, 9999); - - $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&voiceBridge='.$voiceBridge.'&logoutURL='.urlencode($logoutURL); - - if ($record) { - $params .= "&record=true"; - } - - if (trim($welcome)) { - $params .= '&welcome='.urlencode($welcome); - } - - return ($url_create.$params.'&checksum='.sha1("create".$params.$SALT)); - } - - - - /** - *This method returns the url to check if the specified meeting is running. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to check if the specified meeting is running. - */ - public static function isMeetingRunningURL($meetingID, $URL, $SALT) - { - $base_url = $URL."api/isMeetingRunning?"; - $params = 'meetingID='.urlencode($meetingID); - return ($base_url.$params.'&checksum='.sha1("isMeetingRunning".$params.$SALT)); - } - - /** - *This method returns the url to getMeetingInfo of the specified meeting. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to check if the specified meeting is running. - */ - public static function getMeetingInfoURL($meetingID, $modPW, $URL, $SALT) - { - $base_url = $URL."api/getMeetingInfo?"; - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); - return ($base_url.$params.'&checksum='.sha1("getMeetingInfo".$params.$SALT)); - } - - /** - *This method returns the url for listing all meetings in the bigbluebutton server. - * - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url of getMeetings. - */ - public static function getMeetingsURL($URL, $SALT) - { - $base_url = $URL."api/getMeetings?"; - $params = 'random='.(rand() * 1000); - return ($base_url.$params.'&checksum='.sha1("getMeetings".$params.$SALT)); - } - - /** - *This method returns Meeting Records - * - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - *@param meetingID -- the ID of an meeting can be empty - * - *@return The url of getMeetings. - */ - public static function getRecordings($URL, $SALT, $meetingID ='') - { - $base_url = $URL."api/getRecordings?"; - - $params = ''; - if ($meetingID != '') { - $params = 'meetingID='.$meetingID; - } - $base_url = $base_url.$params.(($meetingID != '') ? '&' : '').'checksum='.sha1("getRecordings".$params.$SALT); - //echo $base_url; - $xml = bbb_wrap_simplexml_load_file($base_url); - - return $xml; - } - - /** - *This method returns the url to end the specified meeting. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to end the specified meeting. - */ - public static function endMeetingURL($meetingID, $modPW, $URL, $SALT) - { - $base_url = $URL."api/end?"; - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); - return ($base_url.$params.'&checksum='.sha1("end".$params.$SALT)); - } - - /** - *This method returns the url to delete the specified Recording. - * - *@param recordID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to end the specified meeting. - */ - public static function deleteRecordingURL($recordID, $URL, $SALT) - { - $base_url = $URL."api/deleteRecordings?"; - $params = 'recordID='.urlencode($recordID); - return ($base_url.$params.'&checksum='.sha1("deleteRecordings".$params.$SALT)); - } - - - /** - *This method returns the url to delete the specified Recording. - * - *@param recordID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return The url to end the specified meeting. - */ - public static function deleteRecording($recordID, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::deleteRecordingURL($recordID, $URL, $SALT)); - - - if ($xml && $xml->returncode == 'SUCCESS') { - return $xml->returncode; - } elseif ($xml) { - return ($xml->messageKey.' : '.$xml->message); - } else { - return ('Unable to fetch URL '.$URL); - } - } - - - //-----------------------------------------------CREATE---------------------------------------------------- - /** - *This method creates a meeting and returnS the join url for moderators. - * - *@param username - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param welcomeString -- the welcome message to be displayed when a user logs in to the meeting - *@param mPW -- the moderator password of the meeting - *@param aPW -- the attendee password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - *@param logoutURL -- the url the user should be redirected to when they logout of bigbluebutton - * - *@return The joinURL if successful or an error message if unsuccessful - */ - public static function createMeetingAndGetJoinURL($username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL) - { - - //$xml = bbb_wrap_simplexml_load_file( BigBlueButton::createMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL ) ); - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::createMeetingURL($meetingID, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL)); - - - if ($xml && $xml->returncode == 'SUCCESS') { - return (BigBlueButton::joinURL($meetingID, $username, $mPW, $SALT, $URL)); - } elseif ($xml) { - return ($xml->messageKey.' : '.$xml->message); - } else { - return ('Unable to fetch URL '.$url_create.$params.'&checksum='.sha1("create".$params.$SALT)); - } - } - - /** - *This method creates a meeting and return an array of the xml packet - * - *@param username - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param welcomeString -- the welcome message to be displayed when a user logs in to the meeting - *@param mPW -- the moderator password of the meeting - *@param aPW -- the attendee password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - *@param logoutURL -- the url the user should be redirected to when they logout of bigbluebutton - *@param record -- if set session will be recorded by bigbluebutton - * - *@return - * - Null if unable to reach the bigbluebutton server - * - If failed it returns an array containing a returncode, messageKey, message. - * - If success it returns an array containing a returncode, messageKey, message, meetingID, attendeePW, moderatorPW, hasBeenForciblyEnded. - */ - public static function createMeetingArray($username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record=false) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::createMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record)); - - if ($xml) { - if ($xml->meetingID) { - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); - } else { - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); - } - } else { - return null; - } - } - - //-------------------------------------------getMeetingInfo--------------------------------------------------- - /** - *This method calls the getMeetingInfo on the bigbluebutton server and returns an xml packet. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return An xml packet. - * If failed it returns an xml packet containing a returncode, messagekey, and message. - * If success it returnsan xml packet containing a returncode, - */ - public static function getMeetingInfo($meetingID, $modPW, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); - if ($xml) { - return (str_replace('', '', str_replace("\n", '', $xml->asXML()))); - } - return false; - } - - //-------------------------------------------getMeetingInfo--------------------------------------------------- - /** - *This method calls the getMeetingInfo on the bigbluebutton server and returns an xml packet. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return An xml packet. - * If failed it returns an xml packet containing a returncode, messagekey, and message. - * If success it returnsan xml packet containing a returncode, - */ - public static function isMeetingRecorded($meetingID, $modPW, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); - return - $xml && $xml->returncode == 'SUCCESS' && $xml->recording == "true"; - } - - - - - - /** - *This method calls the getMeetingInfo on the bigbluebutton server and returns an array. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return An Array. - * - Null if unable to reach the bigbluebutton server - * - If failed it returns an array containing a returncode, messagekey, message. - * - If success it returns an array containing a meetingID, moderatorPW, attendeePW, hasBeenForciblyEnded, running, startTime, endTime, - participantCount, moderatorCount, attendees. - */ - public static function getMeetingInfoArray($meetingID, $modPW, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); - - if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {//The meetings were returned - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); - } elseif ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created - return array( 'meetingID' => $xml->meetingID, 'moderatorPW' => $xml->moderatorPW, 'attendeePW' => $xml->attendeePW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, 'running' => $xml->running, 'startTime' => $xml->startTime, 'endTime' => $xml->endTime, 'participantCount' => $xml->participantCount, 'moderatorCount' => $xml->moderatorCount, 'attendees' => $xml->attendees ); - } elseif (($xml && $xml->returncode == 'FAILED') || $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; - } - } - - //-----------------------------------------------getMeetings------------------------------------------------------ - /** - *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 - * - If failed then returns a boolean of false. - * - If succeeded then returns an xml of all the meetings. - */ - public static function getMeetings($URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingsURL($URL, $SALT)); - if ($xml && $xml->returncode == 'SUCCESS') { - if ($xml->messageKey) { - return ($xml->message->asXML()); - } - ob_start(); - echo ''; - if (count($xml->meetings) && count($xml->meetings->meeting)) { - foreach ($xml->meetings->meeting as $meeting) { - echo ''; - echo BigBlueButton::getMeetingInfo($meeting->meetingID, $meeting->moderatorPW, $URL, $SALT); - echo ''; - } - } - echo ''; - return (ob_get_clean()); - } else { - return (false); - } - } - - /** - *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 static 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); - } elseif ($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; - } elseif ($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; - } - } - - //----------------------------------------------getUsers--------------------------------------- - /** - *This method prints the usernames of the attendees in the specified conference. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param URL -- the url of the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param UNAME -- is a boolean to determine how the username is formatted when printed. Default if false. - * - *@return A boolean of true if the attendees were printed successfully and false otherwise. - */ - public static function getUsers($meetingID, $modPW, $URL, $SALT, $UNAME = false) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); - if ($xml && $xml->returncode == 'SUCCESS') { - ob_start(); - if (count($xml->attendees) && count($xml->attendees->attendee)) { - foreach ($xml->attendees->attendee as $attendee) { - if ($UNAME == true) { - echo "User name: ".$attendee->fullName.'
'; - } else { - echo $attendee->fullName.'
'; - } - } - } - return (ob_end_flush()); - } else { - return (false); - } - } - - /** - *This method returns an array of the attendees in the specified meeting. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@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 static function getUsersArray($meetingID, $modPW, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); - - if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {//The meetings were returned - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); - } elseif ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created - foreach ($xml->attendees->attendee as $attendee) { - $users[] = array( 'userID' => $attendee->userID, 'fullName' => $attendee->fullName, 'role' => $attendee->role ); - } - return $users; - } elseif ($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; - } - } - - - //------------------------------------------------Other Methods------------------------------------ - /** - *This method calls end meeting on the specified meeting in the bigbluebutton server. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param modPW -- the moderator password of the meeting - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return - * - Null if the server is unreachable - * - An array containing a returncode, messageKey, message. - */ - public static function endMeeting($meetingID, $modPW, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::endMeetingURL($meetingID, $modPW, $URL, $SALT)); - - 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; - } - } - - /** - *This method check the BigBlueButton server to see if the meeting is running (i.e. there is someone in the meeting) - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return A boolean of true if the meeting is running and false if it is not running - */ - public function isMeetingRunning($meetingID, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::isMeetingRunningURL($meetingID, $URL, $SALT)); - if ($xml && $xml->returncode == 'SUCCESS') { - return (($xml->running == 'true') ? true : false); - } else { - return (false); - } - } - - /** - *This method calls isMeetingRunning on the BigBlueButton server. - * - *@param meetingID -- the unique meeting identifier used to store the meeting in the bigbluebutton server - *@param SALT -- the security salt of the bigbluebutton server - *@param URL -- the url of the bigbluebutton server - * - *@return - * - If SUCCESS it returns an xml packet - * - If the FAILED or the server is unreachable returns a string of 'false' - */ - public function getMeetingXML($meetingID, $URL, $SALT) - { - $xml = bbb_wrap_simplexml_load_file(BigBlueButton::isMeetingRunningURL($meetingID, $URL, $SALT)); - if ($xml && $xml->returncode == 'SUCCESS') { - return (str_replace('
', '', str_replace("\n", '', $xml->asXML()))); - } else { - return 'false'; - } - } - - - - - - - - - - // TODO: WRITE AN ITERATOR WHICH GOES OVER WHATEVER IT IS BEING TOLD IN THE API AND LIST INFORMATION - /* we have to define at least 2 variable fields for getInformation to read out information at any position - The first is: An identifier to chose if we look for attendees or the meetings or something else - The second is: An identifier to chose what integrated functions are supposed to be used - - @param IDENTIFIER -- needs to be put in for the function to identify the information to print out - current values which can be used are 'attendee' and 'meetings' - @param meetingID -- needs to be put in to identify the meeting - @param modPW -- needs to be put in if the users are supposed to be shown or to retrieve information about the meetings - @param URL -- needs to be put in the URL to the bigbluebutton server - @param SALT -- needs to be put in for the security salt calculation - - Note: If 'meetings' is used, then only the parameters URL and SALT needs to be used - If 'attendee' is used, then all the parameters needs to be used - */ - public static function getInformation($IDENTIFIER, $meetingID, $modPW, $URL, $SALT) - { - // if the identifier is null or '', then return false - if ($IDENTIFIER == "" || $IDENTIFIER == null) { - echo "You need to type in a valid value into the identifier."; - return false; - } - // if the identifier is attendee, call getUsers - elseif ($IDENTIFIER == 'attendee') { - return BigBlueButton::getUsers($meetingID, $modPW, $URL, $SALT); - } - // if the identifier is meetings, call getMeetings - elseif ($IDENTIFIER == 'meetings') { - return BigBlueButton::getMeetings($URL, $SALT); - } - // return nothing - else { - return true; - } - } - - - - public function getServerIP() - { - // get the server url - $sIP = $_SERVER['SERVER_ADDR']; - return $serverIP = 'http://'.$sIP.'/bigbluebutton/'; - } -} diff --git a/classes/class.ilBigBlueButtonConfigGUI.php b/classes/class.ilBigBlueButtonConfigGUI.php index e3defda..97a0e4c 100755 --- a/classes/class.ilBigBlueButtonConfigGUI.php +++ b/classes/class.ilBigBlueButtonConfigGUI.php @@ -1,11 +1,8 @@ setTabs(); - $next_class = $dic->ctrl()->getNextClass(); - switch(strtolower($next_class)) { - case strtolower(DevToolsCtrl::class): - $dic->ctrl()->forwardCommand(new DevToolsCtrl($this, self::plugin())); - break; - default: - switch ($cmd) { - case "configure": - case "configureAdvanced": - case "save": - $this->$cmd(); - break; - - - } - } - - - } + function performCommand($cmd) + { + + switch ($cmd) + { + case "configure": + case "save": + $this->$cmd(); + break; + + } + } /** * Configure screen @@ -114,6 +98,7 @@ public function initConfigurationForm() // salt (text) $pi = new ilPasswordInputGUI($pl->txt("salt"), "frmsalt"); $pi->setRequired(true); + $pi->setSkipSyntaxCheck(true); $pi->setMaxLength(256); $pi->setSize(40); $pi->setRetype(false); @@ -142,16 +127,6 @@ public function initConfigurationForm() return $form; } -public function setConfigTabs(){ - global $DIC; - $ctrl = $DIC->ctrl(); - $tabs = $DIC->tabs(); - $this->pl_object = $this->getPluginObject(); - - $tabs->addTab('configure', $this->pl_object->txt('configurations'), $ctrl->getLinkTarget($this, 'configure')); - $tabs->addTab('advanced_configure', $this->pl_object->txt('advanced_configurations'), $ctrl->getLinkTarget($this, 'configureAdvanced')); -} - /** * Save form input * @@ -203,9 +178,7 @@ public function save() $tpl->setContent($form->getHtml()); } } - public function configureAdvanced(){ - } private function checkUrl(string $url) { if (substr($url, -1)!="/") { @@ -216,26 +189,16 @@ private function checkUrl(string $url) private function isServerReachable(string $url, string $salt) { - global $tpl; - $pl = $this->getPluginObject(); - - try { - $response = BigBlueButton::getMeetings($url, $salt); - } catch (Exception $e) { + include_once("./Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton/classes/class.ilBigBlueButtonProtocol.php"); + $bbb_helper=new BBB($salt,$url); + try{ + $bbb_helper->getApiVersion(); + }catch (Exception $e) { return false; } return true; - } - /** - * - */ - protected function setTabs() : void - { - $this->setConfigTabs(); + } - DevToolsCtrl::addTabs(self::plugin()); - - } } diff --git a/classes/class.ilBigBlueButtonProtocol.php b/classes/class.ilBigBlueButtonProtocol.php index 4fcbfc5..7ea3e34 100755 --- a/classes/class.ilBigBlueButtonProtocol.php +++ b/classes/class.ilBigBlueButtonProtocol.php @@ -1,9 +1,7 @@ object = $object; $this->bbb = new BBB($this->object->getSvrSalt(), $this->object->getSvrPublicURL()); - $this->setCreateMeetingParams(); - } - public function getMeetingID() - { - } - public function setMeetingID() - { - } - public function hasMeetingAModerator() - { - } - public function isModerator() - { - } - public function isAdmin() - { - } - public function getRole() - { - } - public function setRole() - { - } - public function getRolePwd() - { - } - public function setRolePwd() - { - } - public function isMeetingStartable() - { - } - public function getDisplayName() - { - } - public function setDisplayName($displayName) - { } public function getAvatar() { @@ -81,51 +40,24 @@ public function getAvatar() public function setAvatar($avatar) { $this->avatar = $avatar; - } - public function getParentObj() - { - } - public function setParentOnj() - { - } - public function hasModerator() - { - } - public function getMeetings() - { - } - public function getJoinURL() - { - } - public function hasSession() - { - } - public function getMeetingInfo() - { - } - public function setCreateMeetingParams() - { - } - + } public function getVideoDownloadStreamUrl(string $url) { - $record_part = explode('2.0/playback.html?meetingId=', $url); + $record_part = explode('playback/presentation/2.3/', $url); $video_path = $record_part[0] . $record_part[1] . "/" . $record_part[1] . ".mp4"; $video_url = str_replace("playback", "download", $video_path); //Check if the MP4 exists - $ch = curl_init($video_url); - curl_exec($ch); + //$ch = curl_init($video_url); + //curl_exec($ch); $http_status = 400; - if (!curl_errno($ch)) { - $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); - } - curl_close($ch); + // if (!curl_errno($ch)) { + // $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); + // } + // curl_close($ch); return (int)$http_status ===200 ? $video_url : ''; } - public function isRecordable() - { - } + public function getInviteUrl($title = "Guest") { $link = ILIAS_HTTP_PATH . "/" . substr(dirname(__FILE__), strpos(dirname(__FILE__), 'Customizing'), -8) . '/guest.php?'; @@ -141,7 +73,6 @@ public function createMeeting($object, $record = false) $logger = $DIC->logger()->root(); - $logger->dump($this->bbb->getDefaultConfigXML()); $meetingID=$object->getBBBId(); $meetingTitle=$object->getTitle(); @@ -162,16 +93,6 @@ public function createMeeting($object, $record = false) include_once('./Services/Link/classes/class.ilLink.php'); $logoutURL = ilLink::_getLink($object->getRefId()); - $mPW=$object->getModeratorPwd(); - - $aPW=$object->getAttendeePwd(); - - $SALT=trim($object->getSvrSalt()); - - $srvURL=$object->getSvrPublicURL()/*.":".$object->getSvrPublicPort()*/ ; - //$srvURL=$object->getSvrPrivateURL()/*.":".$object->getSvrPrivatePort()*/ ; - - $this->createMeetingParam = new CreateMeetingParameters($meetingID, $meetingTitle); $this->createMeetingParam->setAttendeePassword($object->getAttendeePwd()) ->setModeratorPassword($object->getModeratorPwd()) @@ -191,10 +112,6 @@ public function createMeeting($object, $record = false) if( (bool)(strlen($pdf = $this->object->getPresentationUrl())) ) { $this->createMeetingParam->addPresentation($pdf); } - - //$response=BigBlueButton::createMeetingArray($meetingTitle, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $srvURL, $logoutURL, $record ); - - //return $response; $this->bbb->createMeeting($this->createMeetingParam); } @@ -202,9 +119,7 @@ public function createMeeting($object, $record = false) public function joinURL($object) { - global $ilUser, $DIC; - $logger = $DIC->logger()->root(); - $logger->dump($this->bbb->getDefaultConfigXML()->getRawXml()); + global $ilUser; $userName=$ilUser->getFullname(); $meetingID=$object->getBBBId(); $aPW=$object->getAttendeePwd(); @@ -240,23 +155,6 @@ public function isMeetingRecorded($object) return $meetingInfo->success(); } - /* - function getCloseURL($object){ - - - $meetingID=$object->getBBBId(); - - $mPW=$object->getModeratorPwd(); - - $SALT=trim($object->getSvrSalt()); - - $srvURL=$object->getSvrPublicURL().":".$object->getSvrPublicPort() ; - - $closeUrl=BigBlueButton::endMeetingURL($meetingID, $mPW, $srvURL, $SALT); - - return $closeUrl; - - }*/ public function endMeeting($object) { @@ -268,77 +166,40 @@ public function endMeeting($object) public function getRecordings($object) { - global $DIC; - $logger =$DIC->logger()->root(); require_once "./Services/Calendar/classes/class.ilDateTime.php"; - $meetingID=$object->getBBBId(); - - $meetingParams = new GetMeetingInfoParameters($meetingID, $object->getModeratorPwd()); - $info = $this->bbb->getMeetingInfo($meetingParams); - //$logger->dump($info); $recordParameters = new GetRecordingsParameters(); $recordParameters->setMeetingID($meetingID); - $records =[]; $all_records = $this->bbb->getRecordings($recordParameters); - //$logger->dump($all_records->getRawXml()); - - foreach ($all_records->getRecords() as $key =>$record) { - - $recordID = $record->getRecordId(); - $records[$recordID]['startTime'] = date("d.m.Y H:i", substr($record->getStartTime(), 0, 10)); - $records[$recordID]['endTime'] = date("d.m.Y H:i", substr($record->getEndTime(), 0, 10)); - $records[$recordID]['playback'] = $record->getPlaybackUrl(); - $records[$recordID]['playback_format'] = $record->getPlaybackType(); - $records[$recordID]['playback_length'] = $this->processPlaybackLength($record->getPlaybackLength()); - $records[$recordID]['download'] = $this->getVideoDownloadStreamUrl($records[$recordID]['playback']); - $records[$recordID]['meetingID'] = $record->getMeetingID(); - } - return $records; + + return $all_records->getRawXml(); + } + + + public function processPlaybackLength($playbackLength){ + if ($playbackLength=== 0) return '<1 min'; + if ($playbackLength >= 60) return (int)$playbackLength/60 ."h" . $playbackLength%60; + return $playbackLength; } -public function processPlaybackLength($playbackLength){ - if ($playbackLength=== 0) return '<1 min'; - if ($playbackLength >= 60) return (int)$playbackLength/60 ."h" . $playbackLength%60; - return $playbackLength; -} public function getDeleteRecordingUrl($object, $recordID) { $meetingID=$object->getBBBId(); - $SALT=trim($object->getSvrSalt()); - - //$srvURL=$object->getSvrPublicURL().":".$object->getSvrPublicPort() ; - $srvURL=$object->getSvrPrivateURL()/*.":".$object->getSvrPrivatePort()*/ ; $recordParameters = new GetRecordingsParameters(); $recordParameters->setMeetingID($meetingID); return $this->bbb->getDeleteRecordingsUrl($recordParameters); - - //return BigBlueButton::deleteRecordingURL( $recordID, $srvURL, $SALT ); } public function deleteRecording($object, $recordID) { - $meetingID=$object->getBBBId(); - $SALT=trim($object->getSvrSalt()); - //$srvURL=$object->getSvrPublicURL().":".$object->getSvrPublicPort() ; - $srvURL=$object->getSvrPrivateURL()/*.":".$object->getSvrPrivatePort() */; $deletRecordParameters = new DeleteRecordingsParameters($recordID); return $this->bbb->deleteRecordings($deletRecordParameters); - //return BigBlueButton::deleteRecording( $recordID, $srvURL, $SALT ); } public function isMeetingRunning($object) { $meetingID=$object->getBBBId(); - - $mPW=$object->getModeratorPwd(); - - $SALT=trim($object->getSvrSalt()); - - $srvURL=$object->getSvrPrivateURL()/*.":".$object->getSvrPrivatePort() */; - //This version checks if the meeting is created, not if it has any attendee - //$response=BigBlueButton::getMeetingInfoArray( $meetingID, $mPW, $srvURL, $SALT ); $meetingRunning = false; try { $meetingParameters = new IsMeetingRunningParameters($meetingID); @@ -347,17 +208,11 @@ public function isMeetingRunning($object) } catch (Exception $e) { } return $meetingRunning; - - - // if($response && !array_key_exists('returncode',$response) && $response['hasBeenForciblyEnded']=='false'){ - // return true; - // }else{ - // return false; - // } - - /* It checks if there is anyone inside the meeting - return BigBlueButton::isMeetingRunning( $meetingID, $srvURL, $SALT ); - */ + } + public function getAPI() + { + $apiVersion = $this->bbb->getApiVersion(); + return $apiVersion->success(); } } diff --git a/classes/class.ilObjBigBlueButton.php b/classes/class.ilObjBigBlueButton.php index 9d201f9..12a5fa5 100755 --- a/classes/class.ilObjBigBlueButton.php +++ b/classes/class.ilObjBigBlueButton.php @@ -118,7 +118,6 @@ public function doRead() " WHERE id = ".$ilDB->quote($this->getId(), "integer") ); while ($rec = $ilDB->fetchAssoc($set)) { - $logger->dump($rec); $this->setOnline($rec["is_online"]); $this->setAttendeePwd($rec["attendeepwd"]); $this->setModeratorPwd($rec["moderatorpwd"]); diff --git a/classes/class.ilObjBigBlueButtonGUI.php b/classes/class.ilObjBigBlueButtonGUI.php index 083073a..7828d1b 100755 --- a/classes/class.ilObjBigBlueButtonGUI.php +++ b/classes/class.ilObjBigBlueButtonGUI.php @@ -346,43 +346,46 @@ public function showContent() $table_content = []; $recordcount=0; - $all_recordings=$BBBHelper->getRecordings($this->object); - if ($all_recordings) { - foreach ($all_recordings as $recordID=> $recording) { - $table_row_template = new ilTemplate( - "tpl.BigBlueButtonRecordTableRow.html", - true, - true, - "Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton" - ); - $table_row_template->setVariable("Date", $recording["startTime"]); - $seconds = round(($recording["endTime"]- $recording["startTime"])/1000); - $table_row_template->setVariable("Duration", $this->formatTimeDiff($seconds)); - - $table_links = []; + $all_recordings=$BBBHelper->getRecordings($this->object)->recordings->recording; + + if ($all_recordings){ + foreach($all_recordings as $recording){ + + $table_row_template = new ilTemplate("tpl.BigBlueButtonRecordTableRow.html", + true, + true, + "Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton"); + $table_row_template->setVariable("Date",date("d.m.Y H:i", substr ($recording->startTime,0,10))); + $seconds = round(($recording->endTime - $recording->startTime)/1000); + $table_row_template->setVariable("Duration", $this->formatTimeDiff( $seconds )); + + $table_links = []; foreach($recording->playback->format as $format) { $table_link_template = new ilTemplate("tpl.BigBlueButtonRecordTableLink.html", true, true, "Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton"); $table_link_template->setVariable("URL",$format->url); + if($format->type=="presentation"){ + $table_row_template->setVariable("DownloadLink", $BBBHelper->getVideoDownloadStreamUrl($format->url)); + $table_row_template->setVariable("DownloadText", $this->txt("download_text")); + } $table_link_template->setVariable("Link_Title", $this->txt('Recording_type_' . $format->type)); $table_links[] = $table_link_template->get(); } - $table_row_template->setVariable("Links", implode(' · ', $table_links)); - $table_row_template->setVariable("DeleteLink", $recordID); - - $table_row_template->setVariable("Link_Title", $this->txt("link_title")); - $table_row_template->setVariable("DeleteLink_Title", $this->txt("deletelink_title")); - - $table_content .= $table_row_template->get(); - $recordcount++; - } - } - $table_template->setVariable("BBB_RECORD_CONTENT", $table_content); - $table_template->setVariable("Date_Title", $this->txt("Date_Title")); - $table_template->setVariable("LENGTH_TITLE", $this->txt("Length_Title")); - $table_template->setVariable("Link_Title", $this->txt("Link_Title")); + $table_row_template->setVariable("Links", implode(' · ', $table_links)); + $table_row_template->setVariable("DeleteLink", $recording->recordID); + $table_row_template->setVariable("DeleteLink_Title", $this->txt("deletelink_title")); + + $table_content[] = $table_row_template->get(); + $recordcount++; + } + } + $table_template->setVariable("BBB_RECORD_CONTENT", implode($table_content)); + $table_template->setVariable("Date_Title", $this->txt("Date_Title")); + $table_template->setVariable("Duration_Title", $this->txt("Duration_Title")); + $table_template->setVariable("Link_Title", $this->txt("Link_Title")); + //$table_template->setVariable("Download_Title", $this->txt("Download_Title")); $my_tpl->setVariable("recordings", $table_template->get()); $my_tpl->setVariable("Headline_Recordings", $this->txt("Headline_Recordings")); if ($values["choose_recording"]) { diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index f54220d..7ebbd3c 100755 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -54,6 +54,7 @@ salt#:#Security Salt Date_Title#:#Datum Date_Format#:#%H:%I:%S DeleteLink_Title#:#Aufnahme löschen +DownloadText#:#Herunterladen Duration_Title#:#Dauer Link_Title#:#Formate Recording_type_presentation#:#Präsentation @@ -75,13 +76,13 @@ guest_displayname_input#:#Titel Vorname Nachname btntext_join_meeting#:#Meeting beitreten top_moderated_m_bbb#:#Willkommen im Meetingraum!
 
Dies ist ein moderierter Raum und Sie können stets erst dann in den Meetingraum gelangen, wenn eine Person mit Moderatorfunktion im Raum ist. guest_invite_info#:#Mit dem folgenden Link können Sie Gäste zum Meeting einladen: -dialnumber#:# Dial Number -accesscode#:# Access Code -guestchoose#:# Allow to invite Guests -maxparticipants#:# Max. Teilnehmer -maxparticipants_info#:#Maximale Anzahl Teilnehmer je Meeting. Bei unbegrenzter Anzahl bitte '0' angeben. -presentationurl#:#Startpräsentation -presentationurl_info#:#Eigene Startpräsentation über URL laden. Der URL-Aufbau mu -guest_global_choose#:# Gastlink Voreinstellung -guest_global_choose_info#:#Diese Option sollte in den meisten Fällen deaktiviert sein. Eine Nutzung durch Unbefugte sollte weitgehend ausgeschlossen werden können. Gäste kommen stets nur als Teilnehmer in einen moderierten Raum. Dort muss ein Moderierender bereits anwesend sein. Gäste müssen Nutzungsbedingungen zustimmen, die als ILIAS-Sprachvariable gespeichert sind. Wechseln Sie zum Editieren zu Administration -> Sprachen. Klicken Sie auf die gewünschte 'Sprache' und tippen Sie bei 'Identifier' 'rep_robj_bbb_terms_of_use' ein. Klicken Sie dann auf 'Filter anwenden' und editieren Sie den Text. -terms_of_use#:#Schutzrechte
Die in BigBlueButton-Konferenzen enthaltenen Informationen und Materialien wie z.B. Texte oder Bilder sind in der Regel durch Urheber-, Marken- oder Patentrechte geschützt.
Die gesetzlichen Vorschriften zum Datenschutz sind zu beachten. Dies gilt insbesondere für die Aufzeichnung von BigBlueButton-Konferenzen. Das heimliche Aufzeichnen von Video- oder Audiokonferenzen ist ein Straftatbestand.

Verhaltensregeln
Sie dürfen keine gegen gesetzliche Bestimmungen verstoßende, pornographische, obszöne, diffamierende, verleumderische, beleidigende, bedrohende, volksverhetzende oder rassistische Inhalte einstellen. Auch das Einstellen von Werbung ohne Genehmigung sowie die Übermittlung von Informationen, welche einen Virus, Manipulationen oder ähnliche schädigende Elemente enthalten, ist untersagt.

Verarbeitete Daten
Bei der Nutzung von BigBlueButton werden folgende Daten erhoben:Die vorübergehende Speicherung der Verbindungsdaten, insbesondere der IP-Adresse, durch das System ist notwendig, um eine Auslieferung von BigBlueButton an den Rechner des Nutzers zu ermöglichen. Hierfür muss die IP-Adresse des Nutzers für die Dauer der Sitzung gespeichert bleiben. Rechtsgrundlage für die vorübergehende Speicherung der Daten ist Art. 6 Abs. 1 lit. f DSGVO.
Die Verbindungsdaten werden ebenfalls in der Regel in Logfiles gespeichert. Der Löschzeitpunkt wird durch den Betreiber des Servers für BigBlueButton festgelegt. +dialnumber#:# phone number +accesscode#:# access code +guestchoose#:# Allow inviting guests +maxparticipants#:# Max. Participants +maxparticipants_info#:#Maximum number of participants per meeting. If unlimited, please specify '0'. +presentationurl#:#Start presentation +presentationurl_info#:#Load your own start presentation via URL. The URL structure must be +guest_global_choose#:#Guest link preset +guest_global_choose_info#:#This option should be disabled in most cases. It should be possible to largely exclude use by unauthorized persons. Guests always enter a moderated room only as participants. A moderator must already be present there. Guests must agree to terms of use, which are stored as ILIAS language variable. To edit, switch to Administration -> Languages. Click on the desired 'Language' and type 'rep_robj_bbb_terms_of_use' for 'Identifier'. Then click on 'Apply filter' and edit the text. +terms_of_use#:#Protection rights
The information and materials contained in BigBlueButton conferences, such as texts or images, are usually protected by copyright, trademark or patent rights.
The legal regulations regarding data protection must be observed. This applies in particular to the recording of BigBlueButton conferences. Surreptitious recording of video or audio conferences is a criminal offense.

Rules of Conduct
You may not post any content that violates any law, including but not limited to pornographic, obscene, defamatory, libelous, abusive, threatening, hateful, or racially-inciting material. Also the posting of advertisements without permission as well as the transmission of information containing a virus, manipulations or similar harmful elements is prohibited.

Processed Data
When using BigBlueButton, the following data will be collected:The temporary storage of connection data, in particular the IP address, by the system is necessary to enable delivery of BigBlueButton to the user's computer. For this purpose, the user's IP address must remain stored for the duration of the session. The legal basis for the temporary storage of the data is Art. 6 (1) lit. f DSGVO.
The connection data is also usually stored in log files. The deletion time is determined by the operator of the server for BigBlueButton. \ No newline at end of file diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 97c785b..6abbeaf 100755 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -40,6 +40,7 @@ salt#:#Security Salt Date_Title#:#date Date_Format#:#%H:%I:%S DeleteLink_Title#:#delete recording +DownloadText#:#download Duration_Title#:#length Link_Title#:#formats Recording_type_presentation#:#presentation @@ -60,15 +61,22 @@ saving_invoked#:#saved choose_recording#:#Allow recordings globally choose_recording_info#:#Activate this option if you want users with write permissions to select 'Allow capturing' under Settings. Since the URL for the recording is known to be distributed to unintended persons, this option should not be activated in most cases. configurations#:# Konfiguration -advanced_configurations#:#Erweiterte Konfiguration -join_info#:#
Wichtige Hinweise: -tech_requirements_info#:#Technische Voraussetzungen: