scopes and other files
This commit is contained in:
@@ -4,6 +4,10 @@ namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use DB;
|
||||
|
||||
use App\Library\Finances;
|
||||
|
||||
class corpJournal extends Command
|
||||
{
|
||||
/**
|
||||
@@ -37,6 +41,11 @@ class corpJournal extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
//Get the characters that have the esi-wallet.read_corporation_wallets.v1
|
||||
//esi wallet scope
|
||||
$characters = DB::table('EsiScopes')->where('scopes', 'esi-wallet.read_corporation_wallets.v1')->get();
|
||||
foreach($characters as $char) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@ namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Models\AllianceCorp;
|
||||
|
||||
use Seat\Eseye\Cache\NullCache;
|
||||
use Seat\Eseye\Configuration;
|
||||
use Seat\Eseye\Containers\EsiAuthentication;
|
||||
use Seat\Eseye\Eseye;
|
||||
|
||||
class getCorps extends Command
|
||||
{
|
||||
/**
|
||||
@@ -37,6 +44,33 @@ class getCorps extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
//Set the parameters for ESI
|
||||
$configuration = Configuration::getInstance();
|
||||
$configuration->logfile_location = 'var/www/w4rpservices/storage/logs/eseye';
|
||||
//Create the ESI container
|
||||
$esi = new Eseye();
|
||||
//try the esi call to get all of the corporations in the alliance
|
||||
try {
|
||||
$corporations = $esi->invoke('get', '/alliances/{alliance_id}/corporations/', [
|
||||
'alliance_id' => 99004116,
|
||||
]);
|
||||
} catch(\Seat\Eseye\Exceptions\RequestFailedException $e){
|
||||
dd($e->getEsiResponse());
|
||||
}
|
||||
//Delete all of the entries in the AllianceCorps table
|
||||
DB::table('AllianceCorps')->delete();
|
||||
foreach($corporations as $corp) {
|
||||
try {
|
||||
$corpInfo = $esi->invoke('get', '/corporations/{corporation_id}/', [
|
||||
'corporation_id' => $corp,
|
||||
]);
|
||||
} catch(\Seat\Eseye\Exceptions\RequestFailedException $e) {
|
||||
return $e->getEsiResponse();
|
||||
}
|
||||
$entry = new AllianceCorp;
|
||||
$entry->corporation_id = $corp;
|
||||
$entry->name = $corpInfo->name;
|
||||
$entry->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,11 @@ class EsiScopeController extends Controller
|
||||
}
|
||||
|
||||
public function displayScopes() {
|
||||
return view('scopes.select');
|
||||
//Get the ESI Scopes for the user
|
||||
$scopes = DB::table('EsiScopes')->where('character_id', Auth::user()->character_id)->get();
|
||||
//We want to send the scopes to the page as pre-checked.
|
||||
dd($scopes);
|
||||
return view('scopes.select')->with('scopes', $scopes);
|
||||
}
|
||||
|
||||
public function redirectToProvider(Request $request) {
|
||||
|
||||
@@ -110,8 +110,8 @@ class Finances {
|
||||
//Create the ESI authentication container
|
||||
$config = config('esi');
|
||||
$authentication = new EsiAuthentication([
|
||||
'client_id' => $config['esi']['client_id'],
|
||||
'secret' => $config['esi']['secret'],
|
||||
'client_id' => $config['client_id'],
|
||||
'secret' => $config['secret'],
|
||||
'refresh_token' => $token[0]->refresh_token,
|
||||
]);
|
||||
//Create the esi class variable
|
||||
@@ -142,8 +142,8 @@ class Finances {
|
||||
//Create the ESI authentication container
|
||||
$config = config('esi');
|
||||
$authentication = new EsiAuthentication([
|
||||
'client_id' => $config['esi']['client_id'],
|
||||
'secret' => $config['esi']['secret'],
|
||||
'client_id' => $config['client_id'],
|
||||
'secret' => $config['secret'],
|
||||
'refresh_token' => $token[0]->refresh_token,
|
||||
]);
|
||||
//Create the esi class variable
|
||||
|
||||
@@ -68,8 +68,8 @@ class Fleet {
|
||||
//Create the esi authentication container
|
||||
$config = config('esi');
|
||||
$authentication = new \Seat\Eseye\Containers\EsiAuthentication([
|
||||
'client_id' => $config['esi']['client_id'],
|
||||
'secret' => $config['esi']['secret'],
|
||||
'client_id' => $config['client_id'],
|
||||
'secret' => $config['secret'],
|
||||
'refresh_token' => $token->refresh_token,
|
||||
]);
|
||||
//Create the esi class
|
||||
@@ -98,8 +98,8 @@ class Fleet {
|
||||
//Create the ESI Call Container
|
||||
$config = config('esi');
|
||||
$authentication = new \Seat\Eseye\Containers\EsiAuthentication([
|
||||
'client_id' => $config['esi']['client_id'],
|
||||
'secret' => $config['esi']['secret'],
|
||||
'client_id' => $config['client_id'],
|
||||
'secret' => $config['secret'],
|
||||
'refresh_token' => $token[0]->refresh_token,
|
||||
]);
|
||||
$esi = new \Seat\Eseye\Eseye($authentication);
|
||||
|
||||
@@ -23,5 +23,6 @@ class AllianceCorp extends Model
|
||||
*/
|
||||
protected $fillable = [
|
||||
'corporation_id',
|
||||
'name',
|
||||
];
|
||||
}
|
||||
|
||||
BIN
cache/latest/alliances/99004116/corporations/6b75e300c8f31570a767b0a29f519238ef1849dd/results.cache
vendored
Normal file
BIN
cache/latest/alliances/99004116/corporations/6b75e300c8f31570a767b0a29f519238ef1849dd/results.cache
vendored
Normal file
Binary file not shown.
BIN
cache/latest/corporations/98287666/6b75e300c8f31570a767b0a29f519238ef1849dd/results.cache
vendored
Normal file
BIN
cache/latest/corporations/98287666/6b75e300c8f31570a767b0a29f519238ef1849dd/results.cache
vendored
Normal file
Binary file not shown.
@@ -16,6 +16,7 @@ class CreateAllianceCorps extends Migration
|
||||
if(!Schema::hasTable('AllianceCorps')) {
|
||||
Schema::create('AllianceCorps', function(Blueprint $table) {
|
||||
$table->integer('corporation_id')->unique();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,20 +6,36 @@
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Public Data') }}
|
||||
{{ Form::checkbox('scopes[]', 'publicData') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Write Fleet') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-fleets.write_fleet.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Read Fleet') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-fleets.read_fleet.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Read Location') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-location.read_location.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Write Mail') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-mail.send_mail.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Read Mail') }}
|
||||
{{ Form::label('scopes[]', 'esi-mail.read_mail.v1')}}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Corporation Wallets') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-wallet.read_corporation_wallets.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Read Structures') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-corporations.read_structures.v1') }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
{{ Form::label('scopes[]', 'Structure Markets') }}
|
||||
{{ Form::checkbox('scopes[]', 'esi-markets.structure_markets.v1') }}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[2018-11-19 01:37:59] eseye.ERROR: [http 400, bad request] post -> https://login.eveonline.com/oauth/token/?grant_type=refresh_token [t/e: 0.68s/]
|
||||
[2018-11-19 01:38:16] eseye.ERROR: [http 400, bad request] post -> https://login.eveonline.com/oauth/token/?grant_type=refresh_token [t/e: 0.62s/]
|
||||
[2018-11-19 01:38:26] eseye.ERROR: [http 400, bad request] post -> https://login.eveonline.com/oauth/token/?grant_type=refresh_token [t/e: 0.63s/]
|
||||
[2018-11-19 01:38:50] eseye.ERROR: [http 400, bad request] post -> https://login.eveonline.com/oauth/token/?grant_type=refresh_token [t/e: 0.63s/]
|
||||
[2018-11-19 01:39:07] eseye.ERROR: [http 400, bad request] post -> https://login.eveonline.com/oauth/token/?grant_type=refresh_token [t/e: 0.50s/]
|
||||
[2018-11-19 01:39:32] eseye.INFO: [http 200, ok] get -> https://esi.evetech.net/latest/alliances/99004116/corporations/?datasource=tranquility [t/e: 0.67s/100]
|
||||
[2018-11-19 01:56:56] eseye.INFO: [http 200, ok] get -> https://esi.evetech.net/latest/alliances/99004116/corporations/?datasource=tranquility [t/e: 0.72s/100]
|
||||
[2018-11-19 01:57:58] eseye.INFO: [http 200, ok] get -> https://esi.evetech.net/latest/corporations/98287666/?datasource=tranquility [t/e: 0.67s/100]
|
||||
Reference in New Issue
Block a user