I'm creating a user programmatically like this:
$newUser = array( 'name' => $mail, 'pass' => 'password', // note: do not md5 the password 'mail' => $mail, 'status' => 1, 'init' => $mail, 'roles' => array(5) ); $user = user_save(null, $newUser);
I have got a role with the role ID equal to five; when I create the user, in the table "users_roles" there is only a row with the value 0 for the role ID, but if I print the user object with
var_dump(), it looks like the roles are created.
What am I doing wrong?