@@ 939-947 (lines=9) @@ | ||
936 | } |
|
937 | ||
938 | //Check if the user has the permission to edit it. |
|
939 | if ($this->Auth->isAuthorized() === false) { |
|
940 | $this->Flash->error(__d('conversations', "You don't have the authorization to edit this conversation !")); |
|
941 | ||
942 | return $this->redirect([ |
|
943 | 'controller' => 'conversations', |
|
944 | 'action' => 'go', |
|
945 | $conversation->last_message_id |
|
946 | ]); |
|
947 | } |
|
948 | ||
949 | ||
950 | $this->Conversations->patchEntity($conversation, $this->request->data, ['validate' => 'edit']); |
|
@@ 1113-1121 (lines=9) @@ | ||
1110 | $this->Flash->success(__d('conversations', 'You have left the conversation successfully.')); |
|
1111 | ||
1112 | return $this->redirect(['controller' => 'conversations', 'action' => 'index']); |
|
1113 | } else { |
|
1114 | $this->Flash->error(__d('conversations', 'You can not leave your own conversation.')); |
|
1115 | ||
1116 | return $this->redirect([ |
|
1117 | 'controller' => 'conversations', |
|
1118 | 'action' => 'go', |
|
1119 | $user->conversation->last_message_id |
|
1120 | ]); |
|
1121 | } |
|
1122 | } |
|
1123 | ||
1124 | /** |