mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve white label logic #1264
This commit is contained in:
parent
b697e2aafa
commit
ff3e23e7da
@ -102,13 +102,21 @@ class Utils
|
||||
|
||||
public static function isWhiteLabel()
|
||||
{
|
||||
if (Utils::isNinjaProd()) {
|
||||
return false;
|
||||
$account = false;
|
||||
|
||||
if (Utils::isNinja()) {
|
||||
if (Auth::check()) {
|
||||
$account = Auth::user()->account;
|
||||
} elseif ($contactKey = session('contact_key')) {
|
||||
if ($contact = \App\Models\Contact::whereContactKey($contactKey)->first()) {
|
||||
$account = $contact->account;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$account = \App\Models\Account::first();
|
||||
}
|
||||
|
||||
$account = \App\Models\Account::first();
|
||||
|
||||
return $account && $account->hasFeature(FEATURE_WHITE_LABEL);
|
||||
return $account ? $account->hasFeature(FEATURE_WHITE_LABEL) : false;
|
||||
}
|
||||
|
||||
public static function getResllerType()
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{App::getLocale()}}">
|
||||
<head>
|
||||
@if (!Utils::isNinja() && !Auth::check())
|
||||
@if (Utils::isWhiteLabel())
|
||||
<title>{{ trans('texts.client_portal') }}</title>
|
||||
@else
|
||||
<title>{{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }}</title>
|
||||
|
Loading…
x
Reference in New Issue
Block a user