admin controller
This commit is contained in:
@@ -75,21 +75,40 @@ class AdminController extends Controller
|
||||
//Get the user data from the table
|
||||
$data = User::where(['name' => $user])->get();
|
||||
|
||||
//Delete the user's ESI Scopes
|
||||
EsiScope::where(['character_id' => $data->character_id])->delete();
|
||||
try {
|
||||
//Delete the user's ESI Scopes
|
||||
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.
|
||||
}
|
||||
|
||||
//Delete the user's ESI Token
|
||||
EsiToken::where(['character_id' => $data->character_id])->delete();
|
||||
try {
|
||||
//Delete the user's roles from the roles table
|
||||
UserRole::where(['character_id' => $data->character_id])->delete();
|
||||
} catch(Exception $e) {
|
||||
//Don't do anything. Just continue on.
|
||||
}
|
||||
|
||||
//Delete the user's roles from the roles table
|
||||
UserRole::where(['character_id' => $data->character_id])->delete();
|
||||
|
||||
//Delete the user from the user table
|
||||
User::where(['character_id' => $data->character_id])->delete();
|
||||
|
||||
//Delete the user's structures
|
||||
CorpStructure::where(['character_id' => $data->character_id])->delete();
|
||||
try {
|
||||
//Delete the user from the user table
|
||||
User::where(['character_id' => $data->character_id])->delete();
|
||||
} catch(Exception $e) {
|
||||
//Don't do anything. Just continue on.
|
||||
}
|
||||
|
||||
try {
|
||||
//Delete the user's structures
|
||||
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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user