Exemplo n.º 1
0
 public function postSettingsSFTP(Request $request, $uuid)
 {
     $server = Models\Server::getByUUID($uuid);
     $this->authorize('reset-sftp', $server);
     try {
         $repo = new ServerRepository();
         $repo->updateSFTPPassword($server->id, $request->input('sftp_pass'));
         Alert::success('Successfully updated this servers SFTP password.')->flash();
     } catch (DisplayValidationException $ex) {
         return redirect()->route('server.settings', $uuid)->withErrors(json_decode($ex->getMessage()));
     } catch (DisplayException $ex) {
         Alert::danger($ex->getMessage())->flash();
     } catch (\Exception $ex) {
         Log::error($ex);
         Alert::danger('An unknown error occured while attempting to update this server\'s SFTP settings.')->flash();
     }
     return redirect()->route('server.settings', $uuid);
 }