Skip to content

Commit

Permalink
Merge pull request #1566 from ConductionNL/fix/hack-applications
Browse files Browse the repository at this point in the history
re-enable finding application on domain
  • Loading branch information
rjzondervan authored Oct 6, 2023
2 parents 0521012 + c4d83ff commit 66a294d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions api/src/Service/ApplicationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function getApplication()
$public = ($this->request->headers->get('public') ?? $this->request->query->get('public'));

// get host/domain
// $host = ($this->request->headers->get('host') ?? $this->request->query->get('host'));
$host = 'api.buren.commonground.nu';
$host = ($this->request->headers->get('host') ?? $this->request->query->get('host'));
// $host = 'api.buren.commonground.nu';
($application = $this->entityManager->getRepository('App:Application')->findOneBy(['public' => $public])) && !empty($application) && $this->session->set('application', $application->getId()->toString());

if (!$application) {
Expand All @@ -60,15 +60,15 @@ public function getApplication()

// $application = $this->entityManager->getRepository('App:Application')->findAll()->
$applications = $this->entityManager->getRepository('App:Application')->findAll();
// foreach ($applications as $app) {
// $app->getDomains() !== null && in_array($host, $app->getDomains()) && $application = $app;
// if (isset($application)) {
// break;
// }
// }
if(count($applications) > 0) {
$application = $applications[0];
foreach ($applications as $app) {
$app->getDomains() !== null && in_array($host, $app->getDomains()) && $application = $app;
if (isset($application)) {
break;
}
}
// if(count($applications) > 0) {
// $application = $applications[0];
// }
}

if (!$application) {
Expand Down

0 comments on commit 66a294d

Please sign in to comment.