2016-03-25 01:18:05 -07:00
|
|
|
@extends('layouts/default')
|
|
|
|
|
|
|
|
{{-- Page title --}}
|
|
|
|
@section('title')
|
|
|
|
@if ($user->id)
|
|
|
|
{{ trans('admin/users/table.updateuser') }}
|
2016-12-23 17:52:00 -08:00
|
|
|
{{ $user->present()->fullName() }}
|
2016-03-25 01:18:05 -07:00
|
|
|
@else
|
|
|
|
{{ trans('admin/users/table.createuser') }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@parent
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@section('header_right')
|
|
|
|
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
|
|
|
{{ trans('general.back') }}</a>
|
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Page content --}}
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
<style>
|
2016-10-12 12:06:28 -07:00
|
|
|
.form-horizontal .control-label {
|
|
|
|
padding-top: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
input[type='text'][disabled], input[disabled], textarea[disabled], input[readonly], textarea[readonly], .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
|
|
|
|
background-color: white;
|
|
|
|
color: #555555;
|
|
|
|
cursor:text;
|
|
|
|
}
|
|
|
|
table.permissions {
|
|
|
|
display:flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.permissions.table > thead, .permissions.table > tbody {
|
|
|
|
margin: 15px;
|
|
|
|
margin-top: 0px;
|
|
|
|
}
|
|
|
|
.permissions.table > tbody+tbody {
|
2017-11-08 02:11:33 -08:00
|
|
|
|
2016-10-12 12:06:28 -07:00
|
|
|
}
|
|
|
|
.header-row {
|
|
|
|
border-bottom: 1px solid #ccc;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header-row h3 {
|
|
|
|
margin:0px;
|
|
|
|
}
|
|
|
|
.permissions-row {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: flex-start;
|
|
|
|
}
|
|
|
|
.table > tbody > tr > td.permissions-item {
|
|
|
|
padding: 1px;
|
|
|
|
padding-left: 8px;
|
|
|
|
}
|
2016-12-15 20:52:39 -08:00
|
|
|
|
2016-10-12 12:06:28 -07:00
|
|
|
.header-name {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="row">
|
2016-12-27 12:03:47 -08:00
|
|
|
<div class="col-md-8 col-md-offset-2">
|
|
|
|
<form class="form-horizontal" method="post" autocomplete="off" action="{{ ($user) ? route('users.update', ['user' => $user->id]) : route('users.store') }}" id="userForm">
|
|
|
|
{{csrf_field()}}
|
|
|
|
|
|
|
|
@if($user->id)
|
|
|
|
{{ method_field('PUT') }}
|
|
|
|
@endif
|
|
|
|
<!-- Custom Tabs -->
|
|
|
|
<div class="nav-tabs-custom">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="active"><a href="#tab_1" data-toggle="tab">Information</a></li>
|
|
|
|
<li><a href="#tab_2" data-toggle="tab">Permissions</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane active" id="tab_1">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<!-- First Name -->
|
|
|
|
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="first_name">{{ trans('general.first_name') }}</label>
|
|
|
|
<div class="col-md-8 {{ (\App\Helpers\Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}">
|
|
|
|
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ Input::old('first_name', $user->first_name) }}" />
|
|
|
|
{!! $errors->first('first_name', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Last Name -->
|
|
|
|
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="last_name">{{ trans('general.last_name') }} </label>
|
|
|
|
<div class="col-md-8{{ (\App\Helpers\Helper::checkIfRequired($user, 'last_name')) ? ' required' : '' }}">
|
|
|
|
<input class="form-control" type="text" name="last_name" id="last_name" value="{{ Input::old('last_name', $user->last_name) }}" />
|
|
|
|
{!! $errors->first('last_name', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Username -->
|
|
|
|
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="username">{{ trans('admin/users/table.username') }}</label>
|
|
|
|
<div class="col-md-8{{ (\App\Helpers\Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}">
|
|
|
|
@if ($user->ldap_import!='1')
|
|
|
|
<input
|
|
|
|
class="form-control"
|
|
|
|
type="text"
|
|
|
|
name="username"
|
|
|
|
id="username"
|
|
|
|
value="{{ Input::old('username', $user->username) }}"
|
|
|
|
autocomplete="off"
|
|
|
|
readonly
|
|
|
|
onfocus="this.removeAttribute('readonly');"
|
|
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
|
|
|
>
|
|
|
|
@if (config('app.lock_passwords') && ($user->id))
|
|
|
|
<p class="help-block">{{ trans('admin/users/table.lock_passwords') }}</p>
|
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
(Managed via LDAP)
|
2017-08-31 13:45:48 -07:00
|
|
|
<input type="hidden" name="username" value="{{ Input::old('username', $user->username) }}">
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
{!! $errors->first('username', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Password -->
|
|
|
|
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="password">
|
|
|
|
{{ trans('admin/users/table.password') }}
|
|
|
|
</label>
|
|
|
|
<div class="col-md-5{{ (\App\Helpers\Helper::checkIfRequired($user, 'password')) ? ' required' : '' }}">
|
|
|
|
@if ($user->ldap_import!='1')
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
name="password"
|
|
|
|
class="form-control"
|
|
|
|
id="password"
|
|
|
|
value=""
|
|
|
|
autocomplete="off"
|
|
|
|
readonly
|
|
|
|
onfocus="this.removeAttribute('readonly');"
|
2017-10-28 09:21:39 -07:00
|
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}>
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
|
|
|
(Managed via LDAP)
|
|
|
|
@endif
|
|
|
|
<span id="generated-password"></span>
|
|
|
|
{!! $errors->first('password', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
@if ($user->ldap_import!='1')
|
|
|
|
<a href="#" class="left" id="genPassword">Generate</a>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($user->ldap_import!='1')
|
|
|
|
<!-- Password Confirm -->
|
|
|
|
<div class="form-group {{ $errors->has('password_confirm') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="password_confirm">
|
|
|
|
{{ trans('admin/users/table.password_confirm') }}
|
|
|
|
</label>
|
|
|
|
<div class="col-md-5 {{ ((\App\Helpers\Helper::checkIfRequired($user, 'first_name')) && (!$user->id)) ? ' required' : '' }}">
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
name="password_confirm"
|
|
|
|
id="password_confirm"
|
|
|
|
class="form-control"
|
|
|
|
value=""
|
|
|
|
autocomplete="off"
|
2017-10-28 11:17:52 -07:00
|
|
|
readonly
|
|
|
|
onfocus="this.removeAttribute('readonly');"
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
|
|
|
>
|
|
|
|
@if (config('app.lock_passwords') && ($user->id))
|
|
|
|
<p class="help-block">{{ trans('admin/users/table.lock_passwords') }}</p>
|
|
|
|
@endif
|
|
|
|
{!! $errors->first('password_confirm', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2016-10-29 05:50:55 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Email -->
|
|
|
|
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="email">{{ trans('admin/users/table.email') }} </label>
|
|
|
|
<div class="col-md-8{{ (\App\Helpers\Helper::checkIfRequired($user, 'email')) ? ' required' : '' }}">
|
|
|
|
<input
|
|
|
|
class="form-control"
|
|
|
|
type="text"
|
|
|
|
name="email"
|
|
|
|
id="email"
|
|
|
|
value="{{ Input::old('email', $user->email) }}"
|
|
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
|
|
|
autocomplete="off"
|
|
|
|
readonly
|
2017-10-28 09:21:39 -07:00
|
|
|
onfocus="this.removeAttribute('readonly');">
|
2016-12-27 12:03:47 -08:00
|
|
|
@if (config('app.lock_passwords') && ($user->id))
|
|
|
|
<p class="help-block">{{ trans('admin/users/table.lock_passwords') }}</p>
|
|
|
|
@endif
|
|
|
|
{!! $errors->first('email', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-31 16:52:25 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Company -->
|
|
|
|
@if (\App\Models\Company::canManageUsersCompanies())
|
2017-10-28 09:21:39 -07:00
|
|
|
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.select_company'), 'fieldname' => 'company_id'])
|
2016-10-31 16:52:25 -07:00
|
|
|
@endif
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- language -->
|
|
|
|
<div class="form-group {{ $errors->has('locale') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="locale">{{ trans('general.language') }}</label>
|
|
|
|
<div class="col-md-8">
|
|
|
|
{!! Form::locales('locale', Input::old('locale', $user->locale), 'select2') !!}
|
|
|
|
{!! $errors->first('locale', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-31 16:52:25 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Employee Number -->
|
|
|
|
<div class="form-group {{ $errors->has('employee_num') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="employee_num">{{ trans('admin/users/table.employee_num') }}</label>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<input
|
|
|
|
class="form-control"
|
|
|
|
type="text"
|
|
|
|
name="employee_num"
|
|
|
|
id="employee_num"
|
|
|
|
value="{{ Input::old('employee_num', $user->employee_num) }}"
|
|
|
|
/>
|
|
|
|
{!! $errors->first('employee_num', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-31 16:52:25 -07:00
|
|
|
|
2016-10-29 05:50:55 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Jobtitle -->
|
|
|
|
<div class="form-group {{ $errors->has('jobtitle') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="jobtitle">{{ trans('admin/users/table.title') }}</label>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<input
|
|
|
|
class="form-control"
|
|
|
|
type="text"
|
|
|
|
name="jobtitle"
|
|
|
|
id="jobtitle"
|
|
|
|
value="{{ Input::old('jobtitle', $user->jobtitle) }}"
|
|
|
|
/>
|
|
|
|
{!! $errors->first('jobtitle', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-29 05:50:55 -07:00
|
|
|
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Manager -->
|
2017-10-28 11:17:52 -07:00
|
|
|
@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-05-23 02:51:09 -07:00
|
|
|
<!-- Department -->
|
2017-10-28 11:17:52 -07:00
|
|
|
@include ('partials.forms.edit.department-select', ['translated_name' => trans('general.department'), 'fieldname' => 'department_id'])
|
2017-05-23 02:51:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
<!-- Location -->
|
2017-10-28 11:17:52 -07:00
|
|
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
2016-10-12 12:06:28 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<!-- Phone -->
|
|
|
|
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="phone">{{ trans('admin/users/table.phone') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" type="text" name="phone" id="phone" value="{{ Input::old('phone', $user->phone) }}" />
|
|
|
|
{!! $errors->first('phone', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-31 18:57:35 -07:00
|
|
|
|
2017-10-30 18:57:00 -07:00
|
|
|
<!-- Address -->
|
|
|
|
<div class="form-group{{ $errors->has('address') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="address">{{ trans('general.address') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" type="text" name="address" id="address" value="{{ Input::old('address', $user->address) }}" />
|
|
|
|
{!! $errors->first('address', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- City -->
|
|
|
|
<div class="form-group{{ $errors->has('city') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="city">{{ trans('general.city') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" type="text" name="city" id="city" value="{{ Input::old('city', $user->city) }}" />
|
|
|
|
{!! $errors->first('city', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- State -->
|
|
|
|
<div class="form-group{{ $errors->has('state') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="state">{{ trans('general.state') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" type="text" name="state" id="state" value="{{ Input::old('state', $user->state) }}" maxlength="3" />
|
|
|
|
{!! $errors->first('state', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Country -->
|
|
|
|
<div class="form-group{{ $errors->has('country') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="city">{{ trans('general.country') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
{!! Form::countries('country', Input::old('country', $user->country), 'select2') !!}
|
|
|
|
{!! $errors->first('country', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Zip -->
|
|
|
|
<div class="form-group{{ $errors->has('zip') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="zip">{{ trans('general.zip') }}</label>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input class="form-control" type="text" name="zip" id="zip" value="{{ Input::old('zip', $user->zip) }}" maxlength="10" />
|
|
|
|
{!! $errors->first('zip', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-16 23:48:46 -07:00
|
|
|
<!-- Activation Status -->
|
|
|
|
<div class="form-group {{ $errors->has('activated') ? 'has-error' : '' }}">
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3 control-label">
|
|
|
|
{{ Form::label('activated', trans('admin/users/table.activated')) }}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-9">
|
|
|
|
@if (config('app.lock_passwords'))
|
|
|
|
<div class="icheckbox disabled" style="padding-left: 10px;">
|
|
|
|
{{ Form::checkbox('activated', '1', old('activated', $user->activated),['class' => 'minimal', 'disabled'=>'disabled']) }}
|
|
|
|
{{ trans('admin/users/general.activated_help_text') }}
|
|
|
|
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
|
|
|
</div>
|
|
|
|
@elseif ($user->id === Auth::user()->id)
|
2018-08-01 14:18:37 -07:00
|
|
|
<div class="icheckbox disabled" style="padding-left: 10px;">
|
2018-07-16 23:48:46 -07:00
|
|
|
{{ Form::checkbox('activated', '1', old('activated', $user->activated),['class' => 'minimal', 'disabled'=>'disabled']) }}
|
|
|
|
{{ trans('admin/users/general.activated_help_text') }}
|
|
|
|
<p class="help-block">{{ trans('admin/users/general.activated_disabled_help_text') }}</p>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div style="padding-left: 10px;">
|
2018-08-01 14:18:37 -07:00
|
|
|
{{ Form::checkbox('activated', '1', old('activated', $user->activated),['class' => 'minimal', 'id' => 'user_activated' ]) }}
|
2018-07-16 23:48:46 -07:00
|
|
|
{{ trans('admin/users/general.activated_help_text') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
{!! $errors->first('activated', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
|
|
|
|
</div>
|
2016-12-27 12:03:47 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2018-08-01 14:18:37 -07:00
|
|
|
<!-- Email user -->
|
|
|
|
@if (!$user->id)
|
|
|
|
<div class="form-group" id="email_user_row" style="display: none;">
|
|
|
|
<div class="col-sm-3">
|
|
|
|
</div>
|
|
|
|
<div class="col-md-9">
|
|
|
|
<div class="icheckbox disabled" id="email_user_div">
|
|
|
|
{{ Form::checkbox('email_user', '1', Input::old('email_user'),['class' => 'minimal', 'disabled'=>true, 'id' => 'email_user_checkbox']) }}
|
|
|
|
Email this user their credentials?
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<p class="help-block">
|
|
|
|
{{ trans('admin/users/general.send_email_help') }}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div> <!--/form-group-->
|
|
|
|
@endif
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($snipeSettings->two_factor_enabled!='')
|
|
|
|
@if ($snipeSettings->two_factor_enabled=='1')
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3 control-label">
|
|
|
|
{{ Form::label('two_factor_optin', trans('admin/settings/general.two_factor')) }}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-9">
|
2018-07-16 23:48:46 -07:00
|
|
|
@if (config('app.lock_passwords'))
|
|
|
|
<div class="icheckbox disabled">
|
|
|
|
{{ Form::checkbox('two_factor_optin', '1', Input::old('two_factor_optin', $user->two_factor_optin),['class' => 'minimal', 'disabled'=>'disabled']) }} {{ trans('admin/settings/general.two_factor_enabled_text') }}
|
|
|
|
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
{{ Form::checkbox('two_factor_optin', '1', Input::old('two_factor_optin', $user->two_factor_optin),['class' => 'minimal']) }} {{ trans('admin/settings/general.two_factor_enabled_text') }}
|
|
|
|
<p class="help-block">{{ trans('admin/users/general.two_factor_admin_optin_help') }}</p>
|
|
|
|
|
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<!-- Reset Two Factor -->
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-8 col-md-offset-3 two_factor_resetrow">
|
|
|
|
<a class="btn btn-default btn-sm pull-left" id="two_factor_reset" style="margin-right: 10px;"> {{ trans('admin/settings/general.two_factor_reset') }}</a>
|
|
|
|
<span id="two_factor_reseticon">
|
|
|
|
</span>
|
|
|
|
<span id="two_factor_resetresult">
|
|
|
|
</span>
|
|
|
|
<span id="two_factor_resetstatus">
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-8 col-md-offset-3 two_factor_resetrow">
|
|
|
|
<p class="help-block">{{ trans('admin/settings/general.two_factor_reset_help') }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<!-- Notes -->
|
|
|
|
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
|
|
|
|
<label for="notes" class="col-md-3 control-label">{{ trans('admin/users/table.notes') }}</label>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<textarea class="form-control" id="notes" name="notes">{{ Input::old('notes', $user->notes) }}</textarea>
|
|
|
|
{!! $errors->first('notes', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-06-09 12:19:12 -07:00
|
|
|
<!-- Groups -->
|
|
|
|
<div class="form-group{{ $errors->has('groups') ? ' has-error' : '' }}">
|
|
|
|
<label class="col-md-3 control-label" for="groups"> {{ trans('general.groups') }}</label>
|
|
|
|
<div class="col-md-5">
|
|
|
|
|
|
|
|
@if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
|
|
|
|
|
|
|
|
@if (count($userGroups->keys()) > 0)
|
|
|
|
<ul>
|
|
|
|
@foreach ($groups as $id => $group)
|
|
|
|
{!! ($userGroups->keys()->contains($id) ? '<li>'.e($group).'</li>' : '') !!}
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<span class="help-block">Only superadmins may edit group memberships.</p>
|
|
|
|
@else
|
|
|
|
<div class="controls">
|
|
|
|
<select
|
|
|
|
name="groups[]"
|
|
|
|
id="groups[]"
|
|
|
|
multiple="multiple"
|
|
|
|
class="form-control">
|
|
|
|
|
|
|
|
@foreach ($groups as $id => $group)
|
|
|
|
<option value="{{ $id }}"
|
|
|
|
{{ ($userGroups->keys()->contains($id) ? ' selected="selected"' : '') }}>
|
|
|
|
{{ $group }}
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<span class="help-block">
|
|
|
|
{{ trans('admin/users/table.groupnotes') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
|
|
|
|
</div> <!--/col-md-12-->
|
2016-04-28 21:59:43 -07:00
|
|
|
</div>
|
2016-12-27 12:03:47 -08:00
|
|
|
</div><!-- /.tab-pane -->
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<div class="tab-pane" id="tab_2">
|
|
|
|
<div class="col-md-12">
|
|
|
|
@if (!Auth::user()->isSuperUser())
|
|
|
|
<p class="alert alert-warning">Only superadmins may grant a user superadmin access.</p>
|
|
|
|
@endif
|
2016-10-12 12:06:28 -07:00
|
|
|
</div>
|
2016-12-27 12:03:47 -08:00
|
|
|
|
|
|
|
<table class="table table-striped permissions">
|
|
|
|
<thead>
|
|
|
|
<tr class="permissions-row">
|
2017-12-05 18:10:35 -08:00
|
|
|
<th class="col-md-5">Permission</th>
|
|
|
|
<th class="col-md-1">Grant</th>
|
|
|
|
<th class="col-md-1">Deny</th>
|
|
|
|
<th class="col-md-1">Inherit</th>
|
2016-12-27 12:03:47 -08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
2017-12-05 18:10:35 -08:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@foreach ($permissions as $area => $permissionsArray)
|
|
|
|
@if (count($permissionsArray) == 1)
|
|
|
|
<?php $localPermission = $permissionsArray[0]; ?>
|
2016-10-12 12:06:28 -07:00
|
|
|
<tr class="header-row permissions-row">
|
2016-10-31 16:52:25 -07:00
|
|
|
<td class="col-md-5 tooltip-base permissions-item"
|
2016-10-12 12:06:28 -07:00
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="right"
|
2017-11-08 01:52:35 -08:00
|
|
|
title="{{ $localPermission['note'] }}">
|
2016-10-12 12:06:28 -07:00
|
|
|
<h4>{{ $area . ': ' . $localPermission['label'] }}</h4>
|
|
|
|
</td>
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<td class="col-md-1 permissions-item">
|
|
|
|
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['disabled'=>"disabled", 'class'=>'minimal']) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['value'=>"grant", 'class'=>'minimal']) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
2016-12-27 12:03:47 -08:00
|
|
|
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['disabled'=>"disabled", 'class'=>'minimal']) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['value'=>"deny", 'class'=>'minimal']) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
2016-12-27 12:03:47 -08:00
|
|
|
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['disabled'=>"disabled",'class'=>'minimal'] ) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-11-08 01:52:35 -08:00
|
|
|
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['value'=>"inherit", 'class'=>'minimal'] ) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-12-05 18:10:35 -08:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-12-05 18:10:35 -08:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr class="header-row permissions-row">
|
|
|
|
<td class="col-md-5 header-name">
|
|
|
|
<h3>{{ $area }}</h3>
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio("$area", '1',false,['value'=>"grant", 'class'=>'minimal', 'data-checker-group' => str_slug($area)]) }}
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio("$area", '-1',false,['value'=>"deny", 'class'=>'minimal', 'data-checker-group' => str_slug($area)]) }}
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio("$area", '0',false,['value'=>"inherit", 'class'=>'minimal', 'data-checker-group' => str_slug($area)] ) }}
|
2016-10-12 12:06:28 -07:00
|
|
|
</td>
|
2016-12-27 12:03:47 -08:00
|
|
|
</tr>
|
2016-08-01 20:11:54 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@foreach ($permissionsArray as $index => $permission)
|
|
|
|
<tr class="permissions-row">
|
|
|
|
@if ($permission['display'])
|
|
|
|
<td
|
|
|
|
class="col-md-5 tooltip-base permissions-item"
|
|
|
|
data-toggle="tooltip"
|
|
|
|
data-placement="right"
|
2017-11-08 01:52:35 -08:00
|
|
|
title="{{ $permission['note'] }}">
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ $permission['label'] }}
|
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
|
|
|
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[$permission['permission'] ] == '1', ["value"=>"grant", 'disabled'=>'disabled', 'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[ $permission['permission'] ] == '1', ["value"=>"grant",'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
|
|
|
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny", 'disabled'=>'disabled', 'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny",'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td class="col-md-1 permissions-item">
|
|
|
|
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'disabled'=>'disabled', 'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2017-12-05 18:10:35 -08:00
|
|
|
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'class'=>'minimal radiochecker-'.str_slug($area)]) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
2017-12-05 18:10:35 -08:00
|
|
|
|
2016-10-12 12:06:28 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
@endforeach
|
2017-12-05 18:10:35 -08:00
|
|
|
</tbody>
|
2016-12-27 12:03:47 -08:00
|
|
|
</table>
|
|
|
|
</div><!-- /.tab-pane -->
|
|
|
|
</div><!-- /.tab-content -->
|
|
|
|
<div class="box-footer text-right">
|
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-check icon-white"></i> {{ trans('general.save') }}</button>
|
|
|
|
</div>
|
|
|
|
</div><!-- nav-tabs-custom -->
|
|
|
|
</form>
|
|
|
|
</div> <!--/col-md-8-->
|
|
|
|
</div><!--/row-->
|
2016-10-12 12:06:28 -07:00
|
|
|
@stop
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@section('moar_scripts')
|
2017-12-05 18:10:35 -08:00
|
|
|
<script src="{{ asset('js/pGenerator.jquery.js') }}"></script>
|
|
|
|
|
2017-09-28 19:45:15 -07:00
|
|
|
<script nonce="{{ csrf_token() }}">
|
2016-03-25 01:18:05 -07:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
2018-08-01 14:18:37 -07:00
|
|
|
$('#user_activated').on('ifChecked', function(event){
|
|
|
|
$("#email_user_row").show();
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2018-08-01 14:18:37 -07:00
|
|
|
$('#email').on('keyup',function(){
|
|
|
|
event.preventDefault();
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2018-08-01 14:18:37 -07:00
|
|
|
if(this.value.length > 5){
|
|
|
|
$('#email_user_checkbox').iCheck('enable');
|
|
|
|
} else {
|
|
|
|
$('#email_user_checkbox').iCheck('disable').iCheck('uncheck');
|
|
|
|
}
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
2016-08-01 20:11:54 -07:00
|
|
|
|
2018-08-01 14:18:37 -07:00
|
|
|
$('#user_activated').on('ifUnchecked', function(event){
|
|
|
|
$("#email_user_row").hide();
|
|
|
|
});
|
|
|
|
|
2017-12-05 18:10:35 -08:00
|
|
|
// Check/Uncheck all radio buttons in the group
|
|
|
|
$('tr.header-row input:radio').on('ifClicked', function () {
|
|
|
|
value = $(this).attr('value');
|
|
|
|
area = $(this).data('checker-group');
|
|
|
|
$('.radiochecker-'+area+'[value='+value+']').iCheck('check');
|
|
|
|
});
|
2016-08-01 20:11:54 -07:00
|
|
|
|
2017-12-05 18:10:35 -08:00
|
|
|
$('.header-name').click(function() {
|
|
|
|
$(this).parent().nextUntil('tr.header-row').slideToggle(500);
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-10-12 12:06:28 -07:00
|
|
|
$('.tooltip-base').tooltip({container: 'body'})
|
2016-08-01 20:11:54 -07:00
|
|
|
$(".superuser").change(function() {
|
|
|
|
var perms = $(this).val();
|
|
|
|
if (perms =='1') {
|
|
|
|
$("#nonadmin").hide();
|
|
|
|
} else {
|
|
|
|
$("#nonadmin").show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
$('#genPassword').pGenerator({
|
|
|
|
'bind': 'click',
|
|
|
|
'passwordElement': '#password',
|
|
|
|
'displayElement': '#generated-password',
|
|
|
|
'passwordLength': 16,
|
|
|
|
'uppercase': true,
|
|
|
|
'lowercase': true,
|
|
|
|
'numbers': true,
|
|
|
|
'specialChars': true,
|
|
|
|
'onPasswordGenerated': function(generatedPassword) {
|
2017-12-05 18:10:35 -08:00
|
|
|
$('#password_confirm').val($('#password').val());
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
});
|
2016-10-29 05:50:55 -07:00
|
|
|
|
|
|
|
$("#two_factor_reset").click(function(){
|
|
|
|
$("#two_factor_resetrow").removeClass('success');
|
|
|
|
$("#two_factor_resetrow").removeClass('danger');
|
|
|
|
$("#two_factor_resetstatus").html('');
|
|
|
|
$("#two_factor_reseticon").html('<i class="fa fa-spinner spin"></i>');
|
|
|
|
$.ajax({
|
|
|
|
url: '{{ route('api.users.two_factor_reset', ['id'=> $user->id]) }}',
|
|
|
|
type: 'POST',
|
|
|
|
data: {},
|
2018-02-26 15:43:49 -08:00
|
|
|
headers: {
|
|
|
|
"X-Requested-With": 'XMLHttpRequest',
|
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
|
|
|
},
|
2016-10-29 05:50:55 -07:00
|
|
|
dataType: 'json',
|
|
|
|
|
|
|
|
success: function (data) {
|
|
|
|
$("#two_factor_reseticon").html('');
|
|
|
|
$("#two_factor_resetstatus").html('<i class="fa fa-check text-success"></i>' + data.message);
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function (data) {
|
|
|
|
$("#two_factor_reseticon").html('');
|
|
|
|
$("#two_factor_reseticon").html('<i class="fa fa-exclamation-triangle text-danger"></i>');
|
|
|
|
$('#two_factor_resetstatus').text(data.message);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-12-05 18:10:35 -08:00
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
</script>
|
2017-12-05 18:10:35 -08:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@stop
|