mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Multi-db fixes
This commit is contained in:
parent
fec7f6ad9b
commit
474790df69
@ -182,7 +182,7 @@ class UserController extends BaseController
|
||||
->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')
|
||||
->withError(trans('texts.email_taken'))
|
||||
->withInput();
|
||||
|
@ -50,7 +50,9 @@ AccountToken::creating(function ($token)
|
||||
|
||||
AccountToken::deleted(function ($token)
|
||||
{
|
||||
if ($token->forceDeleting) {
|
||||
LookupAccountToken::deleteWhere([
|
||||
'token' => $token->token
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
@ -176,7 +176,9 @@ Contact::creating(function ($contact)
|
||||
|
||||
Contact::deleted(function ($contact)
|
||||
{
|
||||
if ($contact->forceDeleting) {
|
||||
LookupContact::deleteWhere([
|
||||
'contact_key' => $contact->contact_key,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
@ -173,7 +173,9 @@ Invitation::creating(function ($invitation)
|
||||
|
||||
Invitation::deleted(function ($invitation)
|
||||
{
|
||||
if ($invitation->forceDeleting) {
|
||||
LookupInvitation::deleteWhere([
|
||||
'invitation_key' => $invitation->invitation_key,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
@ -17,6 +17,7 @@ class LookupUser extends LookupModel
|
||||
'lookup_account_id',
|
||||
'email',
|
||||
'user_id',
|
||||
'confirmation_code',
|
||||
];
|
||||
|
||||
public static function updateUser($accountKey, $userId, $email, $confirmationCode)
|
||||
|
@ -418,6 +418,7 @@ User::created(function ($user)
|
||||
LookupUser::createNew($user->account->account_key, [
|
||||
'email' => $user->email,
|
||||
'user_id' => $user->id,
|
||||
'confirmation_code' => $user->confirmation_code,
|
||||
]);
|
||||
});
|
||||
|
||||
@ -440,7 +441,9 @@ User::deleted(function ($user)
|
||||
return;
|
||||
}
|
||||
|
||||
if ($user->forceDeleting) {
|
||||
LookupUser::deleteWhere([
|
||||
'email' => $user->email
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user