From 4dc423aa49a2a74b1352871668d66d238a010d10 Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Fri, 18 Oct 2013 01:48:22 +0200 Subject: [PATCH] Added further usergroup options - Added option to (dis)allow adding invisible participants - Added option to (dis)allow setting "participantCanInvite" --- files/lib/form/ConversationAddForm.class.php | 10 ++++++++++ language/de.xml | 2 ++ language/en.xml | 2 ++ templates/conversationAdd.tpl | 4 ++++ userGroupOption.xml | 12 +++++++++++- 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/files/lib/form/ConversationAddForm.class.php b/files/lib/form/ConversationAddForm.class.php index 2b1920a..09cdd88 100644 --- a/files/lib/form/ConversationAddForm.class.php +++ b/files/lib/form/ConversationAddForm.class.php @@ -147,6 +147,16 @@ class ConversationAddForm extends MessageForm { throw new UserInputException('participants'); } + // check, if user is allowed to set invisible participants + if (!WCF::getSession()->getPermission('user.conversation.canAddInvisibleParticipants') && !empty($this->invisibleParticipants)) { + throw new UserInputException('participants', 'invisibleParticipantsNoPermission'); + } + + // check, if user is allowed to set participantCanInvite + if (!WCF::getSession()->getPermission('user.conversation.canAddInvisibleParticipants') && $this->participantCanInvite) { + throw new UserInputException('participantCanInvite', 'participantCanInviteNoPermission'); + } + $this->participantIDs = Conversation::validateParticipants($this->participants); $this->invisibleParticipantIDs = Conversation::validateParticipants($this->invisibleParticipants, 'invisibleParticipants'); diff --git a/language/de.xml b/language/de.xml index 1879dde..ccee843 100644 --- a/language/de.xml +++ b/language/de.xml @@ -85,6 +85,8 @@ getSession()->getPermission('user.conversation.maxParticipants')} Teilnehmern.]]> + + username}“ wirklich aus dieser Konversation entfernen?]]> diff --git a/language/en.xml b/language/en.xml index 6a40967..e064a5b 100644 --- a/language/en.xml +++ b/language/en.xml @@ -85,6 +85,8 @@ getSession()->getPermission('user.conversation.maxParticipants')} participants.]]> + + username}” from this conversation?]]> diff --git a/templates/conversationAdd.tpl b/templates/conversationAdd.tpl index 75f8283..198e579 100644 --- a/templates/conversationAdd.tpl +++ b/templates/conversationAdd.tpl @@ -83,6 +83,7 @@ + {if $__wcf->session->getPermission('user.conversation.canAddInvisibleParticipants')}
@@ -103,13 +104,16 @@ {lang}wcf.conversation.invisibleParticipants.description{/lang}
+ {/if} + {if $__wcf->session->getPermission('user.conversation.canSetCanInvite')}
+ {/if} {event name='participantFields'} diff --git a/userGroupOption.xml b/userGroupOption.xml index 4e98fbe..6094653 100644 --- a/userGroupOption.xml +++ b/userGroupOption.xml @@ -24,7 +24,17 @@ user.conversation boolean 1 - user.conversation.maxParticipants,user.conversation.maxConversations,user.conversation.maxLabels,user.conversation.maxLength,user.conversation.canUploadAttachment + user.conversation.canSetCanInvite,user.conversation.canAddInvisibleParticipants,user.conversation.maxParticipants,user.conversation.maxConversations,user.conversation.maxLabels,user.conversation.maxLength,user.conversation.canUploadAttachment + + +