Rationale: Third-party components can be notified whenever the user updates their profile, or an admin updates a user's profile, and take actions accordingly.
Placement: Currently, this needs to occur in several places:
For updating after a profile change:
In ucp_profile.php, after:
Code: Select all
// Update Custom Fields
In ucp_profile.php, after:
Code: Select all
if (isset($sql_ary['user_avatar']))
{
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
For updating after an admin changes are user's profile:
In includes/acp/acp_users.php, after:
Code: Select all
add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
Code: Select all
// Update Custom Fields
However, I have to do it this way right now in order to intercept the appropriate profile information. Ideally you could simplify the attach point.
Input arguments:
string $update_type: whether this is an avatar update, a profile update, etc.
integer $user_id: the user ID
array $before_update: an array of all profile fields before update
array $after_update: an array of all profile fields after update
Output arguments: void.
Related: If the mod wants to modify the profile fields, there should be an additional hook, hook_pre_pfofile_update, that would inject data and return the $after_update array.