1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

Block UI when CNAME target is invalid

This commit is contained in:
Eldad Fux 2020-02-23 10:58:30 +02:00
parent b93b4be4cf
commit 583fb8c23d

View file

@ -5,6 +5,7 @@ include_once __DIR__ . '/../shared/web.php';
global $utopia, $response, $request, $layout, $version, $providers, $projectDB;
use Utopia\View;
use Utopia\Domains\Domain;
use Database\Database;
use Database\Validator\UID;
use Storage\Storage;
@ -116,9 +117,15 @@ $utopia->get('/console/settings')
->desc('Platform console project settings')
->label('permission', 'public')
->label('scope', 'console')
->action(function () use ($layout) {
->action(function () use ($request, $layout) {
$target = new Domain($request->getServer('_APP_DOMAINS_TARGET', ''));
$page = new View(__DIR__.'/../../views/console/settings/index.phtml');
$page
->setParam('customDomains', ($target->isKnown() && !$target->isTest()))
;
$layout
->setParam('title', APP_NAME.' - Settings')
->setParam('body', $page);