added scopes view
added fleets displays added scopes display modified routes file added Fleet file in class Library modified Finances Controller add EsiScopesController laid out fleet framework file in class library
This commit is contained in:
39
app/Http/Controllers/EsiScopeController.php
Normal file
39
app/Http/Controllers/EsiScopeController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Socialite;
|
||||
use Auth;
|
||||
use App\User;
|
||||
|
||||
use Seat\Eseye\Cache\NullCache;
|
||||
use Seat\Eseye\Configuration;
|
||||
use Seat\Eseye\Containers\EsiAuthentication;
|
||||
use Seat\Eseye\Eseye;
|
||||
|
||||
class EsiScopeController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
30
app/Library/Esi.php
Normal file
30
app/Library/Esi.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use App\Models\CreateEsiScopes;
|
||||
|
||||
use DB;
|
||||
|
||||
class Esi {
|
||||
|
||||
/**
|
||||
* Check if a scope is in the database for a particular character
|
||||
*
|
||||
* @param charId
|
||||
* @param scope
|
||||
*
|
||||
* @return true,false
|
||||
*/
|
||||
public function CheckScope($charId, $scope) {
|
||||
$checks = DB::table('EsiScopes')->where('character_id', $charId)->get();
|
||||
foreach($checks as $check) {
|
||||
if($check === $scope){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
12
resources/views/fleets/displaystanding.blade.php
Normal file
12
resources/views/fleets/displaystanding.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Standing Fleet</h2>
|
||||
<a href="{{ route('/fleets/addpilot', ['id' => $charId]) }}">Join Standing Fleet</a>
|
||||
@if($fleetCommander == true)
|
||||
<a href="{{ route('/fleets/{id}/createwing', ['id' => $fleetId]) }}">Create Wing</a>
|
||||
<a href="{{ route('/fleets/{id}/createsquad', ['id' => $fleetId]) }}">Create Squad</a>
|
||||
@endif
|
||||
Display some other cool stuff about the fleet
|
||||
</div>
|
||||
@endsection
|
||||
13
resources/views/fleets/registerfleet.blade.php
Normal file
13
resources/views/fleets/registerfleet.blade.php
Normal file
@@ -0,0 +1,13 @@
|
||||
@extends('layouts.b4')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Register A New Fleet</h2>
|
||||
{!! Form::open(['action' => 'FleetsController@registerFleet', 'method' => 'POST']) !!}
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('fleet', 'Fleet') }}
|
||||
{{ Form::text('fleet', '', ['class' => 'form-control', 'placeholder' => 'Fleet URL']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1 +0,0 @@
|
||||
Register Standing Work in Progress!
|
||||
29
resources/views/scopes/select.blade.php
Normal file
29
resources/views/scopes/select.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
@extends('layout.b4');
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Select Scopes for ESI</h2>
|
||||
{!! From::open(['action' => 'EsiScopeController@redirectToProvider', 'method' => 'POST']) !!}
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Public Data') }}
|
||||
{{ Form::checkbox('scopes[]', 'publicData') }}
|
||||
{{ Form::label('scopes[]', 'Write Fleet') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-fleets.write_fleet.v1') }}
|
||||
{{ Form::label('scopes[]', 'Read Fleet') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-fleets.read_fleet.v1') }}
|
||||
{{ Form::label('scopes[]', 'Read Location') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-location.read_location.v1') }}
|
||||
{{ Form::label('scopes[]', 'Write Mail') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-mail.send_mail.v1') }}
|
||||
{{ Form::label('scopes[]', 'Read Mail') }}
|
||||
{{ Form::label('scopes[]', 'esi-mail.read_mail.v1')}}
|
||||
{{ Form::label('scopes[]', 'Corporation Wallets') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-wallet.read_corporation_wallets.v1') }}
|
||||
{{ Form::label('scopes[]', 'Read Structures') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-corporations.read_structures.v1') }}
|
||||
{{ Form::label('scopes[]', 'Structure Markets') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-markets.structure_markets.v1') }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
@@ -19,6 +19,7 @@ Route::get('/', function () {
|
||||
Route::get('/login', 'Auth\LoginController@redirectToProvider')->name('login');
|
||||
Route::get('/callback', 'Auth\LoginController@handleProviderCallback')->name('callback');
|
||||
Route::get('/logout', 'Auth\LoginController@logout')->name('logout');
|
||||
|
||||
//Dashboard Controller Display pages
|
||||
Route::get('/dashboard', 'DashboardController@index');
|
||||
|
||||
@@ -26,13 +27,10 @@ Route::get('/dashboard', 'DashboardController@index');
|
||||
Route::get('/moons/display', 'MoonsController@displayMoons');
|
||||
Route::get('/moons/addmoon', 'MoonsController@addMoon');
|
||||
Route::get('/moons/updatemoon', 'MoonsController@updateMoon');
|
||||
//Route::get('/moons/worth', 'MoonsController@displayWorth');
|
||||
//Route::get('/moons/mined', 'MoonsController@displayMined');
|
||||
|
||||
//Moon Controller POST requests
|
||||
Route::post('storeMoon', 'MoonsController@storeMoon');
|
||||
Route::post('storeUpdateMoon', 'MoonsController@storeUpdateMoon');
|
||||
//Route::post('worth', 'MoonsController@displayMoonWorth');
|
||||
//Route::post('mined', 'MoonsController@displayMoonMined');
|
||||
|
||||
//Wiki Controller display pages
|
||||
Route::get('/wiki/register', 'WikiController@displayRegister');
|
||||
@@ -41,6 +39,14 @@ Route::get('/wiki/changepassword', 'WikiController@displayChangePassword');
|
||||
Route::post('storeRegister', 'WikiController@storeRegister');
|
||||
Route::post('changePassword', 'WikiController@changePassword');
|
||||
|
||||
//Finance Controller display pages
|
||||
Route::get('/finances/login', 'FinancesController@redirectToProvider');
|
||||
Route::get('/finances/display/wallet', 'FinancesController@displayWallet');
|
||||
//Scopes Controller display pages
|
||||
Route::get('/scopes/select', 'EsiScopeController@displayScopes');
|
||||
Route::post('redirectToProvider', 'EsiScopeController@redirectToProvider');
|
||||
|
||||
//Fleet Controller display pages
|
||||
Route::get('/fleets/display');
|
||||
Route::get('/fleets/register', 'FleetsController@displayRegisterFleet');
|
||||
Route::get('/fleets/standing', 'FleetsController@displayStandingFleet');
|
||||
Route::get('/fleets/addpilot/{id}', 'FleetsController@addPilot');
|
||||
Route::get('/fleets/{id}/createwing', 'FleetsController@createWing');
|
||||
Route::get('/fleets/{id}/createsquad', 'FleetsController@createSquad');
|
||||
Reference in New Issue
Block a user