Skip to content

Commit

Permalink
feat: add pre user update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jobcespedes committed Apr 18, 2024
1 parent 1c349ba commit 905a7c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions user/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ function user_update_user($user, $updatepassword = true, $triggerevent = true) {
}
}

// Allow plugins to use this user object before update.
if ($pluginsfunction = get_plugins_with_function('pre_user_update')) {
foreach ($pluginsfunction as $plugintype => $plugins) {
foreach ($plugins as $pluginfunction) {
$pluginfunction($user);
}
}
}

$DB->update_record('user', $user);

if ($updatepassword) {
Expand Down

0 comments on commit 905a7c1

Please sign in to comment.