Skip to content

Commit

Permalink
Add extra extension hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Feb 23, 2018
1 parent 66a403c commit 905d6e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ Minor update to:
# 1.2.0

* Update to index extension call to more logical naming
* Minor tweak to account summary template
* Minor tweak to account summary template

# 1.2.1

* Add additional extension hooks when edit form submitted
4 changes: 4 additions & 0 deletions code/forms/Users_EditAccountForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public function doUpdate($data)
$filter = array();
$member = Member::get()->byID($data["ID"]);

$this->extend("onBeforeUpdate", $data);

// Check that a mamber isn't trying to mess up another users profile
if (Member::currentUserID() && $member->canEdit(Member::currentUser())) {
// Save member
Expand All @@ -83,6 +85,8 @@ public function doUpdate($data)
);
}

$this->extend("onAfterUpdate", $data);

return $this->controller->redirectBack();
}
}

0 comments on commit 905d6e9

Please sign in to comment.