mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Moved some pages to be within admin route (#13782)
* Moved plugin admin pages to be within admin route * Wrap html transports page in admin check * Moved Port group controller to be admin protected * fixed tests
This commit is contained in:
parent
4c9d4eefd8
commit
95970af78e
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (Auth::user()->hasGlobalAdmin()) {
|
||||
// handle OAuth requests
|
||||
$request = request(); // grab the Request object
|
||||
|
||||
@ -27,3 +28,6 @@ unset($request);
|
||||
|
||||
// print alert transports
|
||||
require_once 'includes/html/print-alert-transports.php';
|
||||
} else {
|
||||
include 'includes/html/error-no-perm.inc.php';
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ Route::group(['middleware' => ['auth'], 'guard' => 'auth'], function () {
|
||||
// pages
|
||||
Route::post('alert/{alert}/ack', [\App\Http\Controllers\AlertController::class, 'ack'])->name('alert.ack');
|
||||
Route::resource('device-groups', 'DeviceGroupController');
|
||||
Route::resource('port-groups', 'PortGroupController');
|
||||
Route::resource('port', 'PortController', ['only' => 'update']);
|
||||
Route::group(['prefix' => 'poller'], function () {
|
||||
Route::get('', 'PollerController@pollerTab')->name('poller.index');
|
||||
@ -75,11 +74,14 @@ Route::group(['middleware' => ['auth'], 'guard' => 'auth'], function () {
|
||||
Route::delete('settings/{name}', 'SettingsController@destroy')->name('settings.destroy');
|
||||
|
||||
Route::post('alert/transports/{transport}/test', [\App\Http\Controllers\AlertTransportController::class, 'test'])->name('alert.transports.test');
|
||||
});
|
||||
|
||||
Route::get('plugin/settings', 'PluginAdminController')->name('plugin.admin');
|
||||
Route::get('plugin/settings/{plugin:plugin_name}', 'PluginSettingsController')->name('plugin.settings');
|
||||
Route::post('plugin/settings/{plugin:plugin_name}', 'PluginSettingsController@update')->name('plugin.update');
|
||||
|
||||
Route::resource('port-groups', 'PortGroupController');
|
||||
});
|
||||
|
||||
Route::get('plugin', 'PluginLegacyController@redirect');
|
||||
Route::redirect('plugin/view=admin', '/plugin/admin');
|
||||
Route::get('plugin/p={pluginName}', 'PluginLegacyController@redirect');
|
||||
|
Loading…
Reference in New Issue
Block a user