diff --git a/src/Controllers/AccountController.php b/src/Controllers/AccountController.php index 0cb8a41..dcef07e 100644 --- a/src/Controllers/AccountController.php +++ b/src/Controllers/AccountController.php @@ -32,6 +32,7 @@ public function update() try { $person->handleUpdate($_POST); $person->save(); + $_SESSION['USER'] = $person; header('Location: '.BASE_URI.'/account'); exit(); diff --git a/src/Controllers/PeopleController.php b/src/Controllers/PeopleController.php index d007b40..e9e94f3 100644 --- a/src/Controllers/PeopleController.php +++ b/src/Controllers/PeopleController.php @@ -61,6 +61,9 @@ public function update() try { $person->handleUpdate($_POST); $person->save(); + if ($_SESSION['USER']->getId() == $person->getId()) { + $_SESSION['USER'] = $person; + } header("Location: $return_url"); exit(); diff --git a/src/Controllers/UsersController.php b/src/Controllers/UsersController.php index a4a417f..b203deb 100644 --- a/src/Controllers/UsersController.php +++ b/src/Controllers/UsersController.php @@ -44,6 +44,9 @@ public function update() try { $person->handleUpdateUserAccount($_POST); $person->save(); + if ($_SESSION['USER']->getId() == $person->getId()) { + $_SESSION['USER'] = $person; + } header('Location: '.BASE_URL.'/users'); exit(); }