Add support for viewing SFTP password in panel

requested in #74
closes #74
This commit is contained in:
Dane Everitt 2016-09-02 19:26:48 -04:00
parent 8c40f647d3
commit 1ca07e665e
7 changed files with 97 additions and 22 deletions

View file

@ -51,29 +51,34 @@
</div>
</div>
</div>
@can('reset-sftp', $server)
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
<div class="row">
<div class="col-md-12">
<div id="gen_pass" class=" alert alert-success" style="display:none;margin-bottom: 10px;"></div>
</div>
<div class="form-group col-md-6">
<label class="control-label">New SFTP Password:</label>
<div>
<input type="password" name="sftp_pass" class="form-control" />
<p class="text-muted"><small>Passwords must meet the following requirements: at least one uppercase character, one lowercase character, one digit, and be at least 8 characters in length. <a href="#" data-action="generate-password">Click here</a> to generate one to use.</small></p>
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">&nbsp;</label>
<div>
{!! csrf_field() !!}
<input type="submit" class="btn btn-sm btn-primary" value="Update Password" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="gen_pass" class=" alert alert-success" style="display:none;margin-bottom: 10px;"></div>
</div>
</form>
@endcan
<div class="form-group col-md-6">
@can('reset-sftp', $server)
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
<label class="control-label">New SFTP Password:</label>
<div class="input-group">
<input type="password" class="form-control" name="sftp_pass" />
<span class="input-group-btn">
{!! csrf_field() !!}
<input type="submit" class="btn btn-primary btn-sm" value="Reset" />
</span>
</div>
<p class="text-muted"><small>Passwords must meet the following requirements: at least one uppercase character, one lowercase character, one digit, and be at least 8 characters in length. <a href="#" data-action="generate-password">Click here</a> to generate one to use.</small></p>
</form>
@endcan
</div>
<div class="form-group col-md-6">
@can('view-sftp-password', $server)
<label class="control-label">Current Password:</label>
<div>
<input type="text" readonly="readonly" class="form-control" value="@if(!is_null($server->sftp_password)){{ Crypt::decrypt($server->sftp_password) }} @endif" />
</div>
@endcan
</div>
</div>
</div>
</div>
</div>

View file

@ -200,6 +200,12 @@
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-sftp-password']))checked="checked"@endif value="view-sftp-password"> <strong>View SFTP Password</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view the SFTP password for the server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['reset-sftp']))checked="checked"@endif value="reset-sftp"> <strong>Reset SFTP Password</strong>

View file

@ -189,6 +189,12 @@
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-sftp-password']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-sftp-password"> <strong>View SFTP Password</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view the SFTP password for the server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['reset-sftp']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="reset-sftp"> <strong>Reset SFTP Password</strong>