Nice module.

I recommend that you move your hook_user('insert') code to hook_user('submit'). See http://api.drupal.org/api/function/hook_user/6. You will then not have to write into the user table table at all. Just change $user->name during submit operation and user.module will save it for you. Another benefit is that you all modules which listen on hook_user('insert') will receive the right username.

Comments

moshe weitzman’s picture

Status: Active » Closed (works as designed)

Inexplicably, this operation is only called on profile changes, and not on registration.