Code Duplication    Length = 5-5 lines in 3 locations

src/Controller/ConversationsController.php 3 locations

@@ 839-843 (lines=5) @@
836
            }
837
838
            //Check if the conversation is open.
839
            if ($conversation->conversation_open == false) {
840
                $this->Flash->error(__d('conversations', 'This conversation is closed, you cannot reply.'));
841
842
                return $this->redirect($this->referer());
843
            }
844
845
            //Build the newEntity for the post form.
846
            $this->request = $this->request
@@ 932-936 (lines=5) @@
929
                ->first();
930
931
            //Check if the conversation is found.
932
            if (is_null($conversation)) {
933
                $this->Flash->error(__d('conversations', "This conversation doesn't exist or has been deleted !"));
934
935
                return $this->redirect($this->referer());
936
            }
937
938
            //Check if the user has the permission to edit it.
939
            if ($this->Auth->isAuthorized() === false) {
@@ 991-995 (lines=5) @@
988
            ])
989
            ->first();
990
991
        if (is_null($conversation) || $conversation->conversation->conversation_open != 1) {
992
            $this->Flash->error(__d('conversations', 'This conversation is closed or has been deleted !'));
993
994
            return $this->redirect($this->referer());
995
        }
996
997
        if (!$conversation->conversation->open_invite && $conversation->conversation->user_id != $this->Auth->user('id') && !$conversation->user->group->is_staff) {
998
            $this->Flash->error(__d('conversations', "You don't have the authorization to invite in this conversation !"));