1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Use subdomain in db lookup

This commit is contained in:
Hillel Coren 2017-11-15 21:09:43 +02:00
parent bf1f540fdf
commit c8192f392b

View File

@ -10,6 +10,7 @@ use App\Models\LookupInvitation;
use App\Models\LookupAccountToken;
use App\Models\LookupUser;
use Auth;
use Utils;
class DatabaseLookup
{
@ -46,6 +47,11 @@ class DatabaseLookup
LookupContact::setServerByField('contact_key', $key);
} elseif ($key = request()->account_key) {
LookupAccount::setServerByField('account_key', $key);
} else {
$subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST'));
if ($subdomain != 'app') {
LookupAccount::setServerByField('subdomain', $subdomain);
}
}
} elseif ($guard == 'postmark') {
LookupInvitation::setServerByField('message_id', request()->MessageID);