2018-02-01 11:49:40 +00:00
|
|
|
<?php
|
|
|
|
return function(\Slim\App $app) {
|
|
|
|
|
|
|
|
$app->group('/admin', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\IndexController::class.':indexAction')
|
|
|
|
->setName('admin:index:index');
|
|
|
|
|
|
|
|
$this->get('/sync/{type}', Controller\Admin\IndexController::class.':syncAction')
|
|
|
|
->setName('admin:index:sync')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'administer all'])
|
|
|
|
->add(App\Middleware\DebugEcho::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/api', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\ApiController::class.':indexAction')
|
|
|
|
->setName('admin:api:index');
|
|
|
|
|
2018-02-06 11:09:05 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Admin\ApiController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:api:edit');
|
|
|
|
|
2018-02-07 12:16:29 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Admin\ApiController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:api:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'administer api keys']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/branding', Controller\Admin\BrandingController::class.':indexAction')
|
|
|
|
->setName('admin:branding:index')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'administer settings']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
2018-04-15 23:53:46 +00:00
|
|
|
$this->group('/custom_fields', function() {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\CustomFieldsController::class.':indexAction')
|
|
|
|
->setName('admin:custom_fields:index');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Admin\CustomFieldsController::class.':editAction')
|
|
|
|
->setName('admin:custom_fields:edit');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Admin\CustomFieldsController::class.':editAction')
|
|
|
|
->setName('admin:custom_fields:add');
|
|
|
|
|
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Admin\CustomFieldsController::class.':deleteAction')
|
|
|
|
->setName('admin:custom_fields:delete');
|
|
|
|
|
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'administer custom fields']);
|
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
$this->group('/permissions', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\PermissionsController::class.':indexAction')
|
|
|
|
->setName('admin:permissions:index');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Admin\PermissionsController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:permissions:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Admin\PermissionsController::class.':editAction')
|
|
|
|
->setName('admin:permissions:add');
|
|
|
|
|
2018-02-07 12:16:29 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Admin\PermissionsController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:permissions:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'administer permissions']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/settings', Controller\Admin\SettingsController::class.':indexAction')
|
|
|
|
->setName('admin:settings:index')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'administer settings']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/stations', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\StationsController::class.':indexAction')
|
|
|
|
->setName('admin:stations:index');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Admin\StationsController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:stations:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Admin\StationsController::class.':editAction')
|
|
|
|
->setName('admin:stations:add');
|
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
$this->map(['GET', 'POST'], '/clone/{id}', Controller\Admin\StationsController::class.':cloneAction')
|
|
|
|
->setName('admin:stations:clone');
|
|
|
|
|
2018-02-07 12:16:29 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Admin\StationsController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:stations:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'administer stations']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/users', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Admin\UsersController::class.':indexAction')
|
|
|
|
->setName('admin:users:index');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Admin\UsersController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:users:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Admin\UsersController::class.':editAction')
|
|
|
|
->setName('admin:users:add');
|
|
|
|
|
2018-02-07 12:16:29 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Admin\UsersController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:users:delete');
|
|
|
|
|
2018-02-07 12:16:29 +00:00
|
|
|
$this->get('/login-as/{id}/{csrf}', Controller\Admin\UsersController::class.':impersonateAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('admin:users:impersonate');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'administer users']);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
// END /admin GROUP
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\Module\Admin::class)
|
|
|
|
->add(AzuraCast\Middleware\EnableView::class)
|
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'view administration'])
|
|
|
|
->add(AzuraCast\Middleware\RequireLogin::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$app->group('/api', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Api\IndexController::class.':indexAction')
|
|
|
|
->setName('api:index:index');
|
|
|
|
|
|
|
|
$this->get('/status', Controller\Api\IndexController::class.':statusAction')
|
|
|
|
->setName('api:index:status');
|
|
|
|
|
|
|
|
$this->get('/time', Controller\Api\IndexController::class.':timeAction')
|
|
|
|
->setName('api:index:time');
|
|
|
|
|
|
|
|
$this->group('/internal', function () {
|
|
|
|
|
|
|
|
$this->group('/{station}', function() {
|
|
|
|
|
2018-03-12 00:32:27 +00:00
|
|
|
// Liquidsoap internal authentication functions
|
2018-02-01 11:49:40 +00:00
|
|
|
$this->map(['GET', 'POST'], '/auth', Controller\Api\InternalController::class.':authAction')
|
|
|
|
->setName('api:internal:auth');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/nextsong', Controller\Api\InternalController::class.':nextsongAction')
|
|
|
|
->setName('api:internal:nextsong');
|
|
|
|
|
2018-02-03 21:54:12 +00:00
|
|
|
$this->map(['GET', 'POST'], '/djon', Controller\Api\InternalController::class.':djonAction')
|
|
|
|
->setName('api:internal:djon');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/djoff', Controller\Api\InternalController::class.':djoffAction')
|
|
|
|
->setName('api:internal:djoff');
|
|
|
|
|
2018-03-12 00:32:27 +00:00
|
|
|
// Station-watcher connection endpoint
|
|
|
|
$this->map(['GET', 'POST'], '/notify', Controller\Api\InternalController::class.':notifyAction')
|
|
|
|
->setName('api:internal:notify');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add(AzuraCast\Middleware\GetStation::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->get('/nowplaying[/{station}]', Controller\Api\NowplayingController::class.':indexAction')
|
|
|
|
->setName('api:nowplaying:index');
|
|
|
|
|
2018-02-17 01:58:58 +00:00
|
|
|
$this->get('/stations', Controller\Api\Stations\IndexController::class.':listAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('api:stations:list')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\RateLimit::class, 'api', 5, 2]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/station/{station}', function () {
|
|
|
|
|
2018-02-17 01:58:58 +00:00
|
|
|
$this->get('', Controller\Api\Stations\IndexController::class.':indexAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('api:stations:index')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\RateLimit::class, 'api', 5, 2]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->get('/nowplaying', Controller\Api\NowplayingController::class.':indexAction');
|
|
|
|
|
|
|
|
// This would not normally be POST-able, but Bootgrid requires it
|
|
|
|
$this->map(['GET', 'POST'], '/requests', Controller\Api\RequestsController::class.':listAction')
|
2018-02-03 12:31:05 +00:00
|
|
|
->setName('api:requests:list');
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/request/{media_id}', Controller\Api\RequestsController::class.':submitAction')
|
|
|
|
->setName('api:requests:submit')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\RateLimit::class, 'api', 5, 2]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->get('/listeners', Controller\Api\ListenersController::class.':indexAction')
|
|
|
|
->setName('api:listeners:index')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'view station reports', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
2018-02-17 01:58:58 +00:00
|
|
|
$this->get('/art/{media_id}', Controller\Api\Stations\MediaController::class.':artAction')
|
|
|
|
->setName('api:stations:media:art');
|
|
|
|
|
|
|
|
$this->post('/backend/{do}', Controller\Api\Stations\ServicesController::class.':backendAction')
|
|
|
|
->setName('api:stations:backend')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'manage station broadcasting', true]);
|
2018-02-17 01:58:58 +00:00
|
|
|
|
|
|
|
$this->post('/frontend/{do}', Controller\Api\Stations\ServicesController::class.':frontendAction')
|
|
|
|
->setName('api:stations:frontend')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'manage station broadcasting', true]);
|
2018-02-17 01:58:58 +00:00
|
|
|
|
|
|
|
$this->post('/restart', Controller\Api\Stations\ServicesController::class.':restartAction')
|
|
|
|
->setName('api:stations:restart')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'manage station broadcasting', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add(AzuraCast\Middleware\GetStation::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
// END /api GROUP
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\Module\Api::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
2018-04-08 02:25:42 +00:00
|
|
|
$app->get('/', Controller\Frontend\IndexController::class.':indexAction')
|
|
|
|
->setName('home');
|
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
$app->group('', function() {
|
|
|
|
|
2018-04-08 02:25:42 +00:00
|
|
|
$this->get('/dashboard', Controller\Frontend\DashboardController::class.':indexAction')
|
|
|
|
->setName('dashboard');
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->get('/logout', Controller\Frontend\AccountController::class.':logoutAction')
|
|
|
|
->setName('account:logout');
|
|
|
|
|
|
|
|
$this->get('/endsession', Controller\Frontend\AccountController::class.':endmasqueradeAction')
|
|
|
|
->setName('account:endmasquerade');
|
|
|
|
|
|
|
|
$this->get('/profile', Controller\Frontend\ProfileController::class.':indexAction')
|
|
|
|
->setName('profile:index');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/profile/edit', Controller\Frontend\ProfileController::class.':editAction')
|
|
|
|
->setName('profile:edit');
|
|
|
|
|
2018-02-06 11:09:05 +00:00
|
|
|
$this->get('/api_keys', Controller\Frontend\ApiKeysController::class.':indexAction')
|
|
|
|
->setName('api_keys:index');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/api_keys/edit/{id}', Controller\Frontend\ApiKeysController::class.':editAction')
|
2018-02-06 11:09:05 +00:00
|
|
|
->setName('api_keys:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/api_keys/add', Controller\Frontend\ApiKeysController::class.':editAction')
|
|
|
|
->setName('api_keys:add');
|
|
|
|
|
2018-02-07 12:32:23 +00:00
|
|
|
$this->get('/api_keys/delete/{id}/{csrf}', Controller\Frontend\ApiKeysController::class.':deleteAction')
|
2018-02-06 11:09:05 +00:00
|
|
|
->setName('api_keys:delete');
|
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
// Used for internal development
|
|
|
|
if (!APP_IN_PRODUCTION) {
|
|
|
|
$this->any('/test', Controller\Frontend\UtilController::class.':testAction')
|
2018-02-27 06:28:09 +00:00
|
|
|
->setName('util:test')
|
|
|
|
->add(App\Middleware\DebugEcho::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\EnableView::class)
|
|
|
|
->add(AzuraCast\Middleware\RequireLogin::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$app->map(['GET', 'POST'], '/login', Controller\Frontend\AccountController::class.':loginAction')
|
|
|
|
->setName('account:login')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\EnableView::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$app->group('/setup', function () {
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '', Controller\Frontend\SetupController::class.':indexAction')
|
|
|
|
->setName('setup:index');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/complete', Controller\Frontend\SetupController::class.':completeAction')
|
|
|
|
->setName('setup:complete');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/register', Controller\Frontend\SetupController::class.':registerAction')
|
|
|
|
->setName('setup:register');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/station', Controller\Frontend\SetupController::class.':stationAction')
|
|
|
|
->setName('setup:station');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/settings', Controller\Frontend\SetupController::class.':settingsAction')
|
|
|
|
->setName('setup:settings');
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\EnableView::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$app->group('/public/{station}', function () {
|
|
|
|
|
2018-03-09 00:06:18 +00:00
|
|
|
$this->get('[/{autoplay:autoplay}]', Controller\Frontend\PublicController::class.':indexAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('public:index');
|
|
|
|
|
2018-03-09 00:06:18 +00:00
|
|
|
$this->get('/embed[/{autoplay:autoplay}]', Controller\Frontend\PublicController::class.':embedAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('public:embed');
|
|
|
|
|
|
|
|
$this->get('/embed-requests', Controller\Frontend\PublicController::class.':embedrequestsAction')
|
|
|
|
->setName('public:embedrequests');
|
|
|
|
|
|
|
|
$this->get('/playlist[/{format}]', Controller\Frontend\PublicController::class.':playlistAction')
|
|
|
|
->setName('public:playlist');
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\GetStation::class)
|
|
|
|
->add(AzuraCast\Middleware\EnableView::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$app->group('/station/{station}', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\IndexController::class.':indexAction')
|
|
|
|
->setName('stations:index:index');
|
|
|
|
|
|
|
|
$this->group('/automation', function () {
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '', Controller\Stations\AutomationController::class.':indexAction')
|
|
|
|
->setName('stations:automation:index');
|
|
|
|
|
|
|
|
$this->get('/run', Controller\Stations\AutomationController::class.':runAction')
|
|
|
|
->setName('stations:automation:run');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'manage station automation', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/files', function () {
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->get('', Controller\Stations\Files\FilesController::class.':indexAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:index');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Stations\Files\EditController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:edit');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/rename/{path}', Controller\Stations\Files\FilesController::class.':renameAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:rename');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/list', Controller\Stations\Files\FilesController::class.':listAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:list');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/batch', Controller\Stations\Files\FilesController::class.':batchAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:batch');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/mkdir', Controller\Stations\Files\FilesController::class.':mkdirAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:mkdir');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/upload', Controller\Stations\Files\FilesController::class.':uploadAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:upload');
|
|
|
|
|
2018-04-16 00:53:27 +00:00
|
|
|
$this->map(['GET', 'POST'], '/download', Controller\Stations\Files\FilesController::class.':downloadAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:files:download');
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\Module\StationFiles::class)
|
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'manage station media', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/playlists', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\PlaylistsController::class.':indexAction')
|
|
|
|
->setName('stations:playlists:index');
|
|
|
|
|
2018-04-11 02:22:15 +00:00
|
|
|
$this->get('/schedule', Controller\Stations\PlaylistsController::class.':scheduleAction')
|
|
|
|
->setName('stations:playlists:schedule');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Stations\PlaylistsController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:playlists:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Stations\PlaylistsController::class.':editAction')
|
|
|
|
->setName('stations:playlists:add');
|
|
|
|
|
2018-02-07 12:32:23 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Stations\PlaylistsController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:playlists:delete');
|
|
|
|
|
2018-04-29 23:48:48 +00:00
|
|
|
$this->map(['GET', 'POST'], '/reorder/{id}', Controller\Stations\PlaylistsController::class.':reorderAction')
|
|
|
|
->setName('stations:playlists:reorder');
|
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
$this->get('/export/{id}[/{format}]', Controller\Stations\PlaylistsController::class.':exportAction')
|
|
|
|
->setName('stations:playlists:export');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'manage station media', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/mounts', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\MountsController::class.':indexAction')
|
|
|
|
->setName('stations:mounts:index');
|
|
|
|
|
|
|
|
$this->get('/migrate', Controller\Stations\MountsController::class.':migrateAction')
|
|
|
|
->setName('stations:mounts:migrate');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Stations\MountsController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:mounts:edit');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Stations\MountsController::class.':editAction')
|
|
|
|
->setName('stations:mounts:add');
|
|
|
|
|
2018-02-07 12:32:23 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Stations\MountsController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:mounts:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'manage station mounts', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/profile', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\ProfileController::class.':indexAction')
|
|
|
|
->setName('stations:profile:index');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/edit', Controller\Stations\ProfileController::class.':editAction')
|
|
|
|
->setName('stations:profile:edit')
|
2018-02-27 06:28:09 +00:00
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'manage station profile', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->group('/requests', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\RequestsController::class.':indexAction')
|
|
|
|
->setName('stations:requests:index');
|
|
|
|
|
2018-02-07 12:32:23 +00:00
|
|
|
$this->get('/delete/{request_id}/{csrf}', Controller\Stations\RequestsController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:requests:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'view station reports', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/reports', function () {
|
|
|
|
|
|
|
|
$this->get('/timeline[/format/{format}]', Controller\Stations\ReportsController::class.':timelineAction')
|
|
|
|
->setName('stations:reports:timeline');
|
|
|
|
|
|
|
|
$this->get('/performance[/format/{format}]', Controller\Stations\ReportsController::class.':performanceAction')
|
|
|
|
->setName('stations:reports:performance');
|
|
|
|
|
|
|
|
$this->get('/duplicates', Controller\Stations\ReportsController::class.':duplicatesAction')
|
|
|
|
->setName('stations:reports:duplicates');
|
|
|
|
|
|
|
|
$this->get('/duplicates/delete/{media_id}', Controller\Stations\ReportsController::class.':deletedupeAction')
|
|
|
|
->setName('stations:reports:deletedupe');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/listeners', Controller\Stations\ReportsController::class.':listenersAction')
|
|
|
|
->setName('stations:reports:listeners');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'view station reports', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
$this->group('/streamers', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\StreamersController::class.':indexAction')
|
|
|
|
->setName('stations:streamers:index');
|
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Stations\StreamersController::class.':editAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:streamers:edit');
|
2018-02-07 12:32:23 +00:00
|
|
|
|
2018-02-16 01:31:25 +00:00
|
|
|
$this->map(['GET', 'POST'], '/add', Controller\Stations\StreamersController::class.':editAction')
|
|
|
|
->setName('stations:streamers:add');
|
|
|
|
|
2018-02-07 12:32:23 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Stations\StreamersController::class.':deleteAction')
|
2018-02-01 11:49:40 +00:00
|
|
|
->setName('stations:streamers:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'manage station streamers', true]);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
2018-02-21 05:22:58 +00:00
|
|
|
$this->group('/webhooks', function () {
|
|
|
|
|
|
|
|
$this->get('', Controller\Stations\WebhooksController::class.':indexAction')
|
|
|
|
->setName('stations:webhooks:index');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/edit/{id}', Controller\Stations\WebhooksController::class.':editAction')
|
|
|
|
->setName('stations:webhooks:edit');
|
|
|
|
|
|
|
|
$this->map(['GET', 'POST'], '/add[/{type}]', Controller\Stations\WebhooksController::class.':addAction')
|
|
|
|
->setName('stations:webhooks:add');
|
|
|
|
|
2018-02-26 03:07:40 +00:00
|
|
|
$this->get('/toggle/{id}/{csrf}', Controller\Stations\WebhooksController::class.':toggleAction')
|
|
|
|
->setName('stations:webhooks:toggle');
|
|
|
|
|
2018-02-21 05:22:58 +00:00
|
|
|
$this->get('/delete/{id}/{csrf}', Controller\Stations\WebhooksController::class.':deleteAction')
|
|
|
|
->setName('stations:webhooks:delete');
|
|
|
|
|
2018-02-27 06:28:09 +00:00
|
|
|
})->add([AzuraCast\Middleware\Permissions::class, 'manage station web hooks', true]);
|
2018-02-21 05:22:58 +00:00
|
|
|
|
2018-02-01 11:49:40 +00:00
|
|
|
// END /stations GROUP
|
|
|
|
|
|
|
|
})
|
2018-02-27 06:28:09 +00:00
|
|
|
->add(AzuraCast\Middleware\Module\Stations::class)
|
|
|
|
->add([AzuraCast\Middleware\Permissions::class, 'view station administration', true])
|
|
|
|
->add(AzuraCast\Middleware\GetStation::class)
|
|
|
|
->add(AzuraCast\Middleware\EnableView::class)
|
|
|
|
->add(AzuraCast\Middleware\RequireLogin::class);
|
2018-02-01 11:49:40 +00:00
|
|
|
|
|
|
|
};
|