Skip to content

Commit

Permalink
Merge pull request #61 from satyammangroliya/release_9
Browse files Browse the repository at this point in the history
Release 9
  • Loading branch information
jeph864 authored Aug 28, 2024
2 parents fc32a8b + 3a54347 commit 33b6d29
Show file tree
Hide file tree
Showing 116 changed files with 2,203 additions and 1,628 deletions.
25 changes: 25 additions & 0 deletions classes/class.ilBBB.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

use BigBlueButton\Util\UrlBuilder;
use BigBlueButton\BigBlueButton;

/**
* Class ilBBB
*/
class ilBBB extends BigBlueButton
{
public function __construct($securitySecret=null, $baseUrl=null)
{
parent::__construct($baseUrl, $securitySecret);

//Add Proxy
if(ilProxySettings::_getInstance()->isActive())
{
$proxyHost = ilProxySettings::_getInstance()->getHost();
$proxyPort = ilProxySettings::_getInstance()->getPort();
$this->curlopts = [
CURLOPT_PROXY => $proxyHost . ":" . $proxyPort
];
}
}
}
5 changes: 1 addition & 4 deletions classes/class.ilBigBlueButtonConfigGUI.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php

//include_once("./Services/Component/classes/class.ilPluginConfigGUI.php");



/**
* BigBlueButton configuration class
Expand Down Expand Up @@ -248,7 +245,7 @@ private function checkUrl(string $url)
private function isServerReachable(string $url, string $salt)
{
//include_once("./Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton/classes/class.ilBigBlueButtonProtocol.php");
$bbb_helper=new BBB($salt,$url);
$bbb_helper=new ilBBB($salt,$url);
try{
$apiVersion = $bbb_helper->getApiVersion();
return $apiVersion->success();
Expand Down
5 changes: 1 addition & 4 deletions classes/class.ilBigBlueButtonExporter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

//include_once("./Services/Component/classes/class.ilPluginConfigGUI.php");

/**
* BigBlueButton exporter class
*
Expand All @@ -12,8 +10,7 @@ class ilBigBlueButtonExporter extends ilXmlExporter
{
public function getXmlRepresentation($a_entity, $a_schema_version, $a_id): string
{
//include_once './Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
$bbb = new ilObjBigBlueButton($a_id);
return ''; // Currently no export possible
}

public function init(): void
Expand Down
1 change: 0 additions & 1 deletion classes/class.ilBigBlueButtonImporter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

//include_once("./Services/Component/classes/class.ilPluginConfigGUI.php");

/**
* BigBlueButton importer class
Expand Down
2 changes: 1 addition & 1 deletion classes/class.ilBigBlueButtonPlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

require_once __DIR__ . "/../vendor/autoload.php";

/**
* Bigbluebutton repository object plugin
Expand Down
44 changes: 10 additions & 34 deletions classes/class.ilBigBlueButtonProtocol.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<?php

require_once './Customizing/global/plugins/Services/Repository/RepositoryObject/BigBlueButton/vendor/autoload.php';

use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;
use BigBlueButton\Parameters\GetRecordingsParameters;
use BigBlueButton\Parameters\DeleteRecordingsParameters;
use BigBlueButton\Parameters\EndMeetingParameters;
use BigBlueButton\Parameters\GetMeetingInfoParameters;
use BigBlueButton\Parameters\IsMeetingRunningParameters;
use BigBlueButton\Util\UrlBuilder;

/**
* BigBlueButton comunication helper class
Expand All @@ -32,7 +29,7 @@ class ilBigBlueButtonProtocol
public function __construct($object)
{
$this->object = $object;
$this->bbb = new BBB($this->object->getSvrSalt(), $this->object->getSvrPublicURL());
$this->bbb = new ilBBB($this->object->getSvrSalt(), $this->object->getSvrPublicURL());
$this->meetings = $this->bbb->getMeetings();
}
public function getAvatar()
Expand All @@ -42,7 +39,7 @@ public function getAvatar()
public function setAvatar($avatar)
{
$this->avatar = $avatar;
}
}

public function getVideoDownloadStreamUrl(string $url)
{
Expand Down Expand Up @@ -81,7 +78,6 @@ public function createMeeting($object, $record = false)
}*/


include_once('./Services/Link/classes/class.ilLink.php');
$logoutURL = ilLink::_getLink($object->getRefId());

$this->createMeetingParam = new CreateMeetingParameters($meetingID, $meetingTitle);
Expand All @@ -100,7 +96,7 @@ public function createMeeting($object, $record = false)
if ($object->getMaxParticipants()>0){
$this->createMeetingParam->setMaxParticipants($object->getMaxParticipants());
}
if( (bool)(strlen($pdf = $this->object->getPresentationUrl())) && $this->isPDFValid($pdf)) {
if( (bool)(strlen($pdf = $this->object->getPresentationUrl())) && $this->isPDFValid($pdf)) {
$this->createMeetingParam->addPresentation($pdf);
}
if(trim($object->getDialNumber())){
Expand Down Expand Up @@ -153,8 +149,8 @@ public function isMeetingRecorded($object)
}catch(Exception $e){
return $meetingInfo;
}


}


Expand All @@ -175,7 +171,7 @@ public function getRecordings()
$meetingID=$this->object->getBBBId();
$recordParameters = new GetRecordingsParameters();
$recordParameters->setMeetingID($meetingID);
return $this->bbb->getRecordings($recordParameters);
return $this->bbb->getRecordings($recordParameters);
}


Expand Down Expand Up @@ -227,11 +223,11 @@ public function getAPI()
return $apiVersion->success();
}
private function isPDFValid(string $pdf){

return filter_var($pdf, FILTER_VALIDATE_URL) ? true : false;
}


public function getMaximumSessionsAvailable($meeting_id = null)
{
$participants_count = 0;
Expand All @@ -244,11 +240,11 @@ public function getMaximumSessionsAvailable($meeting_id = null)
$participants_count = $participants_count + $meeting->getParticipantCount();
$userlimit_exceeded =( $this->object->getMaxParticipants() > 0 && ($meeting->getMaxUsers() - $meeting->getParticipantCount() -1 <= 0));
$available[$meeting->getMeetingId()] = [

'participants' => $meeting->getParticipantCount(),
'max_users' => $meeting->getMaxUsers(),
'userlimit' => $userlimit_exceeded

];
if($meeting_id && $meeting->getMeetingId() == $meeting_id && $userlimit_exceeded){
$sessions_available['current_meeting_userlimit'] = true;
Expand All @@ -263,23 +259,3 @@ public function getMaximumSessionsAvailable($meeting_id = null)
}
}

class BBB extends \BigBlueButton\BigBlueButton
{
public function __construct($securitySecret=null, $baseUrl=null)
{
parent::__construct();
$this->securitySecret = $securitySecret;
$this->bbbServerBaseUrl = $baseUrl;
$this->urlBuilder = new UrlBuilder($this->securitySecret, $this->bbbServerBaseUrl);
//Add Proxy
require_once('Services/Http/classes/class.ilProxySettings.php');
if(ilProxySettings::_getInstance()->isActive())
{
$proxyHost = ilProxySettings::_getInstance()->getHost();
$proxyPort = ilProxySettings::_getInstance()->getPort();
$this->curlopts = [
CURLOPT_PROXY => $proxyHost . ":" . $proxyPort
];
}
}
}
47 changes: 20 additions & 27 deletions classes/class.ilObjBigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ public function __construct($a_ref_id = 0)
/**
* Get type.
*/
final public function initType(): void
final protected function initType(): void
{
$this->setType("xbbb");
}

/**
* Create object
*/
public function doCreate(bool $clone_mode = false): void
protected function doCreate(bool $clone_mode = false): void
{
global $ilDB;

Expand Down Expand Up @@ -161,14 +161,14 @@ public function doCreate(bool $clone_mode = false): void
$this->enableUserLimit((bool) $record['enable_userlimit']);
$this->enableMaxConcurrentSession((bool) $record['sess_enable_max_concurrent']);
$this->setMaxConcurrentSessions((int) $record['sess_max_concurrent']);
$this->setMaxConcurrentSessionsMsg($record['sess_msg_concurrent']);
$this->setMaxConcurrentSessionsMsg($record['sess_msg_concurrent'] ?? '');
}
}

/**
* Read data from db
*/
public function doRead(): void
protected function doRead(): void
{
global $ilDB;

Expand All @@ -177,19 +177,19 @@ public function doRead(): void
" WHERE id = ".$ilDB->quote($this->getId(), "integer")
);
while ($rec = $ilDB->fetchAssoc($set)) {
$this->setOnline($rec["is_online"]);
$this->setAttendeePwd($rec["attendeepwd"]);
$this->setModeratorPwd($rec["moderatorpwd"]);
$this->setWelcomeText($rec["welcometext"]);
$this->setMaxParticipants($rec["maxparticipants"]);
$this->setSequence($rec["sequence"]);
$this->setDialNumber($rec["dialnumber"] !==null ? $rec["dialnumber"]: '');
$this->setAccessCode($rec["accesscode"]);
$this->setMeetingDuration($rec["duration"]);
$this->setGuestLinkAllowed((bool)$rec["guestchoose"]);
$this->setDownloadAllowed((bool)$rec["allow_download"]);
$this->setPresentationUrl($rec["presentationurl"]!==null? $rec["presentationurl"]: '');
$this->setPublish((bool)$rec["publish"]);
$this->setOnline((bool) ($rec["is_online"] ?? false));
$this->setAttendeePwd((string) ($rec["attendeepwd"] ?? ''));
$this->setModeratorPwd((string) ($rec["moderatorpwd"] ?? ''));
$this->setWelcomeText((string) $rec["welcometext"]);
$this->setMaxParticipants((int) ($rec["maxparticipants"] ?? 0));
$this->setSequence((string) ($rec["sequence"] ?? ''));
$this->setDialNumber((string) ($rec["dialnumber"] ?? ''));
$this->setAccessCode((string) ($rec["accesscode"] ?? ''));
$this->setMeetingDuration((int) ($rec["duration"] ?? 0));
$this->setGuestLinkAllowed((bool) $rec["guestchoose"]);
$this->setDownloadAllowed((bool) $rec["allow_download"]);
$this->setPresentationUrl((string) ($rec["presentationurl"] ?? ''));
$this->setPublish((bool) ($rec["publish"] ?? false));
}

$result = $ilDB->query("SELECT * FROM rep_robj_xbbb_conf");
Expand All @@ -201,14 +201,14 @@ public function doRead(): void
$this->enableUserLimit((bool) $record['enable_userlimit']);
$this->enableMaxConcurrentSession((bool) $record['sess_enable_max_concurrent']);
$this->setMaxConcurrentSessions((int) $record['sess_max_concurrent']);
$this->setMaxConcurrentSessionsMsg($record['sess_msg_concurrent']);
$this->setMaxConcurrentSessionsMsg($record['sess_msg_concurrent'] ?? '');
}
}

/**
* Update data
*/
public function doUpdate(): void
protected function doUpdate(): void
{
global $ilDB;

Expand All @@ -233,7 +233,7 @@ public function doUpdate(): void
/**
* Delete data from db
*/
public function doDelete(): void
protected function doDelete(): void
{
global $ilDB;

Expand Down Expand Up @@ -584,13 +584,6 @@ public function setGuestGlobalEnabled(bool $enabled)
$this->guestGlobalEnabled = $enabled;
}

/**
* @return mixed
*/
public function isGuestLink()
{
return $this->is_guest_link;
}

/**
* @return bool
Expand Down
10 changes: 7 additions & 3 deletions classes/class.ilObjBigBlueButtonGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*/
class ilObjBigBlueButtonGUI extends ilObjectPluginGUI
{
private ?ilPropertyFormGUI $form = null;
public bool $has_meeting_recordings = false;

/**
Expand Down Expand Up @@ -120,7 +121,7 @@ public function getStandardCmd(): string
/**
* Set tabs
*/
public function setTabs(): void
protected function setTabs(): void
{
global $ilTabs, $ilCtrl, $ilAccess;

Expand Down Expand Up @@ -429,7 +430,10 @@ private function buildRecordingUI()

if ($isPublished){
if ($this->object->isDownloadAllowed()){
$actions[] = $DIC->ui()->factory()->button()->shy($this->txt("DownloadText"), $BBBHelper->getVideoDownloadStreamUrl($format->url));
$actions[] = $DIC->ui()->factory()->button()->shy(
$this->txt("DownloadText"),
$BBBHelper->getVideoDownloadStreamUrl($format->url ?? '')
);
}
// $actions[] = $DIC->ui()->factory()->button()->shy($this->txt("unpublish_link"), $this->editLink($recording->recordID, 0));
// $actions[] = $DIC->ui()->factory()->button()->shy($this->txt("publish_link"), $this->editLink($recording->recordID, 1));
Expand Down Expand Up @@ -530,7 +534,7 @@ public function publish()
$publish = boolval(filter_input(INPUT_GET, "publish"));

$BBBHelper->publishRecordings($this->object,$recordID, $publish );
$this->object=$bbb_obj;

$ilCtrl->redirect($this, "showContent");

}
Expand Down
1 change: 0 additions & 1 deletion classes/class.ilObjBigBlueButtonListGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function getProperties(): array

$props = array();

//$this->plugin->includeClass("class.ilObjBigBlueButtonAccess.php");
if (!ilObjBigBlueButtonAccess::checkOnline($this->obj_id)) {
$props[] = array("alert" => true, "property" => $this->txt("status"),
"value" => $this->txt("offline"));
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"require": {
"bigbluebutton/bigbluebutton-api-php": "dev-master"
},
"autoload": {
"classmap": [
"classes"
]
}
}
}
Loading

0 comments on commit 33b6d29

Please sign in to comment.