Create default password for new user registration in CP I have a situation where I want to assign a default password when a user is registered in the CP, but only if they are assigned to a specific user group. Plugin code looks like this:

craft()-&gt;on('users.onActivateUser', function(Event $event)
{
    $user = $event-&gt;params['user'];

    // Test to see if a user is in group
    if ($user-&gt;isInGroup('groupName'))
    {
        $user-&gt;newPassword = 'Password123';
        craft()-&gt;users-&gt;saveUser($user);
    }
});


I've tried latching on to both the users.onSaveUser and users.onActivateUser events, and in both situations, there are no groups are assigned to the user. Is there an event that is at the absolute end of user registration that I can watch to access their user groups?
If you have "Verify Email Addresses" checked in Settings->Users->Settings and you uncheck "Send activation email now?" users will start in a "pending" state, so the onActivateUser event won't get fired.

If you uncheck "Verify Email Addresses" in Settings->Users->Settings, the "Send activation email now?" checkbox will disappear when registering a new user, users will start in an "active" state and the onActivateUser event will fire.

As you've found, user group information isn't available to the user on the same request they get created in because user group permissions don't get processed until after the onSaveUser event has fired.  You could use onSaveUser, but you'd run into the same limitation.

What you can do, however, is directly check against $_POST (craft()->request->getPost()) to see if the user group you're interested in is there in the onActivateUser event.