I know that you can create user programtically and set a role:
$roles = array( DRUPAL_AUTHENTICATED_RID => 'authenticated user', 4 => 'Member'); $fields = array( 'name' => $username, 'mail' => $email, 'pass' => $password, 'status' => 1, 'init' => $email, 'roles' => $roles, ); //the first parameter is left blank so a new user is created $account = user_save('', $fields);
and this code works fine. However, I am going to be porting this code to different sites (and back to mine, when I need to do testing on my dev site), and I'm trying to figure out if I'm going to have role id conflicts. Instead of using the above code, and I do the following instead?
$roles = array( DRUPAL_AUTHENTICATED_RID => 'authenticated user', "site-member" => 'Member');
and thereby never having to worry that I am overwriting a role?