diff --git a/README.md b/README.md index f76ba3f..be3a914 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Dotkernel web starter package suitable for admin applications. [![GitHub license](https://img.shields.io/github/license/dotkernel/admin)](https://github.com/dotkernel/admin/blob/3.0/LICENSE.md) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/3.0.x-dev) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.0.0) # Installing DotKernel `admin` @@ -23,6 +23,7 @@ Dotkernel web starter package suitable for admin applications. - [Installing the `admin` Composer package](#installing-the-admin-composer-package) - [Installing DotKernel admin](#installing-dotkernel-admin) - [Configuration - First Run](#configuration---first-run) + - [Manage GeoLite2 database](#manage-geolite2-database) - [Testing (Running)](#testing-running) ## Tools diff --git a/composer.json b/composer.json index 8f4f698..da4d7bc 100644 --- a/composer.json +++ b/composer.json @@ -43,46 +43,46 @@ } }, "require": { - "php": "^7.4", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0", "ext-gettext": "*", - "dotkernel/dot-annotated-services": "^3.1", - "dotkernel/dot-cli": "^3.2", - "dotkernel/dot-controller": "^3.1", - "dotkernel/dot-errorhandler": "^3.1", - "dotkernel/dot-flashmessenger": "^3.1", - "dotkernel/dot-form": "^4.0", + "dotkernel/dot-annotated-services": "^3.2.1", + "dotkernel/dot-cli": "^3.2.0", + "dotkernel/dot-controller": "^3.2.1", + "dotkernel/dot-errorhandler": "^3.2.0", + "dotkernel/dot-flashmessenger": "^3.2.0", + "dotkernel/dot-form": "^4.0.1", "dotkernel/dot-geoip": "^3.3.1", - "dotkernel/dot-helpers": "^3.1", - "dotkernel/dot-mail": "^3.2", - "dotkernel/dot-navigation": "^3.1", - "dotkernel/dot-rbac-guard": "^3.1", - "dotkernel/dot-session": "^4.2", - "dotkernel/dot-twigrenderer": "^3.1", - "dotkernel/dot-user-agent-sniffer": "^3.0.2", - "laminas/laminas-component-installer": "^2.6", - "laminas/laminas-config-aggregator": "^1.7", - "laminas/laminas-i18n": "^2.13", - "laminas/laminas-math": "^3.5", - "mezzio/mezzio": "^3.10", - "mezzio/mezzio-authorization-rbac": "^1.3", - "mezzio/mezzio-cors": "^1.3", - "mezzio/mezzio-fastroute": "^3.5", - "ramsey/uuid-doctrine": "^1.8", - "roave/psr-container-doctrine": "^2.2", - "robmorgan/phinx": "^0.12" + "dotkernel/dot-helpers": "^3.2.0", + "dotkernel/dot-mail": "^3.3.0", + "dotkernel/dot-navigation": "^3.2.0", + "dotkernel/dot-rbac-guard": "^3.2.1", + "dotkernel/dot-session": "^4.3.0", + "dotkernel/dot-twigrenderer": "^3.2.1", + "dotkernel/dot-user-agent-sniffer": "^3.1.1", + "laminas/laminas-component-installer": "^2.8.0", + "laminas/laminas-config-aggregator": "^1.7.0", + "laminas/laminas-i18n": "^2.15.0", + "laminas/laminas-math": "^3.5.0", + "mezzio/mezzio": "^3.11.0", + "mezzio/mezzio-authorization-rbac": "^1.3.0", + "mezzio/mezzio-cors": "^1.3.0", + "mezzio/mezzio-fastroute": "^3.5.0", + "ramsey/uuid-doctrine": "^1.8.1", + "roave/psr-container-doctrine": "^3.5.0", + "robmorgan/phinx": "^0.12.11" }, "require-dev": { "laminas/laminas-development-mode": "^3.6", - "mezzio/mezzio-tooling": "^1.4", - "phpunit/phpunit": "^7.5", + "mezzio/mezzio-tooling": "^2.5", + "phpunit/phpunit": "^9.5.21", "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.6", + "squizlabs/php_codesniffer": "^3.7", "filp/whoops": "^2.14" }, "autoload": { "psr-4": { "Frontend\\App\\": "src/App/src/", - "Frontend\\User\\": "src/User/src/" + "Frontend\\Admin\\": "src/Admin/src/" } }, "autoload-dev": { diff --git a/config/autoload/app.global.php b/config/autoload/app.global.php index 5a0edec..833ac9f 100644 --- a/config/autoload/app.global.php +++ b/config/autoload/app.global.php @@ -2,8 +2,11 @@ declare(strict_types=1); +$baseUrl = 'http://localhost:8080'; + $app = [ - 'name' => 'DotKernel Admin V3' + 'name' => 'DotKernel Admin V4', + 'url' => $baseUrl ]; return [ diff --git a/config/autoload/authentication.global.php b/config/autoload/authentication.global.php index cc27a52..5ac7a0e 100644 --- a/config/autoload/authentication.global.php +++ b/config/autoload/authentication.global.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Frontend\User\Entity\Admin; +use Frontend\Admin\Entity\Admin; return [ 'doctrine' => [ @@ -12,7 +12,7 @@ 'identity_class' => Admin::class, 'identity_property' => 'identity', 'credential_property' => 'password', - 'credential_callable' => 'Frontend\User\Doctrine\UserAuthentication::verifyCredential', + 'credential_callable' => 'Frontend\Admin\Doctrine\AdminAuthentication::verifyCredential', 'messages' => [ 'success' => 'Authenticated successfully.', 'not_found' => 'Identity not found.', diff --git a/config/autoload/authorization-guards.global.php b/config/autoload/authorization-guards.global.php index 3c297cb..f825dd8 100644 --- a/config/autoload/authorization-guards.global.php +++ b/config/autoload/authorization-guards.global.php @@ -21,11 +21,6 @@ 'type' => 'ControllerPermission', 'options' => [ 'rules' => [ - [ - 'route' => 'user', - 'actions' => [], - 'permissions' => ['authenticated'] - ], [ 'route' => 'admin', 'actions' => ['login'], diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php index fd39bcd..bd37581 100644 --- a/config/autoload/doctrine.global.php +++ b/config/autoload/doctrine.global.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Doctrine\Common\Cache\PhpFileCache; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain; +use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType; diff --git a/config/autoload/navigation.global.php b/config/autoload/navigation.global.php index 3f42208..e29ce46 100644 --- a/config/autoload/navigation.global.php +++ b/config/autoload/navigation.global.php @@ -25,22 +25,25 @@ [ 'options' => [ 'label' => 'Manage admins', - 'route' => [ - 'route_name' => 'admin', - 'route_params' => ['action' => 'manage'] - ], + 'route' => '', 'icon' => 'fas fa-user-circle', - ] - ], - [ - 'options' => [ - 'label' => 'Manage users', - 'route' => [ - 'route_name' => 'user', - 'route_params' => ['action' => 'manage'] - ], - 'icon' => 'fas fa-user', ], + 'pages' => [ + [ + 'options' => [ + 'label' => 'Admins', + 'uri' => '/admin/manage', + 'icon' => 'fas fa-user-circle', + ], + ], + [ + 'options' => [ + 'label' => 'Logins', + 'uri' => '/admin/logins', + 'icon' => 'fas fa-sign-in-alt', + ], + ] + ] ], [ 'options' => [ diff --git a/config/config.php b/config/config.php index 14f3fa3..ca52260 100644 --- a/config/config.php +++ b/config/config.php @@ -5,7 +5,6 @@ use Laminas\ConfigAggregator\ArrayProvider; use Laminas\ConfigAggregator\ConfigAggregator; use Laminas\ConfigAggregator\PhpFileProvider; -use Laminas\ZendFrameworkBridge\ConfigPostProcessor; // To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in // `config/autoload/local.php`. @@ -51,7 +50,7 @@ class_exists(\Mezzio\Swoole\ConfigProvider::class) // Default App module config \Frontend\App\ConfigProvider::class, - \Frontend\User\ConfigProvider::class, + \Frontend\Admin\ConfigProvider::class, // Load application config in a pre-defined order in such a way that local settings // overwrite global settings. (Loaded as first to last): @@ -63,6 +62,6 @@ class_exists(\Mezzio\Swoole\ConfigProvider::class) // Load development config if it exists new PhpFileProvider(realpath(__DIR__) . '/development.config.php'), -], $cacheConfig['config_cache_path'], [ConfigPostProcessor::class]); +], $cacheConfig['config_cache_path']); return $aggregator->getMergedConfig(); diff --git a/config/pipeline.php b/config/pipeline.php index f60d95f..2f21e3d 100644 --- a/config/pipeline.php +++ b/config/pipeline.php @@ -75,7 +75,6 @@ // - route-based validation // - etc. - $app->pipe(TranslatorMiddleware::class); $app->pipe(AuthMiddleware::class); $app->pipe(ForbiddenHandler::class); $app->pipe(RbacGuardMiddleware::class); diff --git a/data/database/migrations/20200416084050_default_admin_schema.php b/data/database/migrations/20200416084050_default_admin_schema.php index b3fdc49..2337f68 100644 --- a/data/database/migrations/20200416084050_default_admin_schema.php +++ b/data/database/migrations/20200416084050_default_admin_schema.php @@ -1,7 +1,7 @@ userService = $userService; $this->router = $router; $this->template = $template; $this->authenticationService = $authenticationService; @@ -194,7 +188,7 @@ public function deleteAction(): ResponseInterface if (!empty($data['uuid'])) { $admin = $this->adminService->getAdminRepository()->find($data['uuid']); } else { - return new JsonResponse(['success' => 'error', 'message' => 'Could not find user']); + return new JsonResponse(['success' => 'error', 'message' => 'Could not find admin']); } try { @@ -257,17 +251,17 @@ public function loginAction(): ResponseInterface $adapter->setIdentity($data['username']); $adapter->setCredential($data['password']); $authResult = $this->authenticationService->authenticate(); -// $logAdmin = $this->adminService->logAdminVisit( -// $this->getRequest()->getServerParams(), -// $data['username'] -// ); + $logAdmin = $this->adminService->logAdminVisit( + $this->getRequest()->getServerParams(), + $data['username'] + ); if ($authResult->isValid()) { $identity = $authResult->getIdentity(); -// $logAdmin->setLoginStatus(AdminLogin::LOGIN_SUCCESS); -// $this->adminService->getAdminRepository()->saveAdminVisit($logAdmin); + $logAdmin->setLoginStatus(AdminLogin::LOGIN_SUCCESS); + $this->adminService->getAdminRepository()->saveAdminVisit($logAdmin); if ($identity->getStatus() === Admin::STATUS_INACTIVE) { $this->authenticationService->clearIdentity(); - $this->messenger->addError('User is inactive', 'user-login'); + $this->messenger->addError('Admin is inactive', 'user-login'); $this->messenger->addData('shouldRebind', true); $this->forms->saveState($form); return new RedirectResponse($this->getRequest()->getUri(), 303); @@ -276,8 +270,8 @@ public function loginAction(): ResponseInterface return new RedirectResponse($this->router->generateUri('dashboard')); } else { -// $logAdmin->setLoginStatus(AdminLogin::LOGIN_FAIL); -// $this->adminService->getAdminRepository()->saveAdminVisit($logAdmin); + $logAdmin->setLoginStatus(AdminLogin::LOGIN_FAIL); + $this->adminService->getAdminRepository()->saveAdminVisit($logAdmin); $this->messenger->addData('shouldRebind', true); $this->forms->saveState($form); $this->messenger->addError($authResult->getMessages(), 'user-login'); @@ -292,7 +286,7 @@ public function loginAction(): ResponseInterface } return new HtmlResponse( - $this->template->render('user::login', [ + $this->template->render('admin::login', [ 'form' => $form ]) ); @@ -354,7 +348,9 @@ public function changePasswordAction(): ResponseInterface { $request = $this->getRequest(); $changePasswordForm = new ChangePasswordForm(); - $admin = $this->authenticationService->getIdentity(); + /** @var AdminIdentity $adminIdentity */ + $adminIdentity = $this->authenticationService->getIdentity(); + $admin = $this->adminService->getAdminRepository()->exists($adminIdentity->getIdentity()); if ($request->getMethod() == 'POST') { $data = $request->getParsedBody(); @@ -378,4 +374,31 @@ public function changePasswordAction(): ResponseInterface return new RedirectResponse($this->router->generateUri('admin', ['action' => 'account'])); } + + /** + * @return ResponseInterface + */ + public function loginsAction(): ResponseInterface + { + return new HtmlResponse($this->template->render('admin::list-logins')); + } + + /** + * @return ResponseInterface + * @throws NoResultException + * @throws NonUniqueResultException + */ + public function listLoginsAction(): ResponseInterface + { + $params = $this->getRequest()->getQueryParams(); + + $sort = (!empty($params['sort'])) ? $params['sort'] : "created"; + $order = (!empty($params['order'])) ? $params['order'] : "desc"; + $offset = (!empty($params['offset'])) ? (int)$params['offset'] : 0; + $limit = (!empty($params['limit'])) ? (int)$params['limit'] : 30; + + $result = $this->adminService->getAdminLogins($offset, $limit, $sort, $order); + + return new JsonResponse($result); + } } diff --git a/src/Admin/src/Entity/AdminInterface.php b/src/Admin/src/Entity/AdminInterface.php index bcdf0c4..06f4cf6 100644 --- a/src/Admin/src/Entity/AdminInterface.php +++ b/src/Admin/src/Entity/AdminInterface.php @@ -7,7 +7,7 @@ /** * Class Admin - * @ORM\Entity(repositoryClass="Frontend\Admin\Repository\UserRepository") + * @ORM\Entity(repositoryClass="Frontend\Admin\Repository\AdminRepository") * @ORM\Table(name="admin") * @ORM\HasLifecycleCallbacks() * @package Frontend\Admin\Entity diff --git a/src/Admin/src/Repository/AdminRepository.php b/src/Admin/src/Repository/AdminRepository.php index 496c90a..d8eadf3 100644 --- a/src/Admin/src/Repository/AdminRepository.php +++ b/src/Admin/src/Repository/AdminRepository.php @@ -105,7 +105,31 @@ public function getAdmins( ->setMaxResults($limit); $qb->orderBy('admin.' . $sort, $order); - return $qb->getQuery()->enableResultCache($this->getCacheLifetime())->getResult(); + return $qb->getQuery()->useQueryCache(true)->getResult(); + } + + /** + * @param int $offset + * @param int $limit + * @param string $sort + * @param string $order + * @return float|int|mixed|string + */ + public function getAdminLogins( + int $offset = 0, + int $limit = 30, + string $sort = 'created', + string $order = 'desc' + ) { + $qb = $this->getEntityManager()->createQueryBuilder(); + $qb->select('adminLogin') + ->from(AdminLogin::class, 'adminLogin'); + + $qb->setFirstResult($offset) + ->setMaxResults($limit); + $qb->orderBy('adminLogin.' . $sort, $order); + + return $qb->getQuery()->useQueryCache(true)->getResult(); } /** @@ -128,6 +152,20 @@ public function countAdmins(string $search = null) return $qb->getQuery()->getSingleScalarResult(); } + /** + * @return float|int|mixed|string + * @throws NoResultException + * @throws NonUniqueResultException + */ + public function countAdminLogins() + { + $qb = $this->getEntityManager()->createQueryBuilder(); + $qb->select('count(adminLogin)') + ->from(AdminLogin::class, 'adminLogin'); + + return $qb->getQuery()->getSingleScalarResult(); + } + /** * @return int */ diff --git a/src/Admin/src/RoutesDelegator.php b/src/Admin/src/RoutesDelegator.php index b2f4c85..46e2651 100644 --- a/src/Admin/src/RoutesDelegator.php +++ b/src/Admin/src/RoutesDelegator.php @@ -1,6 +1,6 @@ [], + 'total' => $this->getAdminRepository()->countAdminLogins() + ]; + $logins = $this->getAdminRepository()->getAdminLogins($offset, $limit, $sort, $order); + + /** @var AdminLogin $login */ + foreach ($logins as $login) { + $result['rows'][] = [ + 'uuid' => $login->getUuid()->toString(), + 'identity' => $login->getIdentity(), + 'adminIp' => $login->getAdminIp(), + 'status' => $login->getLoginStatus(), + 'country' => $login->getCountry(), + 'continent' => $login->getContinent(), + 'organization' => $login->getOrganization(), + 'deviceType' => $login->getDeviceType(), + 'deviceBrand' => $login->getDeviceBrand(), + 'deviceModel' => $login->getDeviceModel(), + 'isMobile' => $login->getIsMobile(), + 'osName' => $login->getOsName(), + 'osVersion' => $login->getOsVersion(), + 'osPlatform' => $login->getOsVersion(), + 'clientType' => $login->getClientType(), + 'clientName' => $login->getClientName(), + 'clientEngine' => $login->getClientEngine(), + 'clientVersion' => $login->getClientVersion(), + 'created' => $login->getCreated()->format("Y-m-d") + ]; + } + + return $result; + } + /** * @param array $data * @return Admin @@ -188,10 +237,10 @@ public function updateAdmin(Admin $admin, array $data) if (!empty($data['password'])) { $admin->setPassword(password_hash($data['password'], PASSWORD_DEFAULT)); } - if (is_string($data['firstName'])) { + if (!empty($data['firstName']) && is_string($data['firstName'])) { $admin->setFirstname($data['firstName']); } - if (is_string($data['lastName'])) { + if (!empty($data['lastName']) && is_string($data['lastName'])) { $admin->setLastname($data['lastName']); } if (!empty($data['status'])) { @@ -236,12 +285,12 @@ public function logAdminVisit($request, $name): AdminLogin $adminLogins = new AdminLogin(); -// $country = !empty($this->locationService->getCountry($ipAddress)) ? -// $this->locationService->getCountry($ipAddress)->getName() : ''; -// $continent = !empty($this->locationService->getContinent($ipAddress)) ? -// $this->locationService->getContinent($ipAddress)->getName() : ''; -// $organization = !empty($this->locationService->getOrganization($ipAddress)) ? -// $this->locationService->getOrganization($ipAddress)->getName() : ''; + $country = !empty($this->locationService->getCountry($ipAddress)) ? + $this->locationService->getCountry($ipAddress)->getName() : ''; + $continent = !empty($this->locationService->getContinent($ipAddress)) ? + $this->locationService->getContinent($ipAddress)->getName() : ''; + $organization = !empty($this->locationService->getOrganization($ipAddress)) ? + $this->locationService->getOrganization($ipAddress)->getName() : ''; $deviceType = !empty($deviceData->getType()) ? $deviceData->getType() : null; $deviceBrand = !empty($deviceData->getBrand()) ? $deviceData->getBrand() : null; $deviceModel = !empty($deviceData->getModel()) ? $deviceData->getModel() : null; @@ -255,9 +304,9 @@ public function logAdminVisit($request, $name): AdminLogin $clientVersion = !empty($deviceClient->getVersion()) ? $deviceClient->getVersion() : null; $adminLogins->setAdminIp($ipAddress) - ->setContinent('') - ->setCountry('') - ->setOrganization('') + ->setContinent($continent) + ->setCountry($country) + ->setOrganization($organization) ->setDeviceType($deviceType) ->setDeviceBrand($deviceBrand) ->setDeviceModel($deviceModel) diff --git a/src/Admin/templates/admin/list-logins.html.twig b/src/Admin/templates/admin/list-logins.html.twig new file mode 100644 index 0000000..ce79b97 --- /dev/null +++ b/src/Admin/templates/admin/list-logins.html.twig @@ -0,0 +1,55 @@ +{% extends '@layout/default.html.twig' %} + +{% block title %}Admin Logins{% endblock %} + +{% block content %} +
+
+

Admin Logins

+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentityIpStatusCountryContinentOrganizationDevice TypeDevice BrandDevice ModelIs MobileOs NameOs VersionOs PlatformClient TypeClient NameClient EngineClient VersionCreated
+
+
+
+
+{% endblock %} diff --git a/src/App/assets/js/components/_bsTable.js b/src/App/assets/js/components/_bsTable.js index 4ec3739..4262df5 100644 --- a/src/App/assets/js/components/_bsTable.js +++ b/src/App/assets/js/components/_bsTable.js @@ -28,20 +28,14 @@ $( document ).ready(function(){ if (count == 0) { $("#adminEditButton").prop('disabled', true); $("#adminDeleteButton").prop('disabled', true); - $("#userEditButton").prop('disabled', true); - $("#userDeleteButton").prop('disabled', true); } else if (count == 1) { $("#adminEditButton").prop('disabled', false); $("#adminDeleteButton").prop('disabled', false); - $("#userEditButton").prop('disabled', false); - $("#userDeleteButton").prop('disabled', false); } else { $("#adminEditButton").prop('disabled', true); $("#adminDeleteButton").prop('disabled', false); - $("#userEditButton").prop('disabled', true); - $("#userDeleteButton").prop('disabled', false); } }; @@ -78,8 +72,6 @@ $( document ).ready(function(){ var resetUiButtonState = function () { $("#adminEditButton").prop('disabled', true); $("#adminDeleteButton").prop('disabled', true); - $("#userEditButton").prop('disabled', true); - $("#userDeleteButton").prop('disabled', true); }; $("#bsTable").on('load-success.bs.table', function () { diff --git a/src/App/assets/js/index.js b/src/App/assets/js/index.js index 62cb3f3..19f12e3 100644 --- a/src/App/assets/js/index.js +++ b/src/App/assets/js/index.js @@ -43,4 +43,3 @@ require('./components/_easypiechart-data'); require('./components/_bsTable'); require('./components/_default'); require('./components/_admin'); -require('./components/_user'); diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 1d1a85e..d4ac25d 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -4,20 +4,16 @@ namespace Frontend\App; -use ContainerInteropDoctrine\EntityManagerFactory; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Dot\AnnotatedServices\Factory\AnnotatedServiceFactory; use Dot\Controller\Factory\PluginManagerFactory; use Dot\Controller\Plugin\PluginManager; use Frontend\App\Controller\DashboardController; -use Frontend\App\Controller\LanguageController; use Frontend\App\Factory\EntityListenerResolverFactory; use Frontend\App\Factory\FormsPluginFactory; use Frontend\App\Plugin\FormsPlugin; use Frontend\App\Resolver\EntityListenerResolver; -use Frontend\App\Service\TranslateService; -use Frontend\App\Service\TranslateServiceInterface; use Mezzio\Application; /** @@ -52,22 +48,18 @@ public function getDependencies(): array 'delegators' => [ Application::class => [ \Frontend\App\RoutesDelegator::class, - \Frontend\User\RoutesDelegator::class + \Frontend\Admin\RoutesDelegator::class ] ], 'factories' => [ - 'doctrine.entity_manager.orm_default' => EntityManagerFactory::class, EntityListenerResolver::class => EntityListenerResolverFactory::class, - TranslateService::class => AnnotatedServiceFactory::class, - LanguageController::class => AnnotatedServiceFactory::class, DashboardController::class => AnnotatedServiceFactory::class, PluginManager::class => PluginManagerFactory::class, FormsPlugin::class => FormsPluginFactory::class ], 'aliases' => [ EntityManager::class => 'doctrine.entity_manager.orm_default', - EntityManagerInterface::class => 'doctrine.entity_manager.default', - TranslateServiceInterface::class => TranslateService::class, + EntityManagerInterface::class => 'doctrine.entity_manager.default' ] ]; } diff --git a/src/App/src/RoutesDelegator.php b/src/App/src/RoutesDelegator.php index ee6dbfd..9e1ae3e 100644 --- a/src/App/src/RoutesDelegator.php +++ b/src/App/src/RoutesDelegator.php @@ -4,9 +4,7 @@ namespace Frontend\App; -use Fig\Http\Message\RequestMethodInterface; use Frontend\App\Controller\DashboardController; -use Frontend\App\Controller\LanguageController; use Mezzio\Application; use Psr\Container\ContainerInterface; @@ -29,13 +27,6 @@ public function __invoke(ContainerInterface $container, $serviceName, callable $ $app->get('/', DashboardController::class, 'dashboard'); - $app->route( - '/language/{action}', - LanguageController::class, - [RequestMethodInterface::METHOD_POST], - 'language' - ); - return $app; } }