Code Duplication    Length = 5-5 lines in 3 locations

src/Controller/ConversationsController.php 3 locations

@@ 842-846 (lines=5) @@
839
            }
840
841
            //Check if the conversation is open.
842
            if ($conversation->conversation_open == false) {
843
                $this->Flash->error(__d('conversations', 'This conversation is closed, you cannot reply.'));
844
845
                return $this->redirect($this->referer());
846
            }
847
848
            //Build the newEntity for the post form.
849
            $this->request->data['conversation']['id'] = $this->request->id;
@@ 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) {
@@ 992-996 (lines=5) @@
989
            ])
990
            ->first();
991
992
        if (is_null($conversation) || $conversation->conversation->conversation_open != 1) {
993
            $this->Flash->error(__d('conversations', 'This conversation is closed or has been deleted !'));
994
995
            return $this->redirect($this->referer());
996
        }
997
998
        if (!$conversation->conversation->open_invite && $conversation->conversation->user_id != $this->Auth->user('id') && !$conversation->user->group->is_staff) {
999
            $this->Flash->error(__d('conversations', "You don't have the authorization to invite in this conversation !"));