here are some functions and useful instructions for working with the drupal user entity.
# for modifying a user for example "user roles" :
// Remove this role from the user's list. $roles_list = $account->roles; unset($roles_list[$rid]); $account = user_save($account, array('roles' => $roles_list));
# function "user_load" returns an object that you can find it in this article