remove user
This commit is contained in:
@@ -75,40 +75,17 @@ class AdminController extends Controller
|
|||||||
//Get the user data from the table
|
//Get the user data from the table
|
||||||
$data = User::where(['name' => $user])->get();
|
$data = User::where(['name' => $user])->get();
|
||||||
|
|
||||||
try {
|
//Delete the user's ESI Scopes
|
||||||
//Delete the user's ESI Scopes
|
DB::table('EsiScopes')->where(['character_id' => $data->character_id])->delete();
|
||||||
EsiScope::where(['character_id' => $data->character_id])->delete();
|
|
||||||
} catch(Exception $e) {
|
|
||||||
//Don't do anything. Just continue on.
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
//Delete the user's ESI Token
|
|
||||||
EsiToken::where(['character_id' => $data->character_id])->delete();
|
|
||||||
} catch(Exception $e) {
|
|
||||||
//Don't do anything. Just continue on.
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
//Delete the user's ESI Token
|
||||||
//Delete the user's roles from the roles table
|
DB::table('EsiTokens')->where(['character_id' => $data->character_id])->delete();
|
||||||
UserRole::where(['character_id' => $data->character_id])->delete();
|
|
||||||
} catch(Exception $e) {
|
|
||||||
//Don't do anything. Just continue on.
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
//Delete the user's role from the roles table
|
||||||
//Delete the user from the user table
|
DB::table('user_roles')->where(['character_id' => $data->character_id])->delete();
|
||||||
User::where(['character_id' => $data->character_id])->delete();
|
|
||||||
} catch(Exception $e) {
|
|
||||||
//Don't do anything. Just continue on.
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
//Delete the user from the user table
|
||||||
//Delete the user's structures
|
DB::table('users')->where(['character_id' => $data->character_id])->delete();
|
||||||
CorpStructure::where(['character_id' => $data->character_id])->delete();
|
|
||||||
} catch(Exception $e) {
|
|
||||||
//Don't do anything. Just continue on.
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect('/admin/dashboard')->with('success', 'User deleted from the site.');
|
return redirect('/admin/dashboard')->with('success', 'User deleted from the site.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
@extends('layouts.b4')
|
|
||||||
@section('content')
|
|
||||||
<div class="container">
|
|
||||||
<h2>Fleets</h2>
|
|
||||||
@if(isset($error))
|
|
||||||
<?php var_dump($error); ?>
|
|
||||||
@endif
|
|
||||||
@if(isset($data))
|
|
||||||
@for($i = 0; $i < count($data[0]); $i++)
|
|
||||||
<a href="{{ route('addpilot', [$data[1][$i], Auth::user()->character_id]) }}">Join {{ $data[2][$i] }}</a><br>
|
|
||||||
@if(Auth::user()->character_id == $data[0][$i])
|
|
||||||
<a href="{{ route('deletefleet', [$data[1][$i]]) }}">Delete Fleet</a><br><br>
|
|
||||||
@endif
|
|
||||||
<!-- Create form for inserting a user by name -->
|
|
||||||
@if(Auth::user()->character_id == $data[0][$i])
|
|
||||||
{!! Form::open(['action' => '/fleets/{fleet_id}/addpilot/{name}', 'method' => 'GET']) !!}
|
|
||||||
<div class="form-group col-md-4">
|
|
||||||
{{ Form::label('pilot', 'Pilot') }}
|
|
||||||
{{ Form::text('pilot', '', ['class' => 'form-control']) }}
|
|
||||||
</div>
|
|
||||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
|
||||||
{!! Form::close() !!}
|
|
||||||
@endif
|
|
||||||
@endfor
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
@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('fleetUri', 'Fleet') }}
|
|
||||||
{{ Form::text('fleetUri', '', ['class' => 'form-control', 'placeholder' => 'Fleet URL']) }}
|
|
||||||
{{ Form::label('description', 'Fleet Name') }}
|
|
||||||
{{ Form::text('description', '', ['class' => 'form control', 'placeholder' => 'Fleet Name']) }}
|
|
||||||
</div>
|
|
||||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
@section('content')
|
@section('content')
|
||||||
<?php
|
<?php
|
||||||
$publicData = false;
|
$publicData = false;
|
||||||
$writeFleet = false;
|
|
||||||
$readFleet = false;
|
|
||||||
$readLocation = false;
|
$readLocation = false;
|
||||||
$writeMail = false;
|
$writeMail = false;
|
||||||
$readMail = false;
|
$readMail = false;
|
||||||
@@ -25,27 +23,7 @@
|
|||||||
<?php $publicData = true; ?>
|
<?php $publicData = true; ?>
|
||||||
@break
|
@break
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@foreach($scopes as $scope)
|
|
||||||
@if($scope->scope == 'esi-fleets.write_fleet.v1')
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
{{ Form::label('scopes[]', 'Write Fleet') }}
|
|
||||||
{{ Form::checkbox('scopes[]', 'esi-fleets.write_fleet.v1', 'true') }}
|
|
||||||
</div>
|
|
||||||
<?php $writeFleet = true; ?>
|
|
||||||
@break
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
@foreach($scopes as $scope)
|
|
||||||
@if($scope->scope == 'esi-fleets.read_fleet.v1')
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
{{ Form::label('scopes[]', 'Read Fleet') }}
|
|
||||||
{{ Form::checkbox('scopes[]', 'esi-fleets.read_fleet.v1', 'true') }}
|
|
||||||
</div>
|
|
||||||
<?php $readFleet = true; ?>
|
|
||||||
@break
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
@foreach($scopes as $scope)
|
@foreach($scopes as $scope)
|
||||||
@if($scope->scope == 'esi-location.read_location.v1')
|
@if($scope->scope == 'esi-location.read_location.v1')
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
@@ -131,18 +109,6 @@
|
|||||||
{{ Form::checkbox('scopes[]', 'publicData') }}
|
{{ Form::checkbox('scopes[]', 'publicData') }}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@if($writeFleet == false)
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
{{ Form::label('scopes[]', 'Write Fleet') }}
|
|
||||||
{{ Form::checkbox('scopes[]', 'esi-fleets.write_fleet.v1') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@if($readFleet == false)
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
{{ Form::label('scopes[]', 'Read Fleet') }}
|
|
||||||
{{ Form::checkbox('scopes[]', 'esi-fleets.read_fleet.v1') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@if($readLocation == false)
|
@if($readLocation == false)
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
{{ Form::label('scopes[]', 'Read Location') }}
|
{{ Form::label('scopes[]', 'Read Location') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user