Skip to content
Snippets Groups Projects
Commit b090664e authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 10.3 to OpenOLAT default branch with 226f3e82dff4e67f52a1281d18aafbeeb4cb3002

parents 1a604c50 aadaedc7
No related branches found
No related tags found
No related merge requests found
......@@ -533,9 +533,13 @@ public class ViteroManager implements UserDataDeletable {
//optional
String language = identity.getUser().getPreferences().getLanguage();
if(StringHelper.containsNonWhitespace(language) && language.startsWith("de")) {
user.setLocale("de");
user.setLocale("de_DE");
} else if(StringHelper.containsNonWhitespace(language) && language.startsWith("fr")) {
user.setLocale("fr_FR");
} else if(StringHelper.containsNonWhitespace(language) && language.startsWith("zh_CN")) {
user.setLocale("zh_CN");
} else {
user.setLocale("en");
user.setLocale("en_GB");
}
user.setPcstate("NOT_TESTED");
user.setTimezone(viteroModule.getTimeZoneId());
......
......@@ -55,7 +55,7 @@ import org.olat.search.service.indexer.OlatFullIndexer;
*/
public class GroupForumIndexer extends ForumIndexer{
//Must correspond with LocalString_xx.properties
//Must correspond with LocalString_xx.properties
// Do not use '_' because we want to seach for certain documenttype and lucene haev problems with '_'
public static final String TYPE = "type.group.forum.message";
......@@ -66,6 +66,7 @@ public class GroupForumIndexer extends ForumIndexer{
* @param indexWriter
* @throws IOException
*/
@Override
public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
if (!(businessObj instanceof BusinessGroup) )
throw new AssertException("businessObj must be BusinessGroup");
......@@ -97,18 +98,19 @@ public class GroupForumIndexer extends ForumIndexer{
*
* @see org.olat.search.service.indexer.Indexer#checkAccess(org.olat.core.id.context.ContextEntry, org.olat.core.id.context.BusinessControl, org.olat.core.id.Identity, org.olat.core.id.Roles)
*/
@Override
public boolean checkAccess(ContextEntry contextEntry, BusinessControl businessControl, Identity identity, Roles roles) {
// TODO:chg: check with collabTools if forum is enabled
ContextEntry ce = businessControl.popLauncherContextEntry();
Long resourceableId = ce.getOLATResourceable().getResourceableId();
Message message = ForumManager.getInstance().loadMessage(resourceableId);
if(message == null) return false;
Message threadtop = message.getThreadtop();
if(threadtop==null) {
threadtop = message;
}
boolean isMessageHidden = Status.getStatus(threadtop.getStatusCode()).isHidden();
//assumes that if is owner then is moderator so it is allowed to see the hidden forum threads
//TODO: (LD) fix this!!!
//here it is checked if the identity is owner of the forum tool but it has no way to find out whether is owner of the group that owns the forum tool
boolean isOwner = BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_ACCESS, contextEntry.getOLATResourceable());
if(isMessageHidden && !isOwner) {
......@@ -117,6 +119,7 @@ public class GroupForumIndexer extends ForumIndexer{
return super.checkAccess(contextEntry, businessControl, identity, roles);
}
@Override
public String getSupportedTypeName() {
return BusinessGroupMainRunController.ORES_TOOLFORUM.getResourceableTypeName();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment