diff --git a/app/Classes/Pterodactyl.php b/app/Classes/Pterodactyl.php index f75a3062..eeb0e3a6 100644 --- a/app/Classes/Pterodactyl.php +++ b/app/Classes/Pterodactyl.php @@ -87,6 +87,33 @@ class Pterodactyl if ($response->failed()) throw self::getException("Failed to get nodes from pterodactyl - ", $response->status()); return $response->json()['data']; } + + /** + * @return mixed + * @throws Exception + * @description Returns the infos of a single node + */ + public static function getNode($id) { + try { + $response = self::client()->get('/application/nodes/' . $id); + } catch(Exception $e) { + throw self::getException($e->getMessage()); + } + if($response->failed()) throw self::getException("Failed to get node id " . $id . " - " . $response->status()); + return $response->json()['attributes']; + } + + + + public static function getServers() { + try { + $response = self::client()->get('/application/servers'); + } catch (Exception $e) { + throw self::getException($e->getMessage()); + } + if($response->failed()) throw self::getException("Failed to get list of servers - ", $response->status()); + return $response->json()['data']; + } /** * @return null diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 07540765..6e1c61ab 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -160,6 +160,17 @@ class UserController extends Controller $user->delete(); return redirect()->back()->with('success', __('user has been removed!')); } + /** + * Verifys the users email + * + * @param User $user + * @return RedirectResponse + */ + public function verifyEmail(Request $request, User $user) + { + $user->verifyEmail(); + return redirect()->back()->with('success', __('Email has been verified!')); + } /** * @param Request $request @@ -285,6 +296,7 @@ class UserController extends Controller $suspendText = $user->isSuspended() ? __("Unsuspend") : __("Suspend"); return ' +