What happens if Drupal's user_save() fails?

lacHstar2

New Member
I'm on Drupal 5.x and I'm trying to add new users to the site using a script that calls \[code\]drupal_bootstrap()\[/code\]. After generating the username, email, password, and role array, I create the new user like so:\[code\]$newuser = array( 'name' => $username, 'mail' => $email, 'status' => 1, 'pass' => $password, 'roles' => $roles);$user = user_save('', $newuser);\[/code\]I know that with this code I can test the \[code\]$user\[/code\] object returned by \[code\]user_save()\[/code\], but how do I test if the user was created and inserted correctly? Do I have to query the database to test if the user was created successfully?
 
Back
Top