diff --git a/bbb-lti/grails-app/conf/lti-config.properties b/bbb-lti/grails-app/conf/lti-config.properties index c2a898c2d5a8f1efc3f804cc9487a1ccd0c5776d..6984fce90df8f13dabb302aa1fa86434e59903b5 100644 --- a/bbb-lti/grails-app/conf/lti-config.properties +++ b/bbb-lti/grails-app/conf/lti-config.properties @@ -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} diff --git a/bbb-lti/grails-app/controllers/org/bigbluebutton/ToolController.groovy b/bbb-lti/grails-app/controllers/org/bigbluebutton/ToolController.groovy index fbf2574b934fabc52b72424446c47223102d5e7e..600218fedfb3fb3544939bf3798492c7fb3d19d5 100644 --- a/bbb-lti/grails-app/controllers/org/bigbluebutton/ToolController.groovy +++ b/bbb-lti/grails-app/controllers/org/bigbluebutton/ToolController.groovy @@ -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 + "]" } diff --git a/bbb-lti/grails-app/services/org/bigbluebutton/BigbluebuttonService.groovy b/bbb-lti/grails-app/services/org/bigbluebutton/BigbluebuttonService.groovy index 1a9d90e29febb4a902ba56db71d97efb5e9cab98..297a6ce55422c33579812f4de11ead16c2791793 100644 --- a/bbb-lti/grails-app/services/org/bigbluebutton/BigbluebuttonService.groovy +++ b/bbb-lti/grails-app/services/org/bigbluebutton/BigbluebuttonService.groovy @@ -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 } diff --git a/bbb-lti/grails-app/services/org/bigbluebutton/LtiService.groovy b/bbb-lti/grails-app/services/org/bigbluebutton/LtiService.groovy index 2048d06383b243f2df2467df6ad3cce834b95d65..c78c127ba0eecd608ccd347761b02c4cb495a86b 100644 --- a/bbb-lti/grails-app/services/org/bigbluebutton/LtiService.groovy +++ b/bbb-lti/grails-app/services/org/bigbluebutton/LtiService.groovy @@ -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); + } }