diff --git a/api/config/bundles.php b/api/config/bundles.php index 778ba88d..852f9e68 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -1,22 +1,22 @@ ['all' => true], + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true], - Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], - Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true], - Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], - Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Conduction\LandkitBundle\LandkitBundle::class => ['all' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true], + Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], + Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true], + Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], + Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true], + Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], + Conduction\LandkitBundle\LandkitBundle::class => ['all' => true], ]; diff --git a/api/src/Controller/DashboardController.php b/api/src/Controller/DashboardController.php index 70aec9d8..845fdd80 100644 --- a/api/src/Controller/DashboardController.php +++ b/api/src/Controller/DashboardController.php @@ -7,7 +7,6 @@ use Conduction\CommonGroundBundle\Service\ApplicationService; //use App\Service\RequestService; use Conduction\CommonGroundBundle\Service\CommonGroundService; -use function GuzzleHttp\Promise\all; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -40,7 +39,6 @@ public function generalAction(Session $session, Request $request, CommonGroundSe if (count($users) > 0) { $user = $users[0]; - $userGroups = []; foreach ($user['userGroups'] as $userGroup) { if ($userGroup['id'] != 'c3c463b9-8d39-4cc0-b62c-826d8f5b7d8c') { @@ -124,7 +122,6 @@ public function organizationsAction(Session $session, Request $request, CommonGr $variables = []; if ($request->isMethod('POST')) { - $name = $request->get('name'); $email = $request->get('email'); $description = $request->get('description'); @@ -164,33 +161,31 @@ public function organizationsAction(Session $session, Request $request, CommonGr $group = $commonGroundService->createResource($userGroup, ['component' => 'uc', 'type' => 'groups']); - $users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'],['username' => $this->getUser()->getUsername()])['hydra:member']; - if (count($users) > 0 ) { + $users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'], ['username' => $this->getUser()->getUsername()])['hydra:member']; + if (count($users) > 0) { $organizations = []; $user = $users[0]; $userGroups = []; foreach ($user['userGroups'] as $userGroup) { - array_push($userGroups, '/groups/'.$userGroup['id']); + array_push($userGroups, '/groups/'.$userGroup['id']); } $user['userGroups'] = $userGroups; $user['userGroups'][] = '/groups/'.$group['id']; $commonGroundService->updateResource($user); - } - } - if ($this->getUser()){ - $users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'],['username' => $this->getUser()->getUsername()])['hydra:member']; - if (count($users) > 0 ) { + if ($this->getUser()) { + $users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'], ['username' => $this->getUser()->getUsername()])['hydra:member']; + if (count($users) > 0) { $organizations = []; $user = $users[0]; - foreach ($user['userGroups'] as $group){ - $organization =$commonGroundService->getResource($group['organization']); - if (!in_array($organization, $organizations)){ + foreach ($user['userGroups'] as $group) { + $organization = $commonGroundService->getResource($group['organization']); + if (!in_array($organization, $organizations)) { $organizations[] = $organization; } } @@ -210,7 +205,6 @@ public function organizationAction(Session $session, Request $request, CommonGro $variables = []; if ($request->isMethod('POST')) { - } return $variables; diff --git a/api/src/Controller/DefaultController.php b/api/src/Controller/DefaultController.php index 703f7adb..5d72af4e 100644 --- a/api/src/Controller/DefaultController.php +++ b/api/src/Controller/DefaultController.php @@ -7,8 +7,6 @@ use Conduction\CommonGroundBundle\Service\ApplicationService; //use App\Service\RequestService; use Conduction\CommonGroundBundle\Service\CommonGroundService; -use function GuzzleHttp\Promise\all; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; @@ -123,5 +121,4 @@ public function pricingAction(Session $session, Request $request, CommonGroundSe return $variables; } - } diff --git a/api/src/Controller/DocumentationController.php b/api/src/Controller/DocumentationController.php index fbcd8535..08f6ce10 100644 --- a/api/src/Controller/DocumentationController.php +++ b/api/src/Controller/DocumentationController.php @@ -7,8 +7,6 @@ use Conduction\CommonGroundBundle\Service\ApplicationService; //use App\Service\RequestService; use Conduction\CommonGroundBundle\Service\CommonGroundService; -use function GuzzleHttp\Promise\all; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; @@ -57,5 +55,4 @@ public function exampleAction(Session $session, Request $request, CommonGroundSe return $variables; } - } diff --git a/api/src/Controller/UserController.php b/api/src/Controller/UserController.php index 39d2b284..bf73327d 100644 --- a/api/src/Controller/UserController.php +++ b/api/src/Controller/UserController.php @@ -19,7 +19,7 @@ /** * Class UserController. * -* @Route("/user") + * @Route("/user") */ class UserController extends AbstractController { @@ -66,10 +66,10 @@ public function login( if ($this->getUser()) { $this->flash->add('success', 'Welcome '.$this->getUser()->getName()); + return $this->redirect($this->generateUrl('app_default_index')); } else { return $this->redirect($this->generateUrl('app_default_index')); - } }