Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Aug 2, 2016
2 parents 1fa2fe3 + eac6abe commit 2f679cc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
35 changes: 30 additions & 5 deletions resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
<div class="col-md-5">
<div class="controls">

<select name="groups[]" id="groups[]" multiple="multiple" class="form-control" {{ ((Config::get('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}>
<select name="groups[]" id="groups[]" multiple="multiple" class="form-control" {{ ((Config::get('app.lock_passwords') || ($user->id==Auth::user()->id) || (!Auth::user()->isSuperUser())) ? ' disabled' : '') }}>

@foreach ($groups as $id => $group)
<option value="{{ $id }}"
Expand Down Expand Up @@ -290,6 +290,13 @@
</div><!-- /.tab-pane -->
<div class="tab-pane" id="tab_2">
<div class="col-md-10 col-md-offset-2">


@if (!Auth::user()->isSuperUser())
<p class="alert alert-warning">Only superadmins may grant a user superadmin access.</p>
@endif



@foreach ($permissions as $area => $permission)

Expand All @@ -306,16 +313,34 @@
<div class="form-group" style="padding-left: 15px;">

<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['class' => 'minimal']) }}

@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['class' => 'minimal', 'disabled'=>'disabled']) }}
@else
{{ Form::radio('permission['.$permission_name.']', '1', $userPermissions[$permission_name] == '1', ['class' => 'minimal']) }}
@endif

Grant</label>

<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['class' => 'minimal']) }}

@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['class' => 'minimal', 'disabled'=>'disabled']) }}

@else
{{ Form::radio('permission['.$permission_name.']', '-1', $userPermissions[$permission_name] == '-1', ['class' => 'minimal']) }}

@endif
Deny</label>

<label class="radio-padding">
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['class' => 'minimal']) }}
Inherit</label>
@if (($permission_name == 'superuser') && (!Auth::user()->isSuperUser()))
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['class' => 'minimal', 'disabled'=>'disabled']) }}
@else
{{ Form::radio('permission['.$permission_name.']', '0', $userPermissions[$permission_name] =='0', ['class' => 'minimal']) }}
@endif

Inherit</label>
</div>
<hr>
@endif
Expand Down
2 changes: 1 addition & 1 deletion snipeit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ elif [ -f /etc/os-release ]; then
#Order is important here. If /etc/os-release and /etc/centos-release exist, we're on centos 7.
#If only /etc/centos-release exist, we're on centos6(or earlier). Centos-release is less parsable,
#so lets assume that it's version 6 (Plus, who would be doing a new install of anything on centos5 at this point..)
elif [ -f /etc/centos-release]; then
elif [ -f /etc/centos-release ]; then
distro="Centos"
version="6"
else
Expand Down

0 comments on commit 2f679cc

Please sign in to comment.