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()
|
public static function isWhiteLabel()
|
||||||
{
|
{
|
||||||
if (Utils::isNinjaProd()) {
|
$account = false;
|
||||||
return 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) : false;
|
||||||
|
|
||||||
return $account && $account->hasFeature(FEATURE_WHITE_LABEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getResllerType()
|
public static function getResllerType()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{App::getLocale()}}">
|
<html lang="{{App::getLocale()}}">
|
||||||
<head>
|
<head>
|
||||||
@if (!Utils::isNinja() && !Auth::check())
|
@if (Utils::isWhiteLabel())
|
||||||
<title>{{ trans('texts.client_portal') }}</title>
|
<title>{{ trans('texts.client_portal') }}</title>
|
||||||
@else
|
@else
|
||||||
<title>{{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }}</title>
|
<title>{{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }}</title>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user