mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 06:24:30 -04:00
Multi-db fixes
This commit is contained in:
parent
0a847a338d
commit
44e477a9e1
@ -182,7 +182,7 @@ class UserController extends BaseController
|
|||||||
->withInput();
|
->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! \App\Models\LookupUser::validateEmail($email, $user)) {
|
if (! \App\Models\LookupUser::validateEmail(Input::get('email'), $user)) {
|
||||||
return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
|
return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
|
||||||
->withError(trans('texts.email_taken'))
|
->withError(trans('texts.email_taken'))
|
||||||
->withInput();
|
->withInput();
|
||||||
|
@ -50,7 +50,9 @@ AccountToken::creating(function ($token)
|
|||||||
|
|
||||||
AccountToken::deleted(function ($token)
|
AccountToken::deleted(function ($token)
|
||||||
{
|
{
|
||||||
LookupAccountToken::deleteWhere([
|
if ($token->forceDeleting) {
|
||||||
'token' => $token->token
|
LookupAccountToken::deleteWhere([
|
||||||
]);
|
'token' => $token->token
|
||||||
|
]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -176,7 +176,9 @@ Contact::creating(function ($contact)
|
|||||||
|
|
||||||
Contact::deleted(function ($contact)
|
Contact::deleted(function ($contact)
|
||||||
{
|
{
|
||||||
LookupContact::deleteWhere([
|
if ($contact->forceDeleting) {
|
||||||
'contact_key' => $contact->contact_key,
|
LookupContact::deleteWhere([
|
||||||
]);
|
'contact_key' => $contact->contact_key,
|
||||||
|
]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -173,7 +173,9 @@ Invitation::creating(function ($invitation)
|
|||||||
|
|
||||||
Invitation::deleted(function ($invitation)
|
Invitation::deleted(function ($invitation)
|
||||||
{
|
{
|
||||||
LookupInvitation::deleteWhere([
|
if ($invitation->forceDeleting) {
|
||||||
'invitation_key' => $invitation->invitation_key,
|
LookupInvitation::deleteWhere([
|
||||||
]);
|
'invitation_key' => $invitation->invitation_key,
|
||||||
|
]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,6 +17,7 @@ class LookupUser extends LookupModel
|
|||||||
'lookup_account_id',
|
'lookup_account_id',
|
||||||
'email',
|
'email',
|
||||||
'user_id',
|
'user_id',
|
||||||
|
'confirmation_code',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function updateUser($accountKey, $userId, $email, $confirmationCode)
|
public static function updateUser($accountKey, $userId, $email, $confirmationCode)
|
||||||
|
@ -418,6 +418,7 @@ User::created(function ($user)
|
|||||||
LookupUser::createNew($user->account->account_key, [
|
LookupUser::createNew($user->account->account_key, [
|
||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
|
'confirmation_code' => $user->confirmation_code,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -440,7 +441,9 @@ User::deleted(function ($user)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LookupUser::deleteWhere([
|
if ($user->forceDeleting) {
|
||||||
'email' => $user->email
|
LookupUser::deleteWhere([
|
||||||
]);
|
'email' => $user->email
|
||||||
|
]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user