1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Multi-db fixes

This commit is contained in:
Hillel Coren 2017-05-10 10:43:49 +03:00
parent 3e802c1cf8
commit 2725d9d18b
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class DatabaseLookup
}
if ($guard == 'user') {
if ($server = session(SESSION_DB_SERVER)) {
if (Auth::check() && $server = session(SESSION_DB_SERVER)) {
config(['database.default' => $server]);
$user = Auth::user()->fresh();
$user->load('account');

View File

@ -425,7 +425,7 @@ User::updating(function ($user) {
User::onUpdatingUser($user);
$dirty = $user->getDirty();
if (isset($dirty['email']) || isset($dirty['confirmation_code'])) {
if (array_key_exists('email', $dirty) || array_key_exists('confirmation_code', $dirty)) {
LookupUser::updateUser($user->account->account_key, $user->id, $user->email, $user->confirmation_code);
}
});