1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-27 20:32:28 +01:00
Pterodactyl-Panel/app/Http/Routes/BaseRoutes.php

92 lines
2.7 KiB
PHP
Raw Normal View History

<?php
2016-01-20 01:10:39 +01:00
/**
* Pterodactyl Panel
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Pterodactyl\Http\Routes;
use Illuminate\Routing\Router;
class BaseRoutes {
public function map(Router $router) {
// Index of Panel
$router->get('/', [
'as' => 'index',
'middleware' => 'auth',
'uses' => 'Base\IndexController@getIndex'
]);
// Handle Index. Redirect /index to /
$router->get('/index', function () {
return redirect()->route('index');
});
2015-12-12 07:21:17 +01:00
// Password Generation
$router->get('/password-gen/{length}', [
'as' => 'password-gen',
'middleware' => 'auth',
'uses' => 'Base\IndexController@getPassword'
]);
2015-12-12 07:21:17 +01:00
// Account Routes
$router->group([
'profix' => 'account',
'middleware' => [
2016-01-13 03:50:43 +01:00
'auth',
'csrf'
]
], 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'
]);
});
// TOTP Routes
$router->group([
'prefix' => 'account/totp',
'middleware' => [
2016-01-13 03:50:43 +01:00
'auth',
'csrf'
]
], 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'
]);
});
}
}