@@ 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 | $this->Conversations->patchEntity($conversation, $this->request->getParsedBody(), ['validate' => 'edit']); |
|
950 | ||
@@ 1112-1120 (lines=9) @@ | ||
1109 | $this->Flash->success(__d('conversations', 'You have left the conversation successfully.')); |
|
1110 | ||
1111 | return $this->redirect(['controller' => 'conversations', 'action' => 'index']); |
|
1112 | } else { |
|
1113 | $this->Flash->error(__d('conversations', 'You can not leave your own conversation.')); |
|
1114 | ||
1115 | return $this->redirect([ |
|
1116 | 'controller' => 'conversations', |
|
1117 | 'action' => 'go', |
|
1118 | $user->conversation->last_message_id |
|
1119 | ]); |
|
1120 | } |
|
1121 | } |
|
1122 | ||
1123 | /** |