2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Routes;
|
|
|
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
|
|
|
class BaseRoutes {
|
|
|
|
|
|
|
|
public function map(Router $router) {
|
|
|
|
|
2016-01-04 21:09:39 +00:00
|
|
|
// Index of Panel
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'index',
|
|
|
|
'middleware' => 'auth',
|
|
|
|
'uses' => 'Base\IndexController@getIndex'
|
|
|
|
]);
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
// Handle Index. Redirect /index to /
|
|
|
|
$router->get('/index', function () {
|
|
|
|
return redirect()->route('index');
|
|
|
|
});
|
|
|
|
|
2015-12-12 06:21:17 +00:00
|
|
|
// Password Generation
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->get('/password-gen/{length}', [
|
|
|
|
'as' => 'password-gen',
|
|
|
|
'middleware' => 'auth',
|
|
|
|
'uses' => 'Base\IndexController@getPassword'
|
|
|
|
]);
|
2015-12-12 06:21:17 +00:00
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
// Account Routes
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->group([
|
|
|
|
'profix' => 'account',
|
|
|
|
'middleware' => [
|
2016-01-13 02:50:43 +00:00
|
|
|
'auth',
|
|
|
|
'csrf'
|
2016-01-04 21:09:39 +00:00
|
|
|
]
|
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('account', [
|
|
|
|
'as' => 'account',
|
|
|
|
'uses' => 'Base\IndexController@getAccount'
|
|
|
|
]);
|
|
|
|
$router->post('/account/password', [
|
|
|
|
'uses' => 'Base\IndexController@postAccountPassword'
|
|
|
|
]);
|
|
|
|
$router->post('/account/email', [
|
|
|
|
'uses' => 'Base\IndexController@postAccountEmail'
|
|
|
|
]);
|
|
|
|
});
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
// TOTP Routes
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'account/totp',
|
|
|
|
'middleware' => [
|
2016-01-13 02:50:43 +00:00
|
|
|
'auth',
|
|
|
|
'csrf'
|
2016-01-04 21:09:39 +00:00
|
|
|
]
|
|
|
|
], function () use ($router) {
|
|
|
|
$router->get('/', [
|
|
|
|
'as' => 'account.totp',
|
|
|
|
'uses' => 'Base\IndexController@getAccountTotp'
|
|
|
|
]);
|
|
|
|
$router->put('/', [
|
|
|
|
'uses' => 'Base\IndexController@putAccountTotp'
|
|
|
|
]);
|
|
|
|
$router->post('/', [
|
|
|
|
'uses' => 'Base\IndexController@postAccountTotp'
|
|
|
|
]);
|
|
|
|
$router->delete('/', [
|
|
|
|
'uses' => 'Base\IndexController@deleteAccountTotp'
|
|
|
|
]);
|
|
|
|
});
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|