protected function getModelFromAdldap(User $user, $password = null)
{
$model = $this->findOrCreateModelFromAdldap($user);
// Sync the users password (if enabled). If no password is
// given, we'll pass in a random 16 character string.
$model = $this->syncModelPassword($model, $password ?: str_random());
// Synchronize other active directory attributes on the model.
$model = $this->syncModelFromAdldap($user, $model);
// Bind the Adldap model to the eloquent model (if enabled).
$model = $this->getBindUserToModel() ? $this->bindAdldapToModel($user, $model) : $model;
return $model;
}