@@ 90-104 (lines=15) @@ | ||
87 | * @param int $id |
|
88 | * @return \Illuminate\Http\RedirectResponse |
|
89 | */ |
|
90 | public function delete(Request $request, $id) |
|
91 | { |
|
92 | try { |
|
93 | $repo = new UserRepository; |
|
94 | $repo->delete($id); |
|
95 | Alert::success('Successfully deleted user from system.')->flash(); |
|
96 | ||
97 | return redirect()->route('admin.users'); |
|
98 | } catch (DisplayException $ex) { |
|
99 | Alert::danger($ex->getMessage())->flash(); |
|
100 | } catch (\Exception $ex) { |
|
101 | Log::error($ex); |
|
102 | Alert::danger('An exception was encountered while attempting to delete this user.')->flash(); |
|
103 | } |
|
104 | ||
105 | return redirect()->route('admin.users.view', $id); |
|
106 | } |
|
107 |
@@ 328-343 (lines=16) @@ | ||
325 | * @param int $id |
|
326 | * @return \Illuminate\Http\RedirectResponse |
|
327 | */ |
|
328 | public function toggleInstall(Request $request, $id) |
|
329 | { |
|
330 | $repo = new ServerRepository; |
|
331 | try { |
|
332 | $repo->toggleInstall($id); |
|
333 | ||
334 | Alert::success('Server install status was successfully toggled.')->flash(); |
|
335 | } catch (DisplayException $ex) { |
|
336 | Alert::danger($ex->getMessage())->flash(); |
|
337 | } catch (\Exception $ex) { |
|
338 | Log::error($ex); |
|
339 | Alert::danger('An unhandled exception occured while attemping to toggle this servers status. This error has been logged.')->flash(); |
|
340 | } |
|
341 | ||
342 | return redirect()->route('admin.servers.view.manage', $id); |
|
343 | } |
|
344 | ||
345 | /** |
|
346 | * Reinstalls the server with the currently assigned pack and service. |
@@ 345-362 (lines=18) @@ | ||
342 | * @param int $id |
|
343 | * @return \Illuminate\Http\RedirectResponse |
|
344 | */ |
|
345 | public function delete(Request $request, $id) |
|
346 | { |
|
347 | $repo = new NodeRepository; |
|
348 | ||
349 | try { |
|
350 | $repo->delete($id); |
|
351 | Alert::success('Successfully deleted the requested node from the panel.')->flash(); |
|
352 | ||
353 | return redirect()->route('admin.nodes'); |
|
354 | } catch (DisplayException $ex) { |
|
355 | Alert::danger($ex->getMessage())->flash(); |
|
356 | } catch (\Exception $ex) { |
|
357 | Log::error($ex); |
|
358 | Alert::danger('An unhandled exception occured while attempting to delete this node. Please try again.')->flash(); |
|
359 | } |
|
360 | ||
361 | return redirect()->route('admin.nodes.view', $id); |
|
362 | } |
|
363 | ||
364 | /** |
|
365 | * Returns the configuration token to auto-deploy a node. |