diff --git a/app/Http/Controllers/EsiScopeController.php b/app/Http/Controllers/EsiScopeController.php new file mode 100644 index 000000000..38aa87471 --- /dev/null +++ b/app/Http/Controllers/EsiScopeController.php @@ -0,0 +1,39 @@ +middleware('auth'); + $this->middleware('role:User'); + } + + public function displayScopes() { + return view('scopes.select'); + } + + public function redirectToProvider(Request $request) { + //Set the array to build it + $scopes = array(); + $i = 0; + foreach($request as $req) { + $scopes[$i] = $req; + $i++; + } + + return Socialite::driver('eveonline')->setScopes($scopes)->redirect(); + } + +} diff --git a/app/Http/Controllers/FinancesController.php b/app/Http/Controllers/FinancesController.php index 519b65b84..de87a0ae6 100644 --- a/app/Http/Controllers/FinancesController.php +++ b/app/Http/Controllers/FinancesController.php @@ -21,14 +21,6 @@ class FinancesController extends Controller $this->middleware('role:Admin'); } - public function redirectToProvider() { - if(!Auth::check()) { - return redirect()->to('/'); - } - - return Socialite::driver('eveonline')->setScopes(['publicData', 'esi-wallet.read_corporation_wallets.v1'])->redirect(); - } - public function displayWallet() { $esi = new \App\Library\Finances(); diff --git a/app/Http/Controllers/FleetsController.php b/app/Http/Controllers/FleetsController.php index 5ab07c082..825f337b6 100644 --- a/app/Http/Controllers/FleetsController.php +++ b/app/Http/Controllers/FleetsController.php @@ -8,5 +8,30 @@ class FleetsController extends Controller { public function __construct() { $this->middleware('auth'); + $this->middleware('role:User'); + } + + public function displayRegisterFleet() { + return view('fleets.registerfleet'); + } + + public function displayStandingFleet() { + return view('fleets.displaystanding'); + } + + public function registerFleet() { + + } + + public function createWing() { + + } + + public function createSquad() { + + } + + public function addPilot() { + } } diff --git a/app/Library/Esi.php b/app/Library/Esi.php new file mode 100644 index 000000000..e40116d81 --- /dev/null +++ b/app/Library/Esi.php @@ -0,0 +1,30 @@ +where('character_id', $charId)->get(); + foreach($checks as $check) { + if($check === $scope){ + return true; + } + } + + return false; + } + +} + +?> \ No newline at end of file diff --git a/app/Library/Finances.php b/app/Library/Finances.php index bc01dbcb1..4afd10d26 100644 --- a/app/Library/Finances.php +++ b/app/Library/Finances.php @@ -7,8 +7,8 @@ namespace App\Library; - use Illuminate\Http\Request; - use Session; +use Illuminate\Http\Request; +use Session; use DB; use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Client; @@ -25,7 +25,8 @@ class Finances { private $esi; - public function __construct() { + public function __construct($charId = null) { + $user = DB::table('users')->where('name', 'Minerva Arbosa')->first(); $authentication = new \Seat\Eseye\Containers\EsiAuthentication([ @@ -35,8 +36,6 @@ class Finances { ]); $this->esi = new \Seat\Eseye\Eseye($authentication); - - } public function GetMarketGroups() { diff --git a/app/Library/Fleet.php b/app/Library/Fleet.php index ab426a07d..178af690c 100644 --- a/app/Library/Fleet.php +++ b/app/Library/Fleet.php @@ -2,42 +2,97 @@ namespace App\Library; -use Illuminate\Http\Request; -use App\Http\Controllers\Controller; use Session; use DB; -use GuzzleHttp\Exception\GuzzleException; + +use Seat\Eseye\Cache\NullCache; +use Seat\Eseye\Configuration; +use Seat\Eseye\Containers\EsiAuthentication; +use Seat\Eseye\Eseye; class Fleet { + /** + * Get fleet information + */ + public function GetFleetInfo($uri) { + + } + + /** + * Update fleet information + */ + public function UpdateFleet($fleet) { + + } + /** * Create a standing fleet from a registered fleet. */ - public function createStandingFleet() { + public function CreateStandingFleet($fleet) { } /** * Join the standing fleet */ - public function joinStandingFleet($fleet) { + public function JoinStandingFleet($fleet, $charId) { } - public function leaveStandingFleet() { + /** + * Leave the standing fleet + */ + public function LeaveStandingFleet($fleet, $charId) { } - public function createNewWing() { + /** + * Create new wing in a fleet + */ + public function CreateNewWing($fleet) { } - public function createNewSquad() { + /** + * Create new squad in a fleet + */ + public function CreateNewSquad($fleet) { } - public function modifyMOTD() { + /** + * Modify the MotD of a fleet + */ + public function ModifyMOTD($fleet) { } + + /** + * Get a fleet's squads + */ + public function GetSquads($fleet) { + + } + + /** + * Rename a fleet's squad + */ + public function RenameSquad($fleet, $squad, $name) { + + } + /** + * Get fleet's wings + */ + public function GetWings($fleet) { + + } + + /** + * Rename a fleet wing + */ + public function RenameWing($fleet, $wing, $name) { + + } } ?> \ No newline at end of file diff --git a/resources/views/fleets/displaystanding.blade.php b/resources/views/fleets/displaystanding.blade.php new file mode 100644 index 000000000..528eb3a46 --- /dev/null +++ b/resources/views/fleets/displaystanding.blade.php @@ -0,0 +1,12 @@ +@extends('layouts.b4') +@section('content') +