From e59202a01a736602dcb7f66b806874eb4878bed4 Mon Sep 17 00:00:00 2001 From: Michiel Uitdehaag Date: Wed, 29 Aug 2018 15:35:48 +0200 Subject: [PATCH] Fix to redirect users to their email information view or their CoPerson information screen after completing an invite/confirmation --- app/Controller/CoInvitesController.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/Controller/CoInvitesController.php b/app/Controller/CoInvitesController.php index 14d41d0e4..16841c9f5 100644 --- a/app/Controller/CoInvitesController.php +++ b/app/Controller/CoInvitesController.php @@ -386,9 +386,26 @@ protected function process_invite($inviteid, $confirm, $loginIdentifier=null) { $this->Flash->set($confirm ? _txt('rs.inv.conf') : _txt('rs.inv.dec'), array('key' => 'success')); } - // If a login identifier was provided, force a logout + // If a login identifier was provided, redirect to a meaningful page if($loginIdentifier) { - $this->redirect("/auth/logout"); + if(!empty($invite['CoInvite']['email_address_id'])) { + // if we confirmed an address, review the final result + + $redirect = array( + 'controller' => 'email_addresses', + 'action' => 'view', + $invite['CoInvite']['email_address_id'] + ); + } else { + // Else review the user information + + $redirect = array( + 'controller' => 'co_people', + 'action' => 'canvas', + $invite['CoInvite']['co_person_id'] + ); + } + $this->redirect($redirect); } else { $this->redirect("/"); }