Unverified Commit 811d3f06 authored by Ghazi Triki's avatar Ghazi Triki Committed by GitHub
Browse files

Merge pull request #44 from jonaslm/master

Added support for lock settings when creating meetings
parents 8b58303e 93351dfb
......@@ -118,6 +118,51 @@ class CreateMeetingParameters extends MetaParameters
*/
private $muteOnStart;
/**
* @var bool
*/
private $lockSettingsDisableCam;
/**
* @var bool
*/
private $lockSettingsDisableMic;
/**
* @var bool
*/
private $lockSettingsDisablePrivateChat;
/**
* @var bool
*/
private $lockSettingsDisablePublicChat;
/**
* @var bool
*/
private $lockSettingsDisableNote;
/**
* @var bool
*/
private $lockSettingsHideUserList;
/**
* @var bool
*/
private $lockSettingsLockedLayout;
/**
* @var bool
*/
private $lockSettingsLockOnJoin = true;
/**
* @var bool
*/
private $lockSettingsLockOnJoinConfigurable;
/**
* @var array
*/
......@@ -531,6 +576,177 @@ class CreateMeetingParameters extends MetaParameters
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableCam()
{
return $this->lockSettingsDisableCam;
}
/**
* @param bool $lockSettingsDisableCam
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableCam($lockSettingsDisableCam)
{
$this->lockSettingsDisableCam = $lockSettingsDisableCam;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableMic()
{
return $this->lockSettingsDisableMic;
}
/**
* @param bool $lockSettingsDisableMic
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableMic($lockSettingsDisableMic)
{
$this->lockSettingsDisableMic = $lockSettingsDisableMic;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisablePrivateChat()
{
return $this->lockSettingsDisablePrivateChat;
}
/**
* @param bool $lockSettingsDisablePrivateChat
* @return CreateMeetingParameters
*/
public function setLockSettingsDisablePrivateChat($lockSettingsDisablePrivateChat)
{
$this->lockSettingsDisablePrivateChat = $lockSettingsDisablePrivateChat;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisablePublicChat()
{
return $this->lockSettingsDisablePublicChat;
}
/**
* @param bool $lockSettingsDisablePublicChat
* @return CreateMeetingParameters
*/
public function setLockSettingsDisablePublicChat($lockSettingsDisablePublicChat)
{
$this->lockSettingsDisablePublicChat = $lockSettingsDisablePublicChat;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableNote()
{
return $this->lockSettingsDisableNote;
}
/**
* @param bool $lockSettingsDisableNote
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableNote($lockSettingsDisableNote)
{
$this->lockSettingsDisableNote = $lockSettingsDisableNote;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsHideUserList()
{
return $this->lockSettingsHideUserList;
}
/**
* @param bool $lockSettingsHideUserList
* @return CreateMeetingParameters
*/
public function setLockSettingsHideUserList($lockSettingsHideUserList)
{
$this->lockSettingsHideUserList = $lockSettingsHideUserList;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsLockedLayout()
{
return $this->lockSettingsLockedLayout;
}
/**
* @param bool $lockSettingsLockedLayout
* @return CreateMeetingParameters
*/
public function setLockSettingsLockedLayout($lockSettingsLockedLayout)
{
$this->lockSettingsLockedLayout = $lockSettingsLockedLayout;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsLockOnJoin()
{
return $this->lockSettingsLockOnJoin;
}
/**
* @param bool $lockOnJoin
* @return CreateMeetingParameters
*/
public function setLockSettingsLockOnJoin($lockOnJoin)
{
$this->lockSettingsLockOnJoin = $lockOnJoin;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsLockOnJoinConfigurable()
{
return $this->lockSettingsLockOnJoinConfigurable;
}
/**
* @param bool $lockOnJoinConfigurable
* @return CreateMeetingParameters
*/
public function setLockSettingsLockOnJoinConfigurable($lockOnJoinConfigurable)
{
$this->lockSettingsLockOnJoinConfigurable = $lockOnJoinConfigurable;
return $this;
}
/**
* @param $endCallbackUrl
* @return CreateMeetingParameters
......@@ -681,25 +897,32 @@ class CreateMeetingParameters extends MetaParameters
public function getHTTPQuery()
{
$queries = [
'name' => $this->meetingName,
'meetingID' => $this->meetingId,
'attendeePW' => $this->attendeePassword,
'moderatorPW' => $this->moderatorPassword,
'dialNumber' => $this->dialNumber,
'voiceBridge' => $this->voiceBridge,
'webVoice' => $this->webVoice,
'logoutURL' => $this->logoutUrl,
'record' => $this->record ? 'true' : 'false',
'duration' => $this->duration,
'maxParticipants' => $this->maxParticipants,
'autoStartRecording' => $this->autoStartRecording ? 'true' : 'false',
'allowStartStopRecording' => $this->allowStartStopRecording ? 'true' : 'false',
'welcome' => trim($this->welcomeMessage),
'moderatorOnlyMessage' => trim($this->moderatorOnlyMessage),
'webcamsOnlyForModerator' => $this->webcamsOnlyForModerator ? 'true' : 'false',
'logo' => $this->logo,
'copyright' => $this->copyright,
'muteOnStart' => $this->muteOnStart,
'name' => $this->meetingName,
'meetingID' => $this->meetingId,
'attendeePW' => $this->attendeePassword,
'moderatorPW' => $this->moderatorPassword,
'dialNumber' => $this->dialNumber,
'voiceBridge' => $this->voiceBridge,
'webVoice' => $this->webVoice,
'logoutURL' => $this->logoutUrl,
'record' => $this->record ? 'true' : 'false',
'duration' => $this->duration,
'maxParticipants' => $this->maxParticipants,
'autoStartRecording' => $this->autoStartRecording ? 'true' : 'false',
'allowStartStopRecording' => $this->allowStartStopRecording ? 'true' : 'false',
'welcome' => trim($this->welcomeMessage),
'moderatorOnlyMessage' => trim($this->moderatorOnlyMessage),
'webcamsOnlyForModerator' => $this->webcamsOnlyForModerator ? 'true' : 'false',
'logo' => $this->logo,
'copyright' => $this->copyright,
'muteOnStart' => $this->muteOnStart,
'lockSettingsDisableCam' => $this->isLockSettingsDisableCam() ? 'true' : 'false',
'lockSettingsDisableMic' => $this->isLockSettingsDisableMic() ? 'true' : 'false',
'lockSettingsDisablePrivateChat' => $this->isLockSettingsDisablePrivateChat() ? 'true' : 'false',
'lockSettingsDisablePublicChat' => $this->isLockSettingsDisablePublicChat() ? 'true' : 'false',
'lockSettingsDisableNote' => $this->isLockSettingsDisableNote() ? 'true' : 'false',
'lockSettingsLockedLayout' => $this->isLockSettingsLockedLayout() ? 'true' : 'false',
'lockSettingsLockOnJoin' => $this->isLockSettingsLockOnJoin() ? 'true' : 'false',
];
// Add breakout rooms parameters only if the meeting is a breakout room
......
......@@ -50,6 +50,15 @@ class CreateMeetingParametersTest extends TestCase
$this->assertEquals($params['logo'], $createMeetingParams->getLogo());
$this->assertEquals($params['copyright'], $createMeetingParams->getCopyright());
$this->assertEquals($params['muteOnStart'], $createMeetingParams->isMuteOnStart());
$this->assertEquals($params['lockSettingsDisableCam'], $createMeetingParams->isLockSettingsDisableCam());
$this->assertEquals($params['lockSettingsDisableMic'], $createMeetingParams->isLockSettingsDisableMic());
$this->assertEquals($params['lockSettingsDisablePrivateChat'], $createMeetingParams->isLockSettingsDisablePrivateChat());
$this->assertEquals($params['lockSettingsDisablePublicChat'], $createMeetingParams->isLockSettingsDisablePublicChat());
$this->assertEquals($params['lockSettingsDisableNote'], $createMeetingParams->isLockSettingsDisableNote());
$this->assertEquals($params['lockSettingsHideUserList'], $createMeetingParams->isLockSettingsHideUserList());
$this->assertEquals($params['lockSettingsLockedLayout'], $createMeetingParams->isLockSettingsLockedLayout());
$this->assertEquals($params['lockSettingsLockOnJoin'], $createMeetingParams->isLockSettingsLockOnJoin());
$this->assertEquals($params['lockSettingsLockOnJoinConfigurable'], $createMeetingParams->isLockSettingsLockOnJoinConfigurable());
$this->assertEquals($params['meta_presenter'], $createMeetingParams->getMeta('presenter'));
$this->assertEquals($params['meta_endCallbackUrl'], $createMeetingParams->getMeta('endCallbackUrl'));
......
......@@ -67,27 +67,36 @@ class TestCase extends \PHPUnit\Framework\TestCase
protected function generateCreateParams()
{
return [
'meetingName' => $this->faker->name,
'meetingId' => $this->faker->uuid,
'attendeePassword' => $this->faker->password,
'moderatorPassword' => $this->faker->password,
'autoStartRecording' => $this->faker->boolean(50),
'dialNumber' => $this->faker->phoneNumber,
'voiceBridge' => $this->faker->randomNumber(5),
'webVoice' => $this->faker->word,
'logoutUrl' => $this->faker->url,
'maxParticipants' => $this->faker->numberBetween(2, 100),
'record' => $this->faker->boolean(50),
'duration' => $this->faker->numberBetween(0, 6000),
'welcomeMessage' => $this->faker->sentence,
'allowStartStopRecording' => $this->faker->boolean(50),
'moderatorOnlyMessage' => $this->faker->sentence,
'webcamsOnlyForModerator' => $this->faker->boolean(50),
'logo' => $this->faker->imageUrl(330, 70),
'copyright' => $this->faker->text,
'muteOnStart' => $this->faker->boolean(50),
'meta_presenter' => $this->faker->name,
'meta_endCallbackUrl' => $this->faker->url
'meetingName' => $this->faker->name,
'meetingId' => $this->faker->uuid,
'attendeePassword' => $this->faker->password,
'moderatorPassword' => $this->faker->password,
'autoStartRecording' => $this->faker->boolean(50),
'dialNumber' => $this->faker->phoneNumber,
'voiceBridge' => $this->faker->randomNumber(5),
'webVoice' => $this->faker->word,
'logoutUrl' => $this->faker->url,
'maxParticipants' => $this->faker->numberBetween(2, 100),
'record' => $this->faker->boolean(50),
'duration' => $this->faker->numberBetween(0, 6000),
'welcomeMessage' => $this->faker->sentence,
'allowStartStopRecording' => $this->faker->boolean(50),
'moderatorOnlyMessage' => $this->faker->sentence,
'webcamsOnlyForModerator' => $this->faker->boolean(50),
'logo' => $this->faker->imageUrl(330, 70),
'copyright' => $this->faker->text,
'muteOnStart' => $this->faker->boolean(50),
'lockSettingsDisableCam' => $this->faker->boolean(50),
'lockSettingsDisableMic' => $this->faker->boolean(50),
'lockSettingsDisablePrivateChat' => $this->faker->boolean(50),
'lockSettingsDisablePublicChat' => $this->faker->boolean(50),
'lockSettingsDisableNote' => $this->faker->boolean(50),
'lockSettingsHideUserList' => $this->faker->boolean(50),
'lockSettingsLockedLayout' => $this->faker->boolean(50),
'lockSettingsLockOnJoin' => $this->faker->boolean(50),
'lockSettingsLockOnJoinConfigurable' => $this->faker->boolean(50),
'meta_presenter' => $this->faker->name,
'meta_endCallbackUrl' => $this->faker->url
];
}
......@@ -120,7 +129,12 @@ class TestCase extends \PHPUnit\Framework\TestCase
->setDuration($params['duration'])->setWelcomeMessage($params['welcomeMessage'])->setAutoStartRecording($params['autoStartRecording'])
->setAllowStartStopRecording($params['allowStartStopRecording'])->setModeratorOnlyMessage($params['moderatorOnlyMessage'])
->setWebcamsOnlyForModerator($params['webcamsOnlyForModerator'])->setLogo($params['logo'])->setCopyright($params['copyright'])
->setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->addMeta('presenter', $params['meta_presenter']);
->setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->setLockSettingsDisableCam($params['lockSettingsDisableCam'])
->setLockSettingsDisableMic($params['lockSettingsDisableMic'])->setLockSettingsDisablePrivateChat($params['lockSettingsDisablePrivateChat'])
->setLockSettingsDisablePublicChat($params['lockSettingsDisablePublicChat'])->setLockSettingsDisableNote($params['lockSettingsDisableNote'])
->setLockSettingsHideUserList($params['lockSettingsHideUserList'])->setLockSettingsLockedLayout($params['lockSettingsLockedLayout'])
->setLockSettingsLockOnJoin($params['lockSettingsLockOnJoin'])->setLockSettingsLockOnJoinConfigurable($params['lockSettingsLockOnJoin'])
->addMeta('presenter', $params['meta_presenter']);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment