This repository has been archived on 2023-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
prosody_web_admin_rest/config/Routes.php
Alexander Schäferdiek 9f085ca304 - updated readme and env.example
- fix some language validator inconsistencies
- added admin notifications
- added possiblity for users to delete their account
- added back index page
- works with mod_admin_rest version [afc42d7](afc42d70f0)
2016-07-10 20:45:42 +02:00

43 lines
No EOL
1.9 KiB
PHP

<?php
// Action factory
// error
$container[NotFoundAction::class] = function ($c) {
return new NotFoundAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
$container[NotAuthorizedAction::class] = function ($c) {
return new NotAuthorizedAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
$container[ForbiddenAction::class] = function ($c) {
return new ForbiddenAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
$container[InternalApplicationError::class] = function ($c) {
return new InternalApplicationError($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
// pages
$container[HomeAction::class] = function ($c) {
return new HomeAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
$container[SignUpAction::class] = function ($c) {
return new SignUpAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'), $c->get('router'));
};
$container[VerificationAction::class] = function ($c) {
return new VerificationAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
$container[DeleteAction::class] = function ($c) {
return new DeleteAction($c->get('view'), $c->get('logger'), $c->get('flash'), $c->get('translator'));
};
// Routes
// error
$app->get('/401', NotAuthorizedAction::class)->setName('401');
$app->get('/403', ForbiddenAction::class)->setName('403');
$app->get('/404', NotFoundAction::class)->setName('404');
$app->get('/500', InternalApplicationError::class)->setName('500');
// pages
$app->get('/', HomeAction::class)->setName('/');
$app->map(['GET', 'POST'], '/signup', SignUpAction::class)->setName('signup');
$app->get('/verification/{verificationCode}', VerificationAction::class)->setName('verification');
$app->map(['GET', 'POST'], '/delete', DeleteAction::class)->setName('delete');