Merge branch 'capilkey-fix-client-locking' into bbb-2x-mconf

This commit is contained in:
Richard Alam 2017-08-14 07:40:38 -07:00
commit 7e52e01bd1
32 changed files with 137 additions and 481 deletions

View File

@ -66,7 +66,7 @@ case class Permissions(
disablePrivChat: Boolean = false,
disablePubChat: Boolean = false,
lockedLayout: Boolean = false,
lockOnJoin: Boolean = false,
lockOnJoin: Boolean = true,
lockOnJoinConfigurable: Boolean = false
)

View File

@ -5,8 +5,7 @@ import org.bigbluebutton.core.running.MeetingActor
trait LayoutApp2x
extends BroadcastLayoutMsgHdlr
with GetCurrentLayoutReqMsgHdlr
with LockLayoutMsgHdlr {
with GetCurrentLayoutReqMsgHdlr {
this: MeetingActor =>

View File

@ -1,37 +0,0 @@
package org.bigbluebutton.core.apps.layout
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.models.Layouts
import org.bigbluebutton.core.running.OutMsgRouter
trait LockLayoutMsgHdlr {
this: LayoutApp2x =>
val outGW: OutMsgRouter
def handleLockLayoutMsg(msg: LockLayoutMsg): Unit = {
def broadcastEvent(msg: LockLayoutMsg): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(LockLayoutEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(LockLayoutEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = LockLayoutEvtMsgBody(msg.header.userId, msg.body.lock, affectedUsers)
val event = LockLayoutEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}
Layouts.applyToViewersOnly(liveMeeting.layouts, msg.body.viewersOnly)
liveMeeting.lockLayout(msg.body.lock)
broadcastEvent(msg)
for {
newLayout <- msg.body.layout
} yield {
Layouts.setCurrentLayout(liveMeeting.layouts, newLayout, msg.header.userId)
sendBroadcastLayoutEvtMsg(msg.header.userId)
}
}
}

View File

@ -1,8 +1,10 @@
package org.bigbluebutton.core2.message.handlers
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.api.Permissions
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
trait ChangeLockSettingsInMeetingCmdMsgHdlr {
this: MeetingActor =>
@ -20,8 +22,10 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr {
lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable
)
if (!liveMeeting.permissionsEqual(settings)) {
liveMeeting.newPermissions(settings)
if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) {
MeetingStatus2x.initializePermissions(liveMeeting.status)
MeetingStatus2x.setPermissions(liveMeeting.status, settings)
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
@ -49,23 +53,6 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr {
)
outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body)))
processLockLayout(settings.lockedLayout, msg.body.setBy)
}
}
def processLockLayout(lock: Boolean, setBy: String): Unit = {
liveMeeting.lockLayout(lock)
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, setBy)
val envelope = BbbCoreEnvelope(LockLayoutEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(LockLayoutEvtMsg.NAME, liveMeeting.props.meetingProp.intId, setBy)
val body = LockLayoutEvtMsgBody(setBy, lock, affectedUsers)
val event = LockLayoutEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}
}

View File

@ -12,7 +12,7 @@ trait GetLockSettingsReqMsgHdlr {
def handleGetLockSettingsReqMsg(msg: GetLockSettingsReqMsg): Unit = {
def build(meetingId: String, requestedBy: String, settings: Permissions): BbbCommonEnvCoreMsg = {
def buildLockSettingsResp(meetingId: String, requestedBy: String, settings: Permissions): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
val envelope = BbbCoreEnvelope(GetLockSettingsRespMsg.NAME, routing)
val body = GetLockSettingsRespMsgBody(
@ -27,8 +27,23 @@ trait GetLockSettingsReqMsgHdlr {
BbbCommonEnvCoreMsg(envelope, event)
}
val settings = MeetingStatus2x.getPermissions(liveMeeting.status)
val event = build(props.meetingProp.intId, msg.body.requesterId, settings)
outGW.send(event)
def buildNotInitializedResp(meetingId: String, requestedBy: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
val envelope = BbbCoreEnvelope(LockSettingsNotInitializedRespMsg.NAME, routing)
val body = LockSettingsNotInitializedRespMsgBody(requestedBy)
val header = BbbClientMsgHeader(LockSettingsNotInitializedRespMsg.NAME, meetingId, requestedBy)
val event = LockSettingsNotInitializedRespMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
if (MeetingStatus2x.permisionsInitialized(liveMeeting.status)) {
val settings = MeetingStatus2x.getPermissions(liveMeeting.status)
val event = buildLockSettingsResp(props.meetingProp.intId, msg.body.requesterId, settings)
outGW.send(event)
} else {
val event = buildNotInitializedResp(props.meetingProp.intId, msg.body.requesterId)
outGW.send(event)
}
}
}

View File

@ -139,8 +139,6 @@ class ReceivedJsonMsgHandlerActor(
// Layout
case GetCurrentLayoutReqMsg.NAME =>
routeGenericMsg[GetCurrentLayoutReqMsg](envelope, jsonNode)
case LockLayoutMsg.NAME =>
routeGenericMsg[LockLayoutMsg](envelope, jsonNode)
case BroadcastLayoutMsg.NAME =>
routeGenericMsg[BroadcastLayoutMsg](envelope, jsonNode)
@ -238,8 +236,6 @@ class ReceivedJsonMsgHandlerActor(
// Lock settings
case LockUserInMeetingCmdMsg.NAME =>
routeGenericMsg[LockUserInMeetingCmdMsg](envelope, jsonNode)
case IsMeetingLockedReqMsg.NAME =>
routeGenericMsg[IsMeetingLockedReqMsg](envelope, jsonNode)
case ChangeLockSettingsInMeetingCmdMsg.NAME =>
routeGenericMsg[ChangeLockSettingsInMeetingCmdMsg](envelope, jsonNode)
case LockUsersInMeetingCmdMsg.NAME =>

View File

@ -39,7 +39,7 @@ trait HandlerHelpers extends SystemConfiguration {
waitingForAcceptance = regUser.waitingForAcceptance,
emoji = "none",
presenter = false,
locked = false,
locked = MeetingStatus2x.getPermissions(liveMeeting.status).lockOnJoin,
avatar = regUser.avatarURL
)
}
@ -91,7 +91,7 @@ trait HandlerHelpers extends SystemConfiguration {
moderator <- Users2x.findModerator(liveMeeting.users2x)
newPresenter <- Users2x.makePresenter(liveMeeting.users2x, moderator.intId)
} yield {
sendPresenterAssigned(outGW, meetingId, newPresenter.intId, newPresenter.name, newPresenter.name)
sendPresenterAssigned(outGW, meetingId, newPresenter.intId, newPresenter.name, newPresenter.intId)
}
}

View File

@ -7,33 +7,19 @@ import org.bigbluebutton.core.models._
import org.bigbluebutton.core2.MeetingStatus2x
class LiveMeeting(
val props: DefaultProps,
val status: MeetingStatus2x,
val screenshareModel: ScreenshareModel,
val chatModel: ChatModel,
val layouts: Layouts,
val registeredUsers: RegisteredUsers,
val polls: Polls, // 2x
val wbModel: WhiteboardModel,
val presModel: PresentationModel,
val captionModel: CaptionModel,
val notesModel: SharedNotesModel,
val webcams: Webcams,
val voiceUsers: VoiceUsers,
val users2x: Users2x,
val guestsWaiting: GuestsWaiting
) {
def lockLayout(lock: Boolean) {
MeetingStatus2x.lockLayout(status, lock)
}
def newPermissions(np: Permissions) {
MeetingStatus2x.setPermissions(status, np)
}
def permissionsEqual(other: Permissions): Boolean = {
MeetingStatus2x.permissionsEqual(status, other)
}
}
val props: DefaultProps,
val status: MeetingStatus2x,
val screenshareModel: ScreenshareModel,
val chatModel: ChatModel,
val layouts: Layouts,
val registeredUsers: RegisteredUsers,
val polls: Polls, // 2x
val wbModel: WhiteboardModel,
val presModel: PresentationModel,
val captionModel: CaptionModel,
val notesModel: SharedNotesModel,
val webcams: Webcams,
val voiceUsers: VoiceUsers,
val users2x: Users2x,
val guestsWaiting: GuestsWaiting
)

View File

@ -34,6 +34,7 @@ import scala.concurrent.duration._
import org.bigbluebutton.core2.testdata.FakeTestData
import org.bigbluebutton.core.apps.layout.LayoutApp2x
import org.bigbluebutton.core.apps.meeting.SyncGetMeetingInfoRespMsgHdlr
import org.bigbluebutton.core.apps.users.ChangeLockSettingsInMeetingCmdMsgHdlr
object MeetingActor {
def props(
@ -240,7 +241,6 @@ class MeetingActor(
// Layout
case m: GetCurrentLayoutReqMsg => handleGetCurrentLayoutReqMsg(m)
case m: LockLayoutMsg => handleLockLayoutMsg(m)
case m: BroadcastLayoutMsg => handleBroadcastLayoutMsg(m)
// Lock Settings

View File

@ -46,7 +46,6 @@ object MeetingStatus2x {
def audioSettingsInitialized(status: MeetingStatus2x): Boolean = status.audioSettingsInited
def initializeAudioSettings(status: MeetingStatus2x) = status.audioSettingsInited = true
def permissionsEqual(status: MeetingStatus2x, other: Permissions): Boolean = status.permissions == other
def lockLayout(status: MeetingStatus2x, lock: Boolean) = status.permissions = status.permissions.copy(lockedLayout = lock)
def getPermissions(status: MeetingStatus2x): Permissions = status.permissions
def setPermissions(status: MeetingStatus2x, p: Permissions) = status.permissions = p
def meetingHasEnded(status: MeetingStatus2x) = status.meetingEnded = true

View File

@ -6,10 +6,6 @@ object GetCurrentLayoutReqMsg { val NAME = "GetCurrentLayoutReqMsg" }
case class GetCurrentLayoutReqMsg(header: BbbClientMsgHeader, body: GetCurrentLayoutReqMsgBody) extends StandardMsg
case class GetCurrentLayoutReqMsgBody()
object LockLayoutMsg { val NAME = "LockLayoutMsg" }
case class LockLayoutMsg(header: BbbClientMsgHeader, body: LockLayoutMsgBody) extends StandardMsg
case class LockLayoutMsgBody(lock: Boolean, viewersOnly: Boolean, layout: Option[String])
object BroadcastLayoutMsg { val NAME = "BroadcastLayoutMsg" }
case class BroadcastLayoutMsg(header: BbbClientMsgHeader, body: BroadcastLayoutMsgBody) extends StandardMsg
case class BroadcastLayoutMsgBody(layout: String)
@ -21,8 +17,4 @@ case class GetCurrentLayoutRespMsgBody(layout: String, locked: Boolean, setByUse
object BroadcastLayoutEvtMsg { val NAME = "BroadcastLayoutEvtMsg" }
case class BroadcastLayoutEvtMsg(header: BbbClientMsgHeader, body: BroadcastLayoutEvtMsgBody) extends BbbCoreMsg
case class BroadcastLayoutEvtMsgBody(layout: String, locked: Boolean, setByUserId: String, applyTo: Vector[String])
object LockLayoutEvtMsg { val NAME = "LockLayoutEvtMsg" }
case class LockLayoutEvtMsg(header: BbbClientMsgHeader, body: LockLayoutEvtMsgBody) extends BbbCoreMsg
case class LockLayoutEvtMsgBody(setById: String, locked: Boolean, applyTo: Vector[String])
case class BroadcastLayoutEvtMsgBody(layout: String, locked: Boolean, setByUserId: String, applyTo: Vector[String])

View File

@ -179,18 +179,6 @@ object LockUsersInMeetingCmdMsg { val NAME = "LockUsersInMeetingCmdMsg" }
case class LockUsersInMeetingCmdMsg(header: BbbClientMsgHeader, body: LockUsersInMeetingCmdMsgBody) extends StandardMsg
case class LockUsersInMeetingCmdMsgBody(lock: Boolean, lockedBy: String, except: Vector[String])
/**
* Sent by client to check if meeting is locked.
*/
object IsMeetingLockedReqMsg { val NAME = "IsMeetingLockedReqMsg" }
case class IsMeetingLockedReqMsg(header: BbbClientMsgHeader, body: IsMeetingLockedReqMsgBody) extends StandardMsg
case class IsMeetingLockedReqMsgBody(requesterId: String)
object IsMeetingLockedRespMsg { val NAME = "IsMeetingLockedRespMsg" }
case class IsMeetingLockedRespMsg(header: BbbClientMsgHeader, body: IsMeetingLockedRespMsgBody) extends BbbCoreMsg
case class IsMeetingLockedRespMsgBody(locked: Boolean)
/**
* Sent by client to set lock setting.
*/
@ -224,6 +212,9 @@ case class GetLockSettingsRespMsgBody(disableCam: Boolean, disableMic: Boolean,
disablePubChat: Boolean, lockedLayout: Boolean, lockOnJoin: Boolean,
lockOnJoinConfigurable: Boolean)
object LockSettingsNotInitializedRespMsg { val NAME = "LockSettingsNotInitializedRespMsg" }
case class LockSettingsNotInitializedRespMsg(header: BbbClientMsgHeader, body: LockSettingsNotInitializedRespMsgBody) extends BbbCoreMsg
case class LockSettingsNotInitializedRespMsgBody(userId: String)
/**
* Sent from client to logout and end meeting.

View File

@ -155,11 +155,11 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
}
Boolean guest = false;
if (params.length >= 9 && ((Boolean) params[9])) {
if (params.length >= 8 && ((Boolean) params[8])) {
guest = true;
}
String authToken = ((String) params[10]).toString();
String authToken = ((String) params[9]).toString();
String userId = internalUserID;
String sessionId = Red5.getConnectionLocal().getSessionId();

View File

@ -18,8 +18,8 @@
<meeting muteOnStart="false" />
<breakoutRooms enabled="true" record="false" />
<logging enabled="true" target="trace" level="info" format="{dateUTC} {time} :: {name} :: [{logLevel}] {message}" uri="http://HOST/log" logPattern=".*"/>
<lock disableCamForLockedUsers="false" disableMicForLockedUsers="false" disablePrivateChatForLockedUsers="false"
disablePublicChatForLockedUsers="false" lockLayoutForLockedUsers="false" lockOnJoin="true" lockOnJoinConfigurable="false"/>
<lock disableCam="false" disableMic="false" disablePrivateChat="false"
disablePublicChat="false" lockedLayout="false" lockOnJoin="true" lockOnJoinConfigurable="false"/>
<modules>

View File

@ -18,11 +18,14 @@
*/
package org.bigbluebutton.core
{
import com.asfusion.mate.events.Dispatcher;
import mx.collections.ArrayCollection;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.model.LiveMeeting;
import org.bigbluebutton.core.model.users.User2x;
import org.bigbluebutton.core.model.users.VoiceUser2x;
@ -30,7 +33,7 @@ package org.bigbluebutton.core
import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.main.model.options.LockOptions;
import org.bigbluebutton.main.model.users.BreakoutRoom;
import org.bigbluebutton.util.SessionTokenUtil;
import org.bigbluebutton.util.SessionTokenUtil;
public class UsersUtil
{
@ -318,19 +321,6 @@ package org.bigbluebutton.core
LiveMeeting.inst().me.applyLockSettings();
}
/**
* Read default lock settings from config.xml
* */
public static function configLockSettings():void {
var lockOptions:LockOptions = Options.getOptions(LockOptions) as LockOptions;
var lockSettings:LockSettingsVO = new LockSettingsVO(lockOptions.disableCam, lockOptions.disableMic,
lockOptions.disablePrivateChat, lockOptions.disablePublicChat,
lockOptions.lockedLayout, lockOptions.lockOnJoin,
lockOptions.lockOnJoinConfigurable);
setLockSettings(lockSettings);
}
public static function getLockSettings():LockSettingsVO {
return LiveMeeting.inst().meetingStatus.lockSettings;
}
@ -338,7 +328,20 @@ package org.bigbluebutton.core
public static function setLockSettings(lockSettings:LockSettingsVO):void {
LiveMeeting.inst().meetingStatus.lockSettings = lockSettings;
applyLockSettings();
}
}
public static function lockSettingsNotInitialized():void {
var lockOptions:LockOptions = Options.getOptions(LockOptions) as LockOptions;
var lockSettings:LockSettingsVO = new LockSettingsVO(lockOptions.disableCam, lockOptions.disableMic,
lockOptions.disablePrivateChat, lockOptions.disablePublicChat,
lockOptions.lockedLayout, lockOptions.lockOnJoin,
lockOptions.lockOnJoinConfigurable);
var event:LockControlEvent = new LockControlEvent(LockControlEvent.SAVE_LOCK_SETTINGS);
event.payload = lockSettings.toMap();
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(event);
}
public static function getBreakoutRoom(id: String): BreakoutRoom {
return LiveMeeting.inst().breakoutRooms.getBreakoutRoom(id);

View File

@ -1,30 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.connection.messages.layout {
import org.bigbluebutton.core.connection.messages.BbbCommonMsg;
public class LockLayoutMsg extends BbbCommonMsg {
public var body:LockLayoutMsgBody;
public function LockLayoutMsg(body:LockLayoutMsgBody) {
super();
this.body = body;
}
}
}

View File

@ -1,35 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.connection.messages.layout {
public class LockLayoutMsgBody {
public var lock:Boolean;
public var viewersOnly:Boolean;
public var layout:String;
public function LockLayoutMsgBody(lock:Boolean, viewersOnly:Boolean, layout:String) {
this.lock = lock;
this.viewersOnly = viewersOnly;
this.layout = layout;
}
}
}

View File

@ -9,6 +9,6 @@ package org.bigbluebutton.core.model
public var isMeetingMuted: Boolean = false;
public var guestPolicy: String = "ASK_MODERATOR";
public var guestPolicySetBy: String = null;
public var lockSettings:LockSettingsVO;
public var lockSettings:LockSettingsVO = new LockSettingsVO();
}
}

View File

@ -1,112 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.model
{
import com.asfusion.mate.events.Dispatcher;
import mx.collections.ArrayCollection;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.events.VoiceConfEvent;
import org.bigbluebutton.core.model.users.VoiceUser2x;
import org.bigbluebutton.core.vo.CameraSettingsVO;
import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent;
public class MyStatus {
// Flag to tell that user is in the process of leaving the meeting.
public var isLeavingFlag:Boolean = false;
public var disableMyCam:Boolean = false;
public var disableMyMic:Boolean = false;
public var disableMyPrivateChat:Boolean = false;
public var disableMyPublicChat:Boolean = false;
public var lockedLayout:Boolean = false;
public var iAskedToLogout:Boolean;
public var userEjectedFromMeeting:Boolean = false;
public var userLocked: Boolean = false;
public var voiceJoined: Boolean = false;
public var voiceMuted: Boolean = false;
public var isPresenter: Boolean = false;
public var myEmojiStatus: String = "none";
public var authTokenValid: Boolean = false;
public var waitingForApproval: Boolean;
private var _myCamSettings:ArrayCollection = new ArrayCollection();
public function addCameraSettings(camSettings: CameraSettingsVO): void {
if(!_myCamSettings.contains(camSettings)) {
_myCamSettings.addItem(camSettings);
}
}
public function removeCameraSettings(camIndex:int): void {
if (camIndex != -1) {
for(var i:int = 0; i < _myCamSettings.length; i++) {
if (_myCamSettings.getItemAt(i) != null && _myCamSettings.getItemAt(i).camIndex == camIndex) {
_myCamSettings.removeItemAt(i);
return;
}
}
}
}
public function myCamSettings():ArrayCollection {
return _myCamSettings;
}
public function applyLockSettings():void {
var lockSettings:LockSettingsVO = UsersUtil.getLockSettings();
var amNotModerator:Boolean = !UsersUtil.amIModerator();
var amNotPresenter:Boolean = !UsersUtil.amIPresenter();
var lockAppliesToMe:Boolean = amNotModerator && amNotPresenter && userLocked;
disableMyCam = lockAppliesToMe && lockSettings.getDisableCam();
disableMyMic = lockAppliesToMe && lockSettings.getDisableMic();
disableMyPrivateChat = lockAppliesToMe && lockSettings.getDisablePrivateChat();
disableMyPublicChat = lockAppliesToMe && lockSettings.getDisablePublicChat();
lockedLayout = lockAppliesToMe && lockSettings.getLockedLayout();
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new LockControlEvent(LockControlEvent.CHANGED_LOCK_SETTINGS));
if (lockAppliesToMe) {
//If it's sharing webcam, stop it
if (disableMyCam && LiveMeeting.inst().webcams.getStreamsForUser(LiveMeeting.inst().me.id)) {
dispatcher.dispatchEvent(new ClosePublishWindowEvent());
}
//If it's sharing microphone, mute it
var myVoiceUser: VoiceUser2x = LiveMeeting.inst().voiceUsers.getUser(LiveMeeting.inst().me.id);
if (disableMyMic && (myVoiceUser != null) && ! myVoiceUser.muted) {
var e:VoiceConfEvent = new VoiceConfEvent(VoiceConfEvent.MUTE_USER);
e.userid = UsersUtil.getMyUserID();
e.mute = true;
dispatcher.dispatchEvent(e);
}
}
}
}
}

View File

@ -20,21 +20,21 @@ package org.bigbluebutton.core.vo
{
public class LockSettingsVO
{
private var lockOnJoinConfigurable:Boolean = true;
private var disableCam:Boolean = false;
private var disableMic:Boolean = false;
private var disablePrivateChat:Boolean = false;
private var disablePublicChat:Boolean = false;
private var lockedLayout:Boolean = false;
private var lockOnJoin:Boolean = false;
private var lockOnJoinConfigurable:Boolean;
private var disableCam:Boolean;
private var disableMic:Boolean;
private var disablePrivateChat:Boolean;
private var disablePublicChat:Boolean;
private var lockedLayout:Boolean;
private var lockOnJoin:Boolean;
public function LockSettingsVO(pDisableCam:Boolean,
pDisableMic:Boolean,
pDisablePrivateChat:Boolean,
pDisablePublicChat:Boolean,
pLockLayout: Boolean,
pLockOnJoin:Boolean,
pLockOnJoinConfigurable:Boolean)
public function LockSettingsVO(pDisableCam:Boolean=false,
pDisableMic:Boolean=false,
pDisablePrivateChat:Boolean=false,
pDisablePublicChat:Boolean=false,
pLockLayout: Boolean=false,
pLockOnJoin:Boolean=false,
pLockOnJoinConfigurable:Boolean=false)
{
this.disableCam = pDisableCam;
this.disableMic = pDisableMic;

View File

@ -41,7 +41,6 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.core.managers.ReconnectionManager;
import org.bigbluebutton.core.model.LiveMeeting;
import org.bigbluebutton.core.services.BandwidthMonitor;
import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.model.options.ApplicationOptions;
@ -433,13 +432,12 @@ package org.bigbluebutton.main.model.users
var muteOnStart: Boolean = LiveMeeting.inst().meeting.muteOnStart;
var guest: Boolean = LiveMeeting.inst().me.guest;
var authToken: String = LiveMeeting.inst().me.authToken;
var lockSettings: LockSettingsVO = LiveMeeting.inst().meetingStatus.lockSettings;
_netConnection.connect(bbbAppsUrl, username, role,
intMeetingId, voiceConf,
recorded, extUserId,
intUserId, muteOnStart,
lockSettings.toMap(), guest, authToken);
guest, authToken);
} catch(e:ArgumentError) {
// Invalid parameters.

View File

@ -76,6 +76,7 @@ package org.bigbluebutton.main.model.users
sender.queryForParticipants();
sender.queryForRecordingStatus();
sender.queryForGuestPolicy();
sender.getLockSettings();
if (!LiveMeeting.inst().meeting.isBreakout) {
sender.queryForBreakoutRooms(LiveMeeting.inst().meeting.internalId);

View File

@ -222,8 +222,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
updateCopyrightText();
loadBackground();
UsersUtil.configLockSettings();
showToolbarOpt = layoutOptions.showToolbar;
if (!showToolbarOpt) {
toolbarHeight = 0;

View File

@ -1,19 +0,0 @@
package org.bigbluebutton.modules.layout.events
{
import flash.events.Event;
public class LayoutLockedEvent extends Event
{
public static const LAYOUT_LOCKED:String = "layout locked event";
public var locked:Boolean;
public var setById:String;
public function LayoutLockedEvent(locked:Boolean, setById: String)
{
super(LAYOUT_LOCKED, true, false);
this.locked = locked;
this.setById = setById;
}
}
}

View File

@ -1,23 +0,0 @@
package org.bigbluebutton.modules.layout.events
{
import flash.events.Event;
import org.bigbluebutton.modules.layout.model.LayoutDefinition;
public class LockLayoutEvent extends Event
{
public static const LOCK_LAYOUT:String = "lock layout request event";
public var lock:Boolean;
public var viewersOnly:Boolean;
public var layout:LayoutDefinition;
public function LockLayoutEvent(lock:Boolean, viewersOnly: Boolean, layout: LayoutDefinition)
{
super(LOCK_LAYOUT, true, false);
this.lock = lock;
this.viewersOnly = viewersOnly;
this.layout = layout;
}
}
}

View File

@ -47,11 +47,9 @@ package org.bigbluebutton.modules.layout.managers
import org.bigbluebutton.main.model.options.LayoutOptions;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.bigbluebutton.modules.layout.events.LayoutFromRemoteEvent;
import org.bigbluebutton.modules.layout.events.LayoutLockedEvent;
import org.bigbluebutton.modules.layout.events.LayoutNameInUseEvent;
import org.bigbluebutton.modules.layout.events.LayoutsLoadedEvent;
import org.bigbluebutton.modules.layout.events.LayoutsReadyEvent;
import org.bigbluebutton.modules.layout.events.LockLayoutEvent;
import org.bigbluebutton.modules.layout.events.RemoteSyncLayoutEvent;
import org.bigbluebutton.modules.layout.events.SyncLayoutEvent;
import org.bigbluebutton.modules.layout.model.LayoutDefinition;
@ -351,16 +349,6 @@ package org.bigbluebutton.modules.layout.managers
return _applyingLayoutCounter == 0;
}
public function handleLockLayoutEvent(e: LockLayoutEvent):void {
}
public function handleLayoutLockedEvent(e: LayoutLockedEvent):void {
_locked = e.locked;
checkPermissionsOverAllWindows();
}
public function lockSettingsChanged():void {
_locked = LiveMeeting.inst().me.lockedLayout;
checkPermissionsOverAllWindows();

View File

@ -31,8 +31,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.layout.events.ComboBoxCreatedEvent;
import org.bigbluebutton.modules.layout.events.ConnectionEvent;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.bigbluebutton.modules.layout.events.LayoutLockedEvent;
import org.bigbluebutton.modules.layout.events.LockLayoutEvent;
import org.bigbluebutton.modules.layout.events.LayoutFromRemoteEvent;
import org.bigbluebutton.modules.layout.events.RemoteSyncLayoutEvent;
import org.bigbluebutton.modules.layout.events.StartLayoutModuleEvent;
@ -86,15 +84,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{LayoutManager}" method="broadcastLayout" />
</EventHandlers>
<EventHandlers type="{LayoutLockedEvent.LAYOUT_LOCKED}">
<MethodInvoker generator="{LayoutManager}" method="handleLayoutLockedEvent" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{LockLayoutEvent.LOCK_LAYOUT}">
<MethodInvoker generator="{LayoutService}" method="handleLockLayoutEvent" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{SyncLayoutEvent.SYNC_LAYOUT_EVENT}">
<MethodInvoker generator="{LayoutService}" method="broadcastLayout" arguments="{event.layout}" />
</EventHandlers>

View File

@ -20,7 +20,6 @@ package org.bigbluebutton.modules.layout.services
{
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.modules.layout.events.LockLayoutEvent;
import org.bigbluebutton.modules.layout.model.LayoutDefinition;
public class LayoutService
@ -38,14 +37,5 @@ package org.bigbluebutton.modules.layout.services
LOGGER.debug("broadcast layout");
sender.broadcastLayout(layout);
}
private function handleLockLayoutEvent(e: LockLayoutEvent):void {
}
private function lockLayout(lock:Boolean, viewersOnly:Boolean, layout:LayoutDefinition=null):void {
LOGGER.debug("lock layout");
sender.lockLayout(lock, viewersOnly, layout);
}
}
}

View File

@ -12,7 +12,6 @@ package org.bigbluebutton.modules.layout.services {
import org.bigbluebutton.main.model.users.IMessageListener;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.bigbluebutton.modules.layout.events.LayoutFromRemoteEvent;
import org.bigbluebutton.modules.layout.events.LayoutLockedEvent;
import org.bigbluebutton.modules.layout.events.RemoteSyncLayoutEvent;
import org.bigbluebutton.modules.layout.model.LayoutDefinition;
import org.bigbluebutton.util.i18n.ResourceUtil;
@ -37,9 +36,6 @@ package org.bigbluebutton.modules.layout.services {
case "BroadcastLayoutEvtMsg":
handleBroadcastLayoutEvtMsg(message);
break;
case "LockLayoutEvtMsg":
handleLockLayoutEvtMsg(message);
break;
/*
case "getCurrentLayoutResponse":
handleGetCurrentLayoutResponse(message);
@ -61,11 +57,6 @@ package org.bigbluebutton.modules.layout.services {
_applyFirstLayoutTimer.start();
}
private function handleLockLayoutEvtMsg(message:Object):void {
if (message.body.hasOwnProperty("locked") && message.body.hasOwnProperty("setById"))
lockLayout(message.body.locked, message.body.setById);
}
private function handleBroadcastLayoutEvtMsg(message:Object):void {
var affectedUsers:Array = message.body.applyTo as Array;
var appliesToMe:Boolean = false;
@ -105,7 +96,6 @@ package org.bigbluebutton.modules.layout.services {
handleSyncLayout(message);
}
handleLayoutLocked(message);
_dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.LAYOUT_MODULE_STARTED));
}
@ -131,16 +121,6 @@ package org.bigbluebutton.modules.layout.services {
_dispatcher.dispatchEvent(redefineLayout);
}
private function handleLayoutLocked(message:Object):void {
if (message.hasOwnProperty("locked") && message.hasOwnProperty("setById"))
lockLayout(message.locked, message.setById);
}
private function lockLayout(locked:Boolean, setById:String):void {
LOGGER.debug("LayoutService: received locked layout message. locked = [{0}] by= [{1}]", [locked, setById]);
_dispatcher.dispatchEvent(new LayoutLockedEvent(locked, setById));
}
}
}

View File

@ -7,8 +7,6 @@ package org.bigbluebutton.modules.layout.services {
import org.bigbluebutton.core.connection.messages.layout.BroadcastLayoutMsgBody;
import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutReqMsg;
import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutReqMsgBody;
import org.bigbluebutton.core.connection.messages.layout.LockLayoutMsg;
import org.bigbluebutton.core.connection.messages.layout.LockLayoutMsgBody;
import org.bigbluebutton.core.managers.ConnectionManager;
import org.bigbluebutton.modules.layout.model.LayoutDefinition;
@ -42,19 +40,5 @@ package org.bigbluebutton.modules.layout.services {
LOGGER.info(JSON.stringify(logData));
}, JSON.stringify(message));
}
public function lockLayout(lock:Boolean, viewersOnly:Boolean, layout:LayoutDefinition = null):void {
var body:LockLayoutMsgBody = new LockLayoutMsgBody(lock, viewersOnly, layout != null ? layout.toXml().toXMLString() : null);
var message:LockLayoutMsg = new LockLayoutMsg(body);
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(function(result:String):void { // On successful result
}, function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.message = "Error occured locking layout.";
LOGGER.info(JSON.stringify(logData));
}, JSON.stringify(message));
}
}
}

View File

@ -147,6 +147,12 @@ package org.bigbluebutton.modules.users.services
case "UserLockedInMeetingEvtMsg":
handleUserLocked(message);
break;
case "GetLockSettingsRespMsg":
handleGetLockSettings(message);
break;
case "LockSettingsNotInitializedRespMsg":
handleLockSettingsNotInitialized(message);
break;
// Breakout room feature
case "BreakoutRoomsListEvtMsg":
handleBreakoutRoomsList(message)
@ -365,16 +371,21 @@ package org.bigbluebutton.modules.users.services
joinEvent.userID = user2x.intId;
dispatcher.dispatchEvent(joinEvent);
if (UsersUtil.isMe(intId) && wasPresenterBefore != presenter) {
UsersUtil.setUserAsPresent(intId, false);
sendSwitchedPresenterEvent(false, intId);
if (UsersUtil.isMe(intId)) {
if (wasPresenterBefore != presenter) {
UsersUtil.setUserAsPresent(intId, false);
sendSwitchedPresenterEvent(false, intId);
var e:MadePresenterEvent = new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_VIEWER_MODE);
e.userID = intId;
e.presenterName = name;
e.assignedBy = intId;
dispatcher.dispatchEvent(e);
dispatcher.dispatchEvent(new UserStatusChangedEvent(intId));
var e:MadePresenterEvent = new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_VIEWER_MODE);
e.userID = intId;
e.presenterName = name;
e.assignedBy = intId;
dispatcher.dispatchEvent(e);
dispatcher.dispatchEvent(new UserStatusChangedEvent(intId));
}
LiveMeeting.inst().me.locked = locked;
UsersUtil.applyLockSettings();
}
}
@ -487,8 +498,12 @@ package org.bigbluebutton.modules.users.services
if(user.locked != locked) {
if (UsersUtil.isMe(user.intId)) {
LiveMeeting.inst().me.locked = locked;
UsersUtil.applyLockSettings();
}
user.locked = locked;
dispatcher.dispatchEvent(new UserStatusChangedEvent(user.intId));
}
@ -496,7 +511,7 @@ package org.bigbluebutton.modules.users.services
}
private function handlePermissionsSettingsChanged(msg:Object):void {
//LOGGER.debug("handlePermissionsSettingsChanged {0} \n", [msg.msg]);
LOGGER.debug("handlePermissionsSettingsChanged {0} \n", [msg.body]);
var body:Object = msg.body as Object;
var lockSettings:LockSettingsVO = new LockSettingsVO(
@ -510,6 +525,27 @@ package org.bigbluebutton.modules.users.services
UsersUtil.setLockSettings(lockSettings);
}
private function handleGetLockSettings(msg:Object):void {
LOGGER.debug("handleGetLockSettings {0} \n", [msg.body]);
var body:Object = msg.body as Object;
var lockSettings:LockSettingsVO = new LockSettingsVO(
body.disableCam as Boolean,
body.disableMic as Boolean,
body.disablePrivChat as Boolean,
body.disablePubChat as Boolean,
body.lockedLayout as Boolean,
body.lockOnJoin as Boolean,
body.lockOnJoinConfigurable as Boolean);
UsersUtil.setLockSettings(lockSettings);
}
private function handleLockSettingsNotInitialized(msg:Object):void {
LOGGER.debug("handleLockSettingsNotInitialized received");
UsersUtil.lockSettingsNotInitialized();
}
private function sendRecordingStatusUpdate(recording:Boolean):void {
LiveMeeting.inst().meetingStatus.isRecording = recording;

View File

@ -427,27 +427,6 @@ package org.bigbluebutton.modules.users.services
},
JSON.stringify(message)
);
}
public function getRoomLockState():void{
var message:Object = {
header: {name: "IsMeetingLockedReqMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {requesterId: UsersUtil.getMyUserID()}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(
function(result:String):void { // On successful result
},
function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.message = "Error occured getting lock state.";
LOGGER.info(JSON.stringify(logData));
},
JSON.stringify(message)
);
}
/**