Thanks for this module as it has made my life much easier.

First week of drupal so i'm a complete novice. Problem i had was i had a role for purchase that when purchased htpasswd sync did not update the htgroup. Also if i changed the user's role the htgroup would not update. I had to go into htpasswd sync configure in order to get the htgroup to update.

I used the user_update hook and all seems well now. I'm not familiar with the different hooks and what conditions they get triggered.

//i added this
function htpasswdsync_user_update() {
    _htpasswdsync_updategroup();
}

There is also a comment :
* User insert/edit hook. Used instead of htpasswdsync_user_insert() and
* htpasswdsync_user_update() because at these states the password is already
* hashed.

I dont believe user_insert/user_edit hooks are valid hooks.