This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/routes/web.php

109 lines
5.1 KiB
PHP
Raw Normal View History

2019-04-24 18:46:41 +00:00
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/', ['middleware' => 'gui', 'uses' => 'GUI\PublicController@index']);
2019-04-25 15:33:15 +00:00
#$router->get('/api/v4/user', ['uses' => 'oAuthController@getUserTMP']);
#$router->get('/api/v4/groups', ['uses' => 'oAuthController@getGroupsTMP']);
2019-04-24 18:46:41 +00:00
2019-04-25 12:19:16 +00:00
//Gitlab like oauth
$router->group(['prefix' => 'gitlab', 'middleware' => 'gui'], function () use ($router) {
2019-04-25 15:33:15 +00:00
$router->group(['prefix' => 'oauth'], function () use ($router) {
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
$router->post("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeDo']);
$router->post("/token", ['uses' => 'oAuthController@token']);
});
$router->get('/api/v4/user', ['uses' => 'oAuthController@getUserTMP']);
$router->get('/api/v4/groups', ['uses' => 'oAuthController@getGroupsTMP']);
2019-04-25 12:19:16 +00:00
});
//Oauth URLS
$router->group(['prefix' => 'oauth'], function () use ($router) {
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
$router->post("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeDo']);
$router->post("/token", ['uses' => 'oAuthController@token']);
});
//Internal API
2019-04-25 15:33:15 +00:00
$router->group(['prefix' => 'api', 'middleware' => 'auth'], function () use ($router) {
$router->group(['prefix' => 'v1'], function () use ($router) {
$router->group(['prefix' => 'account'], function () use ($router) {
$router->get("/", ['uses' => 'API\AccountController@getUsers']);
$router->get("/{id}", ['uses' => 'API\AccountController@getUser']);
});
2019-04-28 12:49:10 +00:00
$router->group(['prefix' => 'user'], function () use ($router) {
});
2019-04-25 15:33:15 +00:00
});
2019-04-25 12:19:16 +00:00
});
2019-04-28 12:49:10 +00:00
$router->post("api/v1/user/login", ['uses' => 'API\UserController@passwordLogin']);
$router->get("api/v1/user/captcha", ['uses' => 'API\UserController@reCAPTCHA']);
2019-04-24 18:46:41 +00:00
$router->group(['prefix' => 'gui', 'middleware' => 'gui'], function () use ($router) {
$router->get('/register', ['uses' => 'GUI\AccountController@registerView']);
$router->post('/register', ['uses' => 'GUI\AccountController@register']);
$router->get('/invite', ['uses' => 'GUI\AccountController@inviteView']);
$router->get('/login', ['uses' => 'GUI\AccountController@loginView']);
$router->get('/logout', ['uses' => 'GUI\AccountController@logout']);
$router->post('/login', ['uses' => 'GUI\AccountController@login']);
$router->get('/apps', ['uses' => 'GUI\AppController@appList']);
$router->get('/apps/new', ['uses' => 'GUI\AppController@newAppView']);
$router->post('/apps/new', ['uses' => 'GUI\AppController@newApp']);
$router->get('/apps/{id}', ['uses' => 'GUI\AppController@viewApp']);
2019-04-25 10:03:34 +00:00
$router->post('/apps/{id}', ['uses' => 'GUI\AppController@updateApp']);
2019-04-24 18:46:41 +00:00
$router->post('/apps/{id}/changeIcon', ['uses' => 'GUI\AppController@changeIcon']);
$router->get('/apps/{id}/icon', ['uses' => 'GUI\AppController@getAppIcon']);
$router->get("/mailValidation/{id}/{code}", ['uses' => 'GUI\AccountController@validateEMail']);
//Admin
$router->get("/admin/settings", ['uses' => 'GUI\AdminController@settingsView']);
$router->post("/admin/settings", ["uses" => "GUI\AdminController@saveSettings"]);
$router->get("/admin/apps", ["uses" => "GUI\AdminController@appList"]);
$router->get("/admin/apps/{id}", ["uses" => "GUI\AdminController@appDetails"]);
$router->post("/admin/apps/{id}", ["uses" => "GUI\AdminController@appDetailsSave"]);
$router->get("/admin/invites", ["uses" => "GUI\AdminController@inviteView"]);
$router->get("/admin/invites/new", ["uses" => "GUI\AdminController@inviteNewView"]);
$router->post("/admin/invites/new", ["uses" => "GUI\AdminController@inviteNew"]);
2019-04-25 12:19:16 +00:00
$router->get("/admin/users", ["uses" => 'GUI\AdminController@listUser']);
$router->get("/admin/users/{id}", ["uses" => 'GUI\AdminController@userDetails']);
$router->post("/admin/users/{id}", ["uses" => 'GUI\AdminController@saveUserDetails']);
2019-04-24 18:46:41 +00:00
2019-04-25 15:33:15 +00:00
$router->get('/profile', ['uses' => 'GUI\AccountController@profileView']);
$router->post('/profile/addMail', ['uses' => 'GUI\AccountController@addMail']);
$router->get('/profile/changePrimaryMail', ['uses' => 'GUI\AccountController@changePrimaryMail']);
$router->get('/profile/removeMail', ['uses' => 'GUI\AccountController@removeMail']);
$router->post('/profile/changePassword', ['uses' => 'GUI\AccountController@changePassword']);
$router->get('/access', ['uses' => 'GUI\AccessController@listAccess']);
$router->get('/access/rm', ['uses' => 'GUI\AccessController@removeAccess']);
2019-04-24 18:46:41 +00:00
});
/*$router->group(['prefix' => 'api'], function () use ($router) {
$router->group(['prefix' => 'auth'], function () use ($router) {
$router->post('/register', ['uses' => 'GUI\AccountController@register']);
});
});*/