admin controller

This commit is contained in:
2019-02-03 00:29:03 -06:00
parent dbd0af5adb
commit fe20a14364

View File

@@ -75,21 +75,40 @@ 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
EsiScope::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 //Delete the user's ESI Token
EsiToken::where(['character_id' => $data->character_id])->delete(); EsiToken::where(['character_id' => $data->character_id])->delete();
} catch(Exception $e) {
//Don't do anything. Just continue on.
}
try {
//Delete the user's roles from the roles table //Delete the user's roles from the roles table
UserRole::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 from the user table //Delete the user from the user table
User::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's structures //Delete the user's structures
CorpStructure::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.');
} }