web.php 3.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?php
/*
    Flexisip Account Manager is a set of tools to manage SIP accounts.
    Copyright (C) 2019 Belledonne Communications SARL, All rights reserved.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

Timothée Jaussoin's avatar
Timothée Jaussoin committed
20
//Route::get('/', 'HomeController@index')->name('home');
21

Timothée Jaussoin's avatar
Timothée Jaussoin committed
22 23
Route::get('login', 'AccountController@login')->name('account.login');
Route::post('authenticate', 'AccountController@authenticate')->name('account.authenticate');
24

25
Route::get('login/email', 'AccountController@loginEmail')->name('account.login_email');
Timothée Jaussoin's avatar
Timothée Jaussoin committed
26
Route::get('terms', 'AccountController@terms')->name('account.terms');
27 28 29 30 31 32 33
Route::post('authenticate/email', 'AccountController@authenticateEmail')->name('account.authenticate_email');
Route::get('authenticate/email/{code}', 'AccountController@authenticateEmailConfirm')->name('account.authenticate_email_confirm');

Route::get('login/phone', 'AccountController@loginPhone')->name('account.login_phone');
Route::post('authenticate/phone', 'AccountController@authenticatePhone')->name('account.authenticate_phone');
Route::post('authenticate/phone/confirm', 'AccountController@authenticatePhoneConfirm')->name('account.authenticate_phone_confirm');

34 35 36
Route::get('register', 'AccountController@register')->name('account.register');
Route::post('register', 'AccountController@store')->name('account.store');

37
Route::group(['middleware' => 'auth'], function () {
Timothée Jaussoin's avatar
Timothée Jaussoin committed
38 39 40
    Route::get('/', 'AccountController@index')->name('account.index');
    Route::get('logout', 'AccountController@logout')->name('account.logout');

Timothée Jaussoin's avatar
Timothée Jaussoin committed
41 42 43
    Route::get('delete', 'AccountController@delete')->name('account.delete');
    Route::delete('delete', 'AccountController@destroy')->name('account.destroy');

Timothée Jaussoin's avatar
Timothée Jaussoin committed
44 45 46 47
    Route::get('email', 'AccountEmailController@show')->name('account.email');
    Route::post('email', 'AccountEmailController@update')->name('account.email.update');
    Route::get('password', 'AccountPasswordController@show')->name('account.password');
    Route::post('password', 'AccountPasswordController@update')->name('account.password.update');
48 49 50
});

Route::group(['middleware' => 'auth.admin'], function () {
51 52
    Route::get('admin/accounts/{search?}', 'Admin\AccountController@index')->name('admin.account.index');
    Route::post('admin/search', 'Admin\AccountController@search')->name('admin.account.search');
53

54
    Route::get('admin/accounts/show/{id}', 'Admin\AccountController@show')->name('admin.account.show');
55 56 57 58
    Route::get('admin/accounts/{id}/activate', 'Admin\AccountController@activate')->name('admin.account.activate');
    Route::get('admin/accounts/{id}/deactivate', 'Admin\AccountController@deactivate')->name('admin.account.deactivate');
    Route::get('admin/accounts/{id}/admin', 'Admin\AccountController@admin')->name('admin.account.admin');
    Route::get('admin/accounts/{id}/unadmin', 'Admin\AccountController@unadmin')->name('admin.account.unadmin');
59
});