3 quick replies:
- onBeforeUserRegistration event holds all user information at registration time in the parameters passed: e.g. $row->email holds the email. But in this case, as it is BEFORE and not AFTER, $row->id is unknown and unset.
- usually, the $user or $row & $rowExtras event function parameters already hold the user informations, where available. Sometimes, it allows your CB plugin to even change them or set them (like above).
- in the case of onBeforeUserConfirm(&$user) event, $user->id holds your id, etc, already, so no need to guess...