clrghouz/routes/web.php

157 lines
6.3 KiB
PHP

<?php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\{HomeController,
DomainController,
EchoareaController,
EchomailController,
FileareaController,
NetmailController,
SystemController,
UserController,
UserSwitchController,
ZoneController};
use App\Http\Controllers\Auth\LoginController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Auth::routes([
'login' => true,
'logout' => true,
'register' => true,
'reset' => true, // for resetting passwords
'confirm' => true, // for additional password confirmations
'verify' => true, // for email verification
]);
Route::get('logout',[LoginController::class,'logout']);
Route::get('admin/switch/start/{o}',[UserSwitchController::class,'user_switch_start']);
Route::get('admin/switch/stop',[UserSwitchController::class,'user_switch_stop']);
// Unauthed routes
Route::get('/',[HomeController::class,'home']);
Route::view('about','about');
Route::view('domain/list','domain.list');
Route::get('domain/view/{o}',[DomainController::class,'view'])
->where('o','[0-9]+');
Route::match(['get','post'],'pkt',[HomeController::class,'pkt']);
Route::get('/status',[HomeController::class,'status']);
Route::view('system/list','system.list');
Route::get('system/view/{o}',[SystemController::class,'view'])
->where('o','[0-9]+');
Route::get('search',[HomeController::class,'search']);
Route::view('user/permissions','auth.permissions');
Route::middleware(['auth','verified','activeuser'])->group(function () {
Route::view('dashboard','dashboard');
/* ACCOUNT PATHS */
Route::match(['get','post'],'user/addedit/{o?}',[UserController::class,'add_edit'])
->where('o','[0-9]+');
/* ADDRESS PATHS */
Route::post('address/api/validated/{state}',[SystemController::class,'api_address_validated_toggle'])
->whereIn('state',['on','off']);
/* DOMAIN PATHS */
Route::view('domain','domain.home');
Route::get('domain/api/hosts/{o}/{region}',[DomainController::class,'api_hosts'])
->where('o','[0-9]+')
->where('region','[0-9]+');
Route::get('domain/api/hubs/{o}/{host}',[DomainController::class,'api_hubs'])
->where('o','[0-9]+');
Route::get('domain/api/regions/{o}',[DomainController::class,'api_regions'])
->where('o','[0-9]+');
Route::match(['get','post'],'domain/addedit/{o?}',[DomainController::class,'add_edit'])
->where('o','[0-9]+');
Route::view('echoarea','echoarea.home');
Route::match(['get','post'],'echoarea/addedit/{o?}',[EchoareaController::class,'add_edit'])
->where('o','[0-9]+');
Route::view('filearea','filearea.home');
Route::match(['get','post'],'filearea/addedit/{o?}',[FileareaController::class,'add_edit'])
->where('o','[0-9]+');
/* SYSTEM PATHS */
Route::view('system','system.home');
Route::post('system/api/address/{o}',[SystemController::class,'api_address'])
->where('o','[0-9]+');
Route::post('system/api/autohold/{state}',[SystemController::class,'api_autohold_toggle'])
->whereIn('state',['on','off']);
Route::get('system/api/address/get/{o}',[SystemController::class,'api_address_get'])
->where('o','[0-9]+');
Route::get('system/api/address/orphan',[SystemController::class,'api_address_orphan']);
Route::match(['get','post'],'system/addedit/{o?}',[SystemController::class,'add_edit'])
->where('o','[0-9]+');
Route::post('system/address/add/{o}',[SystemController::class,'address_add'])
->where('o','[0-9]+');
Route::get('system/address/del/{o}',[SystemController::class,'address_del'])
->where('o','[0-9]+');
Route::get('system/address/dem/{o}',[SystemController::class,'address_dem'])
->where('o','[0-9]+');
Route::match(['get','post'],'system/address/mov/{so}/{o}',[SystemController::class,'address_mov'])
->where('so','[0-9]+')
->where('o','[0-9]+');
Route::get('system/address/pro/{o}',[SystemController::class,'address_pro'])
->where('o','[0-9]+');
Route::get('system/address/pur/{id}',[SystemController::class,'address_pur'])
->where('o','[0-9]+');
Route::get('system/address/rec/{id}',[SystemController::class,'address_rec'])
->where('o','[0-9]+');
Route::get('system/address/sus/{o}',[SystemController::class,'address_sus'])
->where('o','[0-9]+');
Route::match(['get','post'],'system/areafix/{o}/{zo}',[SystemController::class,'areafix'])
->where('o','[0-9]+')
->where('zo','[0-9]+');
Route::match(['get','post'],'system/echoarea/{o}',[SystemController::class,'echoareas'])
->where('o','[0-9]+');
Route::match(['get','post'],'system/filearea/{o}',[SystemController::class,'fileareas'])
->where('o','[0-9]+');
Route::view('system/ours','system.ours');
Route::post('system/session/add/{o}',[SystemController::class,'session_add'])
->where('o','[0-9]+');
Route::get('system/session/del/{o}/{zo}',[SystemController::class,'session_del'])
->where('o','[0-9]+')
->where('zo','[0-9]+');
Route::post('file/contents/{o}/{date}',[HomeController::class,'file_contents'])
->where('o','[0-9]+')
->where('date','[0-9:\-@]+');
Route::match(['get','post'],'link',[UserController::class,'link']);
Route::post('packet/contents/{o}/{packet}',[HomeController::class,'packet_contents'])
->where('o','[0-9]+')
->where('packet','[[:xdigit:]]+');
Route::match(['get','post'],'user/system/register',[SystemController::class,'register']);
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']);
/* ZONE PATHS */
Route::view('zone','zone.home');
Route::post('zone/api/default/{o}',[ZoneController::class,'api_default'])
->where('o','[0-9]+');
Route::match(['get','post'],'zone/addedit/{o?}',[ZoneController::class,'add_edit'])
->where('o','[0-9]+');
});
Route::middleware(['auth','can:view,o'])->group(function () {
Route::get('echomail/view/{o}',[EchomailController::class,'view']);
Route::get('netmail/view/{o}',[NetmailController::class,'view']);
});
Route::middleware(['auth','can:admin'])->group(function () {
Route::match(['get','post'],'address/merge/{id}',[SystemController::class,'address_merge']);
Route::match(['get','post'],'setup',[HomeController::class,'setup']);
Route::view('user/list','user.list');
});