Removed > 300

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-07-08 17:09:56 -07:00
parent e833052e8e
commit 2518e2f0ee

View file

@ -1284,24 +1284,22 @@ class SettingsController extends Controller
$migrate_output = Artisan::output();
\Log::debug($migrate_output);
if (strlen($output) > 300) {
$find_user = DB::table('users')->where('first_name', $user->first_name)->where('last_name', $user->last_name)->exists();
if (!$find_user){
\Log::warning('Attempting to restore user: ' . $user->first_name . ' ' . $user->last_name);
$new_user = $user->replicate();
$new_user->push();
}
\Log::debug('Logging all users out..');
Artisan::call('snipeit:global-logout', ['--force' => true]);
DB::table('users')->update(['remember_token' => null]);
\Auth::logout();
return redirect()->route('login')->with('success', 'Your system has been restored. Please login again.');
$find_user = DB::table('users')->where('username', $user->username)->exists();
if (!$find_user){
\Log::warning('Attempting to restore user: ' . $user->username);
$new_user = $user->replicate();
$new_user->push();
} else {
return redirect()->route('settings.backups.index')->with('error', $output);
\Log::debug('User: ' . $user->username .' already exists.');
}
\Log::debug('Logging all users out..');
Artisan::call('snipeit:global-logout', ['--force' => true]);
DB::table('users')->update(['remember_token' => null]);
\Auth::logout();
return redirect()->route('login')->with('success', 'Your system has been restored. Please login again.');
}
} else {