|
@@ 322-341 (lines=20) @@
|
| 319 |
|
* @param string $uuid |
| 320 |
|
* @return \Illuminate\Http\RedirectResponse |
| 321 |
|
*/ |
| 322 |
|
public function postSettingsSFTP(Request $request, $uuid) |
| 323 |
|
{ |
| 324 |
|
$server = Models\Server::byUuid($uuid); |
| 325 |
|
$this->authorize('reset-sftp', $server); |
| 326 |
|
|
| 327 |
|
try { |
| 328 |
|
$repo = new ServerRepository; |
| 329 |
|
$repo->updateSFTPPassword($server->id, $request->input('sftp_pass')); |
| 330 |
|
Alert::success('Successfully updated this servers SFTP password.')->flash(); |
| 331 |
|
} catch (DisplayValidationException $ex) { |
| 332 |
|
return redirect()->route('server.settings.sftp', $uuid)->withErrors(json_decode($ex->getMessage())); |
| 333 |
|
} catch (DisplayException $ex) { |
| 334 |
|
Alert::danger($ex->getMessage())->flash(); |
| 335 |
|
} catch (\Exception $ex) { |
| 336 |
|
Log::error($ex); |
| 337 |
|
Alert::danger('An unknown error occured while attempting to update this server\'s SFTP settings.')->flash(); |
| 338 |
|
} |
| 339 |
|
|
| 340 |
|
return redirect()->route('server.settings.sftp', $uuid); |
| 341 |
|
} |
| 342 |
|
|
| 343 |
|
/** |
| 344 |
|
* Handles changing the startup settings for a server. |
|
@@ 350-369 (lines=20) @@
|
| 347 |
|
* @param string $uuid |
| 348 |
|
* @return \Illuminate\Http\RedirectResponse |
| 349 |
|
*/ |
| 350 |
|
public function postSettingsStartup(Request $request, $uuid) |
| 351 |
|
{ |
| 352 |
|
$server = Models\Server::byUuid($uuid); |
| 353 |
|
$this->authorize('edit-startup', $server); |
| 354 |
|
|
| 355 |
|
try { |
| 356 |
|
$repo = new ServerRepository; |
| 357 |
|
$repo->updateStartup($server->id, $request->except('_token')); |
| 358 |
|
Alert::success('Server startup variables were successfully updated.')->flash(); |
| 359 |
|
} catch (DisplayValidationException $ex) { |
| 360 |
|
return redirect()->route('server.settings.startup', $uuid)->withErrors(json_decode($ex->getMessage())); |
| 361 |
|
} catch (DisplayException $ex) { |
| 362 |
|
Alert::danger($ex->getMessage())->flash(); |
| 363 |
|
} catch (\Exception $ex) { |
| 364 |
|
Log::error($ex); |
| 365 |
|
Alert::danger('An unhandled exception occured while attemping to update startup variables for this server. Please try again.')->flash(); |
| 366 |
|
} |
| 367 |
|
|
| 368 |
|
return redirect()->route('server.settings.startup', $uuid); |
| 369 |
|
} |
| 370 |
|
} |
| 371 |
|
|