2019-09-18 00:31:59 +02:00
|
|
|
<?php
|
|
|
|
namespace App\Account;
|
|
|
|
|
|
|
|
use App\Account\Action\AccountAction;
|
|
|
|
use App\Account\Action\AccountEditAction;
|
2019-11-18 21:46:33 +01:00
|
|
|
use App\Account\Action\ProfilAction;
|
2019-09-18 00:31:59 +02:00
|
|
|
use App\Account\Action\SignupAction;
|
2019-11-25 23:46:20 +01:00
|
|
|
use App\Auth\Action\PasswordForgetAction;
|
2019-09-18 00:31:59 +02:00
|
|
|
use Framework\Auth\LoggedInMiddleware;
|
|
|
|
use Framework\Module;
|
|
|
|
use Framework\Renderer\RendererInterface;
|
|
|
|
use Framework\Router;
|
|
|
|
|
|
|
|
class AccountModule extends Module
|
|
|
|
{
|
|
|
|
|
|
|
|
const MIGRATIONS = __DIR__ . '/migrations';
|
|
|
|
|
|
|
|
const DEFINITIONS = __DIR__ . '/definitions.php';
|
|
|
|
|
|
|
|
public function __construct(Router $router, RendererInterface $renderer)
|
|
|
|
{
|
|
|
|
$renderer->addPath('account', __DIR__ . '/views');
|
|
|
|
$router->get('/inscription', SignupAction::class, 'account.signup');
|
|
|
|
$router->post('/inscription', SignupAction::class);
|
|
|
|
$router->get('/mon-profil', [LoggedInMiddleware::class, AccountAction::class], 'account');
|
|
|
|
$router->post('/mon-profil', [LoggedInMiddleware::class, AccountEditAction::class]);
|
2019-12-29 03:03:50 +01:00
|
|
|
$router->get('/profil/{user:[a-zA-Z\-0-9]+}', [LoggedInMiddleware::class, ProfilAction::class], 'account.profil');
|
|
|
|
$router->post('/profil/{user:[a-zA-Z\-0-9]+}', [LoggedInMiddleware::class, ProfilAction::class]);
|
2019-09-18 00:31:59 +02:00
|
|
|
}
|
|
|
|
}
|