mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix updating user
This commit is contained in:
parent
2e76d9772a
commit
77bfabd386
@ -52,12 +52,14 @@ class LookupUser extends LookupModel
|
||||
}
|
||||
|
||||
$current = config('database.default');
|
||||
$accountKey = $user->account->account_key;
|
||||
|
||||
config(['database.default' => DB_NINJA_LOOKUP]);
|
||||
|
||||
$lookupUser = LookupUser::whereEmail($email)->first();
|
||||
|
||||
if ($user) {
|
||||
$lookupAccount = LookupAccount::whereAccountKey($user->account->account_key)->firstOrFail();
|
||||
$lookupAccount = LookupAccount::whereAccountKey($accountKey)->firstOrFail();
|
||||
$isValid = ! $lookupUser || ($lookupUser->lookup_account_id == $lookupAccount->id && $lookupUser->user_id == $user->id);
|
||||
} else {
|
||||
$isValid = ! $lookupUser;
|
||||
|
Loading…
x
Reference in New Issue
Block a user