diff --git a/components/com_users/Controller/ProfileController.php b/components/com_users/Controller/ProfileController.php index 22a3069b395f6..2f8df81d6a40d 100644 --- a/components/com_users/Controller/ProfileController.php +++ b/components/com_users/Controller/ProfileController.php @@ -250,6 +250,25 @@ public function save() $app->setUserState('com_users.edit.profile.data', null); } + /** + * Method to cancel an edit. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function cancel() + { + // Check for request forgeries. + $this->checkToken(); + + // Flush the data from the session. + $this->app->setUserState('com_users.edit.profile', null); + + // Redirect to user profile. + $this->setRedirect(Route::_('index.php?option=com_users&view=profile', false)); + } + /** * Function that allows child controller access to model data after the data has been saved. * diff --git a/components/com_users/tmpl/profile/edit.php b/components/com_users/tmpl/profile/edit.php index 184634eb269d6..3948e282811a9 100644 --- a/components/com_users/tmpl/profile/edit.php +++ b/components/com_users/tmpl/profile/edit.php @@ -33,7 +33,7 @@ -
+ form->getFieldsets() as $group => $fieldset) : ?> form->getFieldset($group); ?> @@ -124,14 +124,13 @@
- + - -