I am saving users from an external source and able to create them in the Craft db as users. However, each user's password is set to null despite setting it on the user model prior to saving it. Is there a way to handle setting passwords during user creation? I am not requiring email verification.
foreach ($docs as $doc) {
$user = new UserModel;
$user->firstName = $doc->FName;
$user->lastName = $doc->LName;
$user->password = '123456';
$user->email = $doc->Email;
$user->username = $doc->Email;
$wasSaved = craft()->users->saveUser($user);
if ($wasSaved) {
$was_assigned = craft()->userGroups->assignUserToGroups($user->id, array(1));
} else {
printf("couldn't save: %s", $user->email);
}
}