mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-04 15:55:31 +00:00
Fixed #18135 - only unset variables if the user is authenticated (Web UI)
This commit is contained in:
@ -10,6 +10,7 @@ use App\Notifications\WelcomeNotification;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
/**
|
||||
* This is ONLY used for the User Import. When we are importing users
|
||||
@ -102,8 +103,7 @@ class UserImporter extends ItemImporter
|
||||
|
||||
$this->log('Updating User');
|
||||
|
||||
// Todo - check that this works
|
||||
if (!Gate::allows('canEditAuthFields', $user)) {
|
||||
if (Auth::check() && (!Gate::allows('canEditAuthFields', $user))) {
|
||||
unset($user->username);
|
||||
unset($user->email);
|
||||
unset($user->password);
|
||||
|
||||
Reference in New Issue
Block a user