mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop
This commit is contained in:
commit
8a967f85bc
@ -13,6 +13,7 @@ namespace App\Http\Controllers\Auth;
|
|||||||
|
|
||||||
use App\Events\Contact\ContactLoggedIn;
|
use App\Events\Contact\ContactLoggedIn;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
@ -40,8 +41,16 @@ class ContactLoginController extends Controller
|
|||||||
$company = null;
|
$company = null;
|
||||||
}elseif (strpos($request->getHost(), 'invoicing.co') !== false) {
|
}elseif (strpos($request->getHost(), 'invoicing.co') !== false) {
|
||||||
$subdomain = explode('.', $request->getHost())[0];
|
$subdomain = explode('.', $request->getHost())[0];
|
||||||
|
|
||||||
|
MultiDB::findAndSetDbByDomain(['subdomain' => $subdomain]);
|
||||||
|
|
||||||
$company = Company::where('subdomain', $subdomain)->first();
|
$company = Company::where('subdomain', $subdomain)->first();
|
||||||
} elseif(Ninja::isHosted() && $company = Company::where('portal_domain', $request->getSchemeAndHttpHost())->first()){
|
|
||||||
|
} elseif(Ninja::isHosted()){
|
||||||
|
|
||||||
|
MultiDB::findAndSetDbByDomain(['portal_domain' => $request->getSchemeAndHttpHost()]);
|
||||||
|
|
||||||
|
$company = Company::where('portal_domain', $request->getSchemeAndHttpHost())->first();
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif (Ninja::isSelfHost()) {
|
elseif (Ninja::isSelfHost()) {
|
||||||
@ -61,6 +70,9 @@ class ContactLoginController extends Controller
|
|||||||
{
|
{
|
||||||
Auth::shouldUse('contact');
|
Auth::shouldUse('contact');
|
||||||
|
|
||||||
|
if(Ninja::isHosted() && $request->has('db'))
|
||||||
|
MultiDB::setDb($request->input('db'));
|
||||||
|
|
||||||
$this->validateLogin($request);
|
$this->validateLogin($request);
|
||||||
// If the class is using the ThrottlesLogins trait, we can automatically throttle
|
// If the class is using the ThrottlesLogins trait, we can automatically throttle
|
||||||
// the login attempts for this application. We'll key this by the username and
|
// the login attempts for this application. We'll key this by the username and
|
||||||
|
@ -79,7 +79,7 @@ class PortalComposer
|
|||||||
$data['currencies'] = TranslationHelper::getCurrencies();
|
$data['currencies'] = TranslationHelper::getCurrencies();
|
||||||
$data['contact'] = auth('contact')->user();
|
$data['contact'] = auth('contact')->user();
|
||||||
|
|
||||||
$data['multiple_contacts'] = session()->get('multiple_contacts');
|
$data['multiple_contacts'] = session()->get('multiple_contacts') ?: collect();
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,9 @@
|
|||||||
<a class="text-xs text-gray-600 hover:text-gray-800 ease-in duration-100"
|
<a class="text-xs text-gray-600 hover:text-gray-800 ease-in duration-100"
|
||||||
href="{{ route('client.password.request') }}">{{ trans('texts.forgot_password') }}</a>
|
href="{{ route('client.password.request') }}">{{ trans('texts.forgot_password') }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
@if($company)
|
||||||
|
<input type="hidden" name="db" value="{{$company->db}}">
|
||||||
|
@endif
|
||||||
<input type="password" name="password" id="password"
|
<input type="password" name="password" id="password"
|
||||||
class="input"
|
class="input"
|
||||||
autofocus>
|
autofocus>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user