bbb-lti: Fix for issue #3595
This commit is contained in:
parent
79622284ca
commit
c1ffd82ce9
@ -20,14 +20,14 @@
|
||||
|
||||
# BigBlueButton integration information
|
||||
#----------------------------------------------------
|
||||
# This URL is where the BBB client is accessible.
|
||||
# This URL is where the BBB client is accessible.
|
||||
bigbluebuttonURL=http://localhost/bigbluebutton
|
||||
# Salt which is used by 3rd-party apps to authenticate api calls
|
||||
bigbluebuttonSalt=bbb_salt
|
||||
|
||||
# LTI basic information
|
||||
#----------------------------------------------------
|
||||
# This URL is where the LTI plugin is accessible. It can be a different server than the BigBluebutton one
|
||||
# This URL is where the LTI plugin is accessible. It can be a different server than the BigBluebutton one
|
||||
# Only the hostname or IP address is required, plus the port number in case it is other than port 80
|
||||
# e.g. localhost or localhost:port
|
||||
ltiEndPoint=localhost
|
||||
@ -41,6 +41,9 @@ ltiMode=extended
|
||||
# Defines if LTI credentials are required
|
||||
# Format: [false|<true>]
|
||||
ltiRestrictedAccess=true
|
||||
# Sets all the meetings to be recorded by default
|
||||
# Format: [<false>|true]
|
||||
ltiAllRecordedByDefault=false
|
||||
|
||||
#----------------------------------------------------
|
||||
# Inject configuration values into BigbluebuttonSrvice beans
|
||||
@ -53,4 +56,4 @@ beans.ltiService.endPoint=${ltiEndPoint}
|
||||
beans.ltiService.consumers=${ltiConsumers}
|
||||
beans.ltiService.mode=${ltiMode}
|
||||
beans.ltiService.restrictedAccess=${ltiRestrictedAccess}
|
||||
|
||||
beans.ltiService.recordedByDefault=${ltiAllRecordedByDefault}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package org.bigbluebutton
|
||||
/*
|
||||
/*
|
||||
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
|
||||
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
|
||||
@ -83,8 +83,8 @@ class ToolController {
|
||||
result = doJoinMeeting(params)
|
||||
} else {
|
||||
log.debug "LTI service running in extended mode."
|
||||
if ( !Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) ) {
|
||||
log.debug "No bbb_record parameter was sent; immediately redirecting to BBB session!"
|
||||
if ( !Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) && !ltiService.allRecordedByDefault() ) {
|
||||
log.debug "Parameter custom_record was not sent; immediately redirecting to BBB session!"
|
||||
result = doJoinMeeting(params)
|
||||
}
|
||||
}
|
||||
@ -222,7 +222,7 @@ class ToolController {
|
||||
log.debug "Overriding default welcome message with: [" + welcome + "]"
|
||||
}
|
||||
|
||||
if ( params.containsKey(Parameter.CUSTOM_RECORD) && Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) ) {
|
||||
if ( params.containsKey(Parameter.CUSTOM_RECORD) && Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) || ltiService.allRecordedByDefault() ) {
|
||||
welcome += "<br><b>" + message(code: "bigbluebutton.welcome.record") + "</b><br>"
|
||||
log.debug "Adding record warning to welcome message, welcome is now: [" + welcome + "]"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package org.bigbluebutton
|
||||
/*
|
||||
/*
|
||||
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
|
||||
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
|
||||
@ -92,7 +92,7 @@ class BigbluebuttonService {
|
||||
Integer duration = 0
|
||||
if( "extended".equals(mode) ){
|
||||
voiceBridge = getValidatedBBBVoiceBridge(params.get(Parameter.CUSTOM_VOICEBRIDGE))
|
||||
record = getValidatedBBBRecord(params.get(Parameter.CUSTOM_RECORD))
|
||||
record = getValidatedBBBRecord(params.get(Parameter.CUSTOM_RECORD)) || ltiService.allRecordedByDefault()
|
||||
duration = getValidatedBBBDuration(params.get(Parameter.CUSTOM_DURATION))
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ class BigbluebuttonService {
|
||||
private String getValidatedUserId(String userId){
|
||||
return (userId == null)? "": userId
|
||||
}
|
||||
|
||||
|
||||
private Integer getValidatedBBBVoiceBridge(String voiceBridge){
|
||||
return (voiceBridge != null )? voiceBridge.toInteger(): 0
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package org.bigbluebutton
|
||||
/*
|
||||
/*
|
||||
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
|
||||
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
|
||||
@ -32,9 +32,10 @@ class LtiService {
|
||||
def consumers = "demo:welcome"
|
||||
def mode = "simple"
|
||||
def restrictedAccess = "true"
|
||||
def recordedByDefault = "false"
|
||||
|
||||
Map<String, String> consumerMap
|
||||
|
||||
|
||||
def retrieveIconEndpoint() {
|
||||
return endPoint.replaceFirst("tool", "images/icon.ico")
|
||||
}
|
||||
@ -42,16 +43,16 @@ class LtiService {
|
||||
def retrieveBasicLtiEndpoint() {
|
||||
return endPoint
|
||||
}
|
||||
|
||||
|
||||
private Map<String, String> getConsumer(consumerId) {
|
||||
Map<String, String> consumer = null
|
||||
|
||||
|
||||
if( this.consumerMap.containsKey(consumerId) ){
|
||||
consumer = new HashMap<String, String>()
|
||||
consumer.put("key", consumerId);
|
||||
consumer.put("secret", this.consumerMap.get(consumerId))
|
||||
}
|
||||
|
||||
|
||||
return consumer
|
||||
}
|
||||
|
||||
@ -66,19 +67,19 @@ class LtiService {
|
||||
this.consumerMap.put(consumer[0], consumer[1])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String sign(String sharedSecret, String data) throws Exception
|
||||
{
|
||||
Mac mac = setKey(sharedSecret)
|
||||
|
||||
|
||||
// Signed String must be BASE64 encoded.
|
||||
byte[] signBytes = mac.doFinal(data.getBytes("UTF8"));
|
||||
String signature = encodeBase64(signBytes);
|
||||
return signature;
|
||||
}
|
||||
|
||||
|
||||
private Mac setKey(String sharedSecret) throws Exception
|
||||
{
|
||||
Mac mac = Mac.getInstance("HmacSHA1");
|
||||
@ -137,10 +138,14 @@ class LtiService {
|
||||
log.debug("Exception: Message=" + e.getMessage())
|
||||
}
|
||||
|
||||
return ssl_enabled
|
||||
return ssl_enabled
|
||||
}
|
||||
|
||||
def boolean hasRestrictedAccess() {
|
||||
return Boolean.parseBoolean(this.restrictedAccess);
|
||||
}
|
||||
|
||||
def boolean allRecordedByDefault() {
|
||||
return Boolean.parseBoolean(this.recordedByDefault);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user