From e353df588fe28dd44587ede2c405de87e570c4c6 Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Tue, 24 May 2016 21:40:52 -0500 Subject: [PATCH] Importer improvements. If user real name doesn't exist don't try to create the user. --- app/Console/Commands/ObjectImportCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/ObjectImportCommand.php b/app/Console/Commands/ObjectImportCommand.php index 2f06f57070..d3b9533c9f 100644 --- a/app/Console/Commands/ObjectImportCommand.php +++ b/app/Console/Commands/ObjectImportCommand.php @@ -563,8 +563,9 @@ class ObjectImportCommand extends Command { if (!empty($user_username)) { if ($user = User::MatchEmailOrUsername($user_username, $user_email) ->whereNotNull('username')->first()) { + $this->log('User '.$user_username.' already exists'); - } else { + } else if(( $first_name != '') && ($last_name != '') && ($user_username != '')) { $user = new \App\Models\User; $password = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20); @@ -580,6 +581,8 @@ class ObjectImportCommand extends Command { $this->error('User: ' . $user->getErrors()); } + } else { + $user = new User; } } else { $user = new User;