Edit user account how to check before update if the role check box is selected? I have a module that when my user changes the user details hook_user onupdate, pushes these details to an external database. However I would like this to only work when role X is selected, else my module will not do anything. The role will not be in the users profile as this processing is happening before I update the users account. 

Drupal 6
Thanks

Update

 function checkrole_user($op, &amp;$edit, &amp;$account, $category = NULL){
 switch($op){
 case 'submit':

  if ($edit['roles'] == 'Staff'){
  do xyz
    }

  }
Use hook_user_presave() for any logic that you need to happen before user data is really updated, but also have access to new values:

Parameters
$edit: The array of form values submitted by the user. Assign values to this array to save changes in the database.
$account: The user object on which the operation is performed. Values assigned in this object will not be saved in the database.
$category: The active category of user information being edited.

You need to test against $edit argument.

For Drupal 6, you need hook_user.

Act on user account actions.

Act when $op == 'submit', as:

submit: Modify the account before it gets saved.

Just as with Drupal 7, you must examine

$edit: The array of form values submitted by the user.