Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Something to discuss:
Courses can be protected against unauthorized access by two methods: access code and the password protection from BPS.
This confuses the users (authors). They don't know which method to use, they ask which one they should use and in the worst case they use both methods
In my opinion, the password protection has no advantage against the access code. But there can be scenarios where the password protection is useful on structure elements. So I thought about a solution to hide the password protection from root elements and display it on subsequent structure elements. It leaves password protected root elements untouched when they are already configured with password protection.
It works fine for us, so I think about rolling it out with OO 9.
Here's the patch:
diff -r dfce0100e6fa src/main/java/org/olat/course/condition/ConditionEditController.java
— a/src/main/java/org/olat/course/condition/ConditionEditController.java Thu Sep 05 13:12:23 2013 +0200
+++ b/src/main/java/org/olat/course/condition/ConditionEditController.java Wed Sep 25 13:35:25 2013 +0200
@@ -130,6 +130,7 @@
// <OLATCE-91>
CourseEditorEnv courseEnv = euce.getCourseEditorEnv();
CourseNode courseNode = courseEnv.getNode(courseEnv.getCurrentCourseNodeId());
+ boolean isRootNode = courseEnv.getRootNodeId().equals(courseNode.getIdent());
if(showPasswordAccess && courseNode instanceof AbstractAccessableCourseNode){
AbstractAccessableCourseNode accessableCourseNode = (AbstractAccessableCourseNode)courseNode;
for(AdditionalCondition addCond : accessableCourseNode.getAdditionalConditions())
}
- if(passwordCondition == null) {
+ if ((passwordCondition == null) && (!isRootNode)) { passwordCondition = new PasswordCondition(); accessableCourseNode.getAdditionalConditions().add(passwordCondition); } - passwordConditionEditController = passwordCondition.getEditorComponent(ureq, wControl);
- listenTo(passwordConditionEditController);
+ if ((passwordCondition != null) && (isRootNode))Unknown macro: {+ String pass = passwordCondition.getPassword();+ if ((pass == null) || (pass.length() == 0)) { + accessableCourseNode.getAdditionalConditions().remove(passwordCondition); + passwordCondition = null; + }+ }+ if (passwordCondition != null)
{ + passwordConditionEditController = passwordCondition.getEditorComponent(ureq, wControl); + listenTo(passwordConditionEditController); + }}
// </OLATCE-91>
diff -r dfce0100e6fa src/main/java/org/olat/course/editor/CourseEditorEnv.java
— a/src/main/java/org/olat/course/editor/CourseEditorEnv.java Thu Sep 05 13:12:23 2013 +0200
+++ b/src/main/java/org/olat/course/editor/CourseEditorEnv.java Wed Sep 25 13:35:25 2013 +0200
@@ -177,5 +177,6 @@
*/
public CourseNode getNode(String nodeId);
// </OLATCE-91>
+ public String getRootNodeId();
}
diff -r dfce0100e6fa src/main/java/org/olat/course/editor/CourseEditorEnvImpl.java
— a/src/main/java/org/olat/course/editor/CourseEditorEnvImpl.java Thu Sep 05 13:12:23 2013 +0200
+++ b/src/main/java/org/olat/course/editor/CourseEditorEnvImpl.java Wed Sep 25 13:35:25 2013 +0200
@@ -492,6 +492,10 @@
public CourseGroupManager getCourseGroupManager()
+
+ public String getRootNodeId()
}