1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #6105 from turbo124/v5-develop

Fixes for login where the user is not attached to an account
This commit is contained in:
David Bomba 2021-06-22 21:33:32 +10:00 committed by GitHub
commit 8825ce4585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 6 deletions

View File

@ -1 +1 @@
5.2.5
5.2.6

View File

@ -341,6 +341,7 @@ class CheckData extends Command
$this->isValid = false;
if($this->option('paid_to_date')){
$this->logMessage("# {$client->id} " . $client->present()->name.' - '.$client->number." Fixing {$client->paid_to_date} to {$total_invoice_payments}");
$client->paid_to_date = $total_invoice_payments;
$client->save();
}

View File

@ -300,7 +300,6 @@ class LoginController extends BaseController
$cu = CompanyUser::query()
->where('user_id', $company_token->user_id);
$cu->first()->account->companies->each(function ($company) use($cu, $request){
if($company->tokens()->where('is_system', true)->count() == 0)
@ -309,7 +308,6 @@ class LoginController extends BaseController
}
});
if($request->has('current_company') && $request->input('current_company') == 'true')
$cu->where("company_id", $company_token->company_id);
@ -361,6 +359,9 @@ class LoginController extends BaseController
if ($existing_user = MultiDB::hasUser($query)) {
if(!$existing_user->account)
return response()->json(['message' => 'User exists, but not attached to any companies! Orphaned user!'], 400);
Auth::login($existing_user, true);
$existing_user->setCompany($existing_user->account->default_company);
@ -387,6 +388,9 @@ class LoginController extends BaseController
//If this is a result user/email combo - lets add their OAuth details details
if($existing_login_user = MultiDB::hasUser(['email' => $google->harvestEmail($user)]))
{
if(!$existing_login_user->account)
return response()->json(['message' => 'User exists, but not attached to any companies! Orphaned user!'], 400);
Auth::login($existing_login_user, true);
$existing_login_user->setCompany($existing_login_user->account->default_company);
@ -422,6 +426,9 @@ class LoginController extends BaseController
if($existing_login_user = MultiDB::hasUser(['email' => $google->harvestEmail($user)]))
{
if(!$existing_login_user->account)
return response()->json(['message' => 'User exists, but not attached to any companies! Orphaned user!'], 400);
Auth::login($existing_login_user, true);
$existing_login_user->setCompany($existing_login_user->account->default_company);

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.2.5',
'app_tag' => '5.2.5-release',
'app_version' => '5.2.6',
'app_tag' => '5.2.6-release',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),

View File

@ -3970,7 +3970,7 @@ $LANG = array(
'details_of_recurring_invoice' => 'Here are some details about recurring invoice',
'cancellation' => 'Cancellation',
'about_cancellation' => 'In case you want to stop the recurring invoice, please click the request the cancellation.',
'cancellation_warning' => 'Warning! You are requesting a cancellation of this service.\n Your service may be cancelled with no further notification to you.',
'cancellation_warning' => 'Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.',
'cancellation_pending' => 'Cancellation pending, we\'ll be in touch!',
'list_of_payments' => 'List of payments',
'payment_details' => 'Details of the payment',