d6769443a9
commit399c7590cdMerge:d0c5ba70feb67d1b06Author: snipe <snipe@snipe.net> Date: Thu Dec 15 14:19:41 2022 -0800 Merge pull request #12209 from snipe/fixes/error_downloading_unaccepted_assets Fixed 500 when downloading the Unaccepted Assets report [sc-19555] commitd0c5ba70f6Merge:29c2ff56ed9a21cce0Author: snipe <snipe@snipe.net> Date: Thu Dec 15 12:42:29 2022 -0800 Merge pull request #12242 from inietov/features/add_purchase_cost_column Added `purchase_cost` to user's default view [sc-19680] commitd9a21cce00Author: Ivan Nieto Vivanco <inietov@gmail.com> Date: Thu Dec 15 14:12:05 2022 -0600 Add other items' purchase_cost columns to the same permission commit29c2ff56ecMerge:3e7975b2c1fe0bfe17Author: snipe <snipe@snipe.net> Date: Thu Dec 15 11:26:49 2022 -0800 Merge pull request #12188 from snipe/fixes/decrease_logging_for_saml_when_not_enabled Removed extra logging case that was very noisy commit3e7975b2c3Merge:227fef76ed870bc3b0Author: snipe <snipe@snipe.net> Date: Thu Dec 15 11:25:53 2022 -0800 Merge pull request #12250 from akemidx/grey_out_pw_reset_button Fixed: Grey out pw reset button for consistency commitd870bc3b02Author: akemidx <kojotek.dx@gmail.com> Date: Thu Dec 15 14:19:51 2022 -0500 nested if loop commit227fef76eeMerge:418ddcfac9d44720ffAuthor: snipe <snipe@snipe.net> Date: Thu Dec 15 11:06:53 2022 -0800 Merge pull request #11736 from Godmartinz/gh6508_ldap_default_group Adds a permission group selection for directory sync commit9d44720ffdAuthor: Godfrey M <godmartinz@gmail.com> Date: Thu Dec 15 11:02:34 2022 -0800 reverted changes to composer.lock commit9f3f0a25edAuthor: Godfrey M <godmartinz@gmail.com> Date: Thu Dec 15 10:53:45 2022 -0800 reverted changes to composer.lock commit2e228ccb0bAuthor: Godfrey M <godmartinz@gmail.com> Date: Thu Dec 15 10:45:42 2022 -0800 redid a few things. should be good now :) commit3ee413f379Author: Godfrey M <godmartinz@gmail.com> Date: Thu Dec 15 09:20:30 2022 -0800 removes livewire stuff commitb142f8e012Author: Ivan Nieto Vivanco <inietov@gmail.com> Date: Wed Dec 14 23:00:35 2022 -0600 Add the permission to show purchase cost column to non-admin sessions commit418ddcfac3Merge:c342668f01a908e361Author: snipe <snipe@snipe.net> Date: Wed Dec 14 17:46:53 2022 -0800 Merge pull request #9876 from Toreg87/fixes/locations-deletable Fixed #9875: Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport commitc342668f0fAuthor: snipe <snipe@snipe.net> Date: Wed Dec 14 17:25:39 2022 -0800 Update @scoo73r as a contributor commit2f6a26ec7dAuthor: snipe <snipe@snipe.net> Date: Wed Dec 14 17:25:25 2022 -0800 Add @scoo73r as a contributor commitf635278010Merge:d13a237008043b8678Author: snipe <snipe@snipe.net> Date: Wed Dec 14 16:42:41 2022 -0800 Merge pull request #12251 from snipe/security/upgrade_font_awesome Upgraded font awesome to 6.2.1 commit8043b86786Author: snipe <snipe@snipe.net> Date: Wed Dec 14 16:41:56 2022 -0800 Upgraded font awesome to 6.2.1 Signed-off-by: snipe <snipe@snipe.net> commitd13a237000Merge:fabefa61bd0d0058e7Author: snipe <snipe@snipe.net> Date: Wed Dec 14 12:13:18 2022 -0800 Merge pull request #12205 from Godmartinz/sc19675_add_remote_to_importer Adds remote field to the user importer commitb114ffd2c3Author: akemidx <kojotek.dx@gmail.com> Date: Wed Dec 14 14:48:59 2022 -0500 Grey out button pw reset button for consistency When user has no email in their profile, the box is greyed out for consistency accross all buttons on the user profile commitfabefa61b0Merge:389ec3a3cf3e57d7dcAuthor: snipe <snipe@snipe.net> Date: Tue Dec 13 14:00:48 2022 -0800 Merge pull request #12243 from akemidx/new_grey_out_when_no_assets Created method in users.php for adding up all assigned to user and pr… commitf3e57d7dc0Author: akemidx <kojotek.dx@gmail.com> Date: Tue Dec 13 16:00:59 2022 -0500 fixing PR commit389ec3a3cbMerge:c432fb9d76a72c344bAuthor: snipe <snipe@snipe.net> Date: Tue Dec 13 12:57:50 2022 -0800 Merge pull request #12247 from Godmartinz/gh12225_serial_added_to_components adds serial to components tab of assets commit6a72c344b7Author: Godfrey M <godmartinz@gmail.com> Date: Tue Dec 13 12:32:30 2022 -0800 removed the cuddlers commit4442b446b9Author: Godfrey M <godmartinz@gmail.com> Date: Tue Dec 13 10:30:37 2022 -0800 adds serial to components tab of assets commitc432fb9d70Merge:9e8fff6e5fa872b09aAuthor: snipe <snipe@snipe.net> Date: Tue Dec 13 10:28:17 2022 -0800 Merge pull request #12181 from Godmartinz/gh12163_asset_age Adds asset age to asset index and asset view pages commit07ae91b00fAuthor: akemi <akemi@ShibaPro.local> Date: Wed Dec 7 17:46:18 2022 -0500 Created method in users.php for adding up all assigned to user and providing an integer value. this then used to grey out buttons on user view if user has nothing assigned. commit450ad3dcecAuthor: Ivan Nieto Vivanco <inietov@gmail.com> Date: Mon Dec 12 14:17:08 2022 -0600 Added the column purchase_cost to user's default view commitfa872b09a9Author: Godfrey M <godmartinz@gmail.com> Date: Mon Dec 12 10:38:31 2022 -0800 fixes a typo, the world is great again commiteb67d1b064Author: Ivan Nieto Vivanco <inietov@gmail.com> Date: Tue Dec 6 18:00:16 2022 -0600 Filter items from the report if null returned commitd0d0058e79Author: Godfrey M <godmartinz@gmail.com> Date: Tue Dec 6 11:19:28 2022 -0800 removed unwanted changes commitbbd04f8876Author: Godfrey M <godmartinz@gmail.com> Date: Tue Dec 6 11:13:24 2022 -0800 adds the rest of the fields for Remote commit36901d271bAuthor: Godfrey M <godmartinz@gmail.com> Date: Mon Dec 5 16:28:19 2022 -0800 adds csvmatch for remote. Im a bit lost though lol commit3206929ee4Author: Godfrey M <godmartinz@gmail.com> Date: Tue Nov 29 09:51:42 2022 -0800 adds AgeFormatter, not working yet commit1fe0bfe17eAuthor: snipe <snipe@snipe.net> Date: Mon Nov 28 19:27:42 2022 -0800 Removed extra logging case that was very noisy Signed-off-by: snipe <snipe@snipe.net> commit8d861cfd82Author: Godfrey M <godmartinz@gmail.com> Date: Mon Nov 28 10:59:18 2022 -0800 adds age to the asset table commit078e7281cdAuthor: Godfrey M <godmartinz@gmail.com> Date: Mon Nov 28 10:45:58 2022 -0800 adds asset age to asset view commitf2d4a61e3cAuthor: Godfrey M <godmartinz@gmail.com> Date: Tue Oct 18 15:31:37 2022 -0700 removes dead space commit3f25a1bf61Author: Godfrey M <godmartinz@gmail.com> Date: Tue Oct 18 15:25:38 2022 -0700 removes dead code commitf9ac447dd1Merge:9b448227fb7bcfacccAuthor: Godfrey M <godmartinz@gmail.com> Date: Tue Oct 18 15:18:09 2022 -0700 adds default group to LDAP commit9b448227f7Author: Godfrey M <godmartinz@gmail.com> Date: Tue Sep 13 11:40:10 2022 -0700 tinkering to no avail commit28bc97f29fAuthor: Godfrey M <godmartinz@gmail.com> Date: Mon Sep 12 11:40:16 2022 -0700 one line away from this being over with commit193b31e427Author: Godfrey M <godmartinz@gmail.com> Date: Wed Aug 31 12:58:33 2022 -0700 select options working, testing sync then done commit70ac8af9c4Author: Godfrey M <godmartinz@gmail.com> Date: Wed Aug 31 09:53:20 2022 -0700 . commit0c362e8b57Author: Godfrey M <godmartinz@gmail.com> Date: Mon Aug 29 12:09:56 2022 -0700 gets the groups selector to appear but options are blank commitfc6fefdb4eAuthor: Godfrey M <godmartinz@gmail.com> Date: Thu Aug 25 15:19:38 2022 -0700 adds migration, variables, checkbox,working on groups commit1a908e361eAuthor: Tobias Regnery <tobias.regnery@gmail.com> Date: Thu Jul 29 10:33:34 2021 +0200 Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport locations->isDeletable() checks via gate::allows if a locations is deletable. This calls SnipePermissionsPolicy->before() and checks for !Company::isCurrentUserHasAccess($item). This returns false because locations don't have a company_id. Check for this and return true if the item don't have a company_id. Signed-off-by: snipe <snipe@snipe.net>
693 lines
35 KiB
PHP
Executable File
693 lines
35 KiB
PHP
Executable File
@extends('layouts/default')
|
|
{{-- Page title --}}
|
|
@section('title')
|
|
@if ($user->id)
|
|
{{ trans('admin/users/table.updateuser') }}
|
|
{{ $user->present()->fullName() }}
|
|
@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>
|
|
.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 {
|
|
border: 1px solid;
|
|
}
|
|
|
|
.header-row {
|
|
border-bottom: 1px solid #ccc;
|
|
}
|
|
|
|
.permissions-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.table > tbody > tr > td.permissions-item {
|
|
padding: 1px;
|
|
padding-left: 8px;
|
|
}
|
|
|
|
.header-name {
|
|
cursor: pointer;
|
|
}
|
|
|
|
</style>
|
|
|
|
<div class="row">
|
|
<div class="col-md-8 col-md-offset-2">
|
|
<form class="form-horizontal" method="post" autocomplete="off" action="{{ (isset($user->id)) ? route('users.update', ['user' => $user->id]) : route('users.store') }}" enctype="multipart/form-data" 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">{{ trans('general.information') }} </a></li>
|
|
<li><a href="#permissions" data-toggle="tab">{{ trans('general.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-6{{ (Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}">
|
|
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" maxlength="191" />
|
|
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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-6{{ (Helper::checkIfRequired($user, 'last_name')) ? ' required' : '' }}">
|
|
<input class="form-control" type="text" name="last_name" id="last_name" value="{{ old('last_name', $user->last_name) }}" maxlength="191" />
|
|
{!! $errors->first('last_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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-6{{ (Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}">
|
|
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
|
|
<input
|
|
class="form-control"
|
|
type="text"
|
|
name="username"
|
|
id="username"
|
|
value="{{ Request::old('username', $user->username) }}"
|
|
autocomplete="off"
|
|
maxlength="191"
|
|
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
|
|
{{ trans('general.managed_ldap') }}
|
|
<input type="hidden" name="username" value="{{ Request::old('username', $user->username) }}">
|
|
|
|
@endif
|
|
|
|
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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-6{{ (Helper::checkIfRequired($user, 'password')) ? ' required' : '' }}">
|
|
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone') )
|
|
<input
|
|
type="password"
|
|
name="password"
|
|
class="form-control"
|
|
id="password"
|
|
value=""
|
|
maxlength="500"
|
|
autocomplete="off"
|
|
readonly
|
|
onfocus="this.removeAttribute('readonly');"
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}>
|
|
@else
|
|
{{ trans('general.managed_ldap') }}
|
|
@endif
|
|
<span id="generated-password"></span>
|
|
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
<div class="col-md-2">
|
|
@if ($user->ldap_import!='1')
|
|
<a href="#" class="left" id="genPassword">{{ trans('general.generate') }}</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
|
|
<!-- Password Confirm -->
|
|
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
|
|
<label class="col-md-3 control-label" for="password_confirmation">
|
|
{{ trans('admin/users/table.password_confirm') }}
|
|
</label>
|
|
<div class="col-md-6{{ ((Helper::checkIfRequired($user, 'password_confirmation')) && (!$user->id)) ? ' required' : '' }}">
|
|
<input
|
|
type="password"
|
|
name="password_confirmation"
|
|
id="password_confirm"
|
|
class="form-control"
|
|
value=""
|
|
maxlength="500"
|
|
autocomplete="off"
|
|
aria-label="password_confirmation"
|
|
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
|
|
{!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- 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('general.login_enabled')) }}
|
|
</div>
|
|
<div class="col-md-9">
|
|
@if (config('app.lock_passwords'))
|
|
<div class="icheckbox disabled" style="padding-left: 10px;">
|
|
<input type="checkbox" value="1" name="activated" class="minimal disabled" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} disabled="disabled" aria-label="activated">
|
|
<!-- this is necessary because the field is disabled and will reset -->
|
|
<input type="hidden" name="activated" value="{{ (int)$user->activated }}">
|
|
{{ trans('admin/users/general.activated_help_text') }}
|
|
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
|
|
|
</div>
|
|
@elseif ($user->id === Auth::user()->id)
|
|
<div class="icheckbox disabled" style="padding-left: 10px;">
|
|
<input type="checkbox" value="1" name="activated" class="minimal disabled" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} disabled="disabled">
|
|
<!-- this is necessary because the field is disabled and will reset -->
|
|
<input type="hidden" name="activated" value="1" aria-label="activated">
|
|
{{ 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;">
|
|
<input type="checkbox" value="1" id="activated" name="activated" class="minimal" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} aria-label="activated">
|
|
{{ trans('admin/users/general.activated_help_text') }}
|
|
</div>
|
|
@endif
|
|
|
|
{!! $errors->first('activated', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 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-6{{ (Helper::checkIfRequired($user, 'email')) ? ' required' : '' }}">
|
|
<input
|
|
class="form-control"
|
|
type="text"
|
|
name="email"
|
|
id="email"
|
|
maxlength="191"
|
|
value="{{ Request::old('email', $user->email) }}"
|
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
|
autocomplete="off"
|
|
readonly
|
|
onfocus="this.removeAttribute('readonly');">
|
|
@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" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Email user -->
|
|
@if (!$user->id)
|
|
<div class="form-group" id="email_user_row">
|
|
<div class="col-sm-3">
|
|
</div>
|
|
<div class="col-md-9">
|
|
<div class="icheckbox disabled" id="email_user_div">
|
|
{{ Form::checkbox('email_user', '1', Request::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
|
|
<!-- Image -->
|
|
@if ($user->avatar)
|
|
<div class="form-group {{ $errors->has('image_delete') ? 'has-error' : '' }}">
|
|
<label class="col-md-3 control-label" for="image_delete">{{ trans('general.image_delete') }}</label>
|
|
<div class="col-md-5">
|
|
{{ Form::checkbox('image_delete') }}
|
|
<img src="{{ Storage::disk('public')->url(app('users_upload_path').e($user->avatar)) }}" class="img-responsive" />
|
|
{!! $errors->first('image_delete', '<span class="alert-msg"><br>:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar'])
|
|
|
|
<!-- begin optional disclosure arrow stuff -->
|
|
<div class="form-group">
|
|
<label class="col-md-3 control-label"></label>
|
|
|
|
<div class="col-md-9 col-sm-9 col-md-offset-3">
|
|
|
|
<a id="optional_user_info" class="text-primary">
|
|
<i class="fa fa-caret-right fa-2x" id="optional_user_info_icon"></i>
|
|
<strong>{{ trans('admin/hardware/form.optional_infos') }}</strong>
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div id="optional_user_details" class="col-md-12" style="display:none">
|
|
<!-- everything here should be what is considered optional -->
|
|
<br>
|
|
<!-- Company -->
|
|
@if (\App\Models\Company::canManageUsersCompanies())
|
|
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.select_company'), 'fieldname' => 'company_id'])
|
|
@endif
|
|
|
|
|
|
<!-- 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-9">
|
|
{!! Form::locales('locale', old('locale', $user->locale), 'select2') !!}
|
|
{!! $errors->first('locale', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Employee Number -->
|
|
<div class="form-group {{ $errors->has('employee_num') ? 'has-error' : '' }}">
|
|
<label class="col-md-3 control-label" for="employee_num">{{ trans('general.employee_number') }}</label>
|
|
<div class="col-md-6">
|
|
<input
|
|
class="form-control"
|
|
type="text"
|
|
aria-label="employee_num"
|
|
name="employee_num"
|
|
maxlength="191"
|
|
id="employee_num"
|
|
value="{{ Request::old('employee_num', $user->employee_num) }}"
|
|
/>
|
|
{!! $errors->first('employee_num', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 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-6">
|
|
<input
|
|
class="form-control"
|
|
type="text"
|
|
maxlength="191"
|
|
name="jobtitle"
|
|
id="jobtitle"
|
|
value="{{ Request::old('jobtitle', $user->jobtitle) }}"
|
|
/>
|
|
{!! $errors->first('jobtitle', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Manager -->
|
|
@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])
|
|
|
|
<!-- Department -->
|
|
@include ('partials.forms.edit.department-select', ['translated_name' => trans('general.department'), 'fieldname' => 'department_id'])
|
|
|
|
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.start_date'), 'fieldname' => 'start_date', 'item' => $user])
|
|
|
|
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.end_date'), 'fieldname' => 'end_date', 'item' => $user])
|
|
|
|
|
|
<!-- remote checkbox -->
|
|
<div class="form-group">
|
|
<div class="col-md-7 col-md-offset-3">
|
|
<label for="remote">
|
|
<input type="checkbox" value="1" name="remote" class="minimal" {{ (old('remote', $user->remote)) == '1' ? ' checked="checked"' : '' }} aria-label="remote">
|
|
{{ trans('admin/users/general.remote_label') }}
|
|
|
|
</label>
|
|
<p class="help-block">{{ trans('admin/users/general.remote_help') }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Location -->
|
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
|
|
|
<!-- 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-6">
|
|
<input class="form-control" type="text" name="phone" id="phone" value="{{ old('phone', $user->phone) }}" maxlength="191" />
|
|
{!! $errors->first('phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Website URL -->
|
|
<div class="form-group {{ $errors->has('website') ? ' has-error' : '' }}">
|
|
<label for="website" class="col-md-3 control-label">{{ trans('general.website') }}</label>
|
|
<div class="col-md-6">
|
|
<input class="form-control" type="text" name="website" id="website" value="{{ old('website', $user->website) }}" maxlength="191" />
|
|
{!! $errors->first('website', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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-6">
|
|
<input class="form-control" type="text" name="address" id="address" value="{{ old('address', $user->address) }}" maxlength="191" />
|
|
{!! $errors->first('address', '<span class="alert-msg" aria-hidden="true">: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-6">
|
|
<input class="form-control" type="text" name="city" id="city" aria-label="city" value="{{ old('city', $user->city) }}" maxlength="191" />
|
|
{!! $errors->first('city', '<span class="alert-msg" aria-hidden="true">: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-6">
|
|
<input class="form-control" type="text" name="state" id="state" value="{{ old('state', $user->state) }}" maxlength="3" />
|
|
{!! $errors->first('state', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Country -->
|
|
<div class="form-group{{ $errors->has('country') ? ' has-error' : '' }}">
|
|
<label class="col-md-3 control-label" for="country">{{ trans('general.country') }}</label>
|
|
<div class="col-md-6">
|
|
{!! Form::countries('country', old('country', $user->country), 'col-md-6 select2') !!}
|
|
{!! $errors->first('country', '<span class="alert-msg" aria-hidden="true">: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-3">
|
|
<input class="form-control" type="text" name="zip" id="zip" value="{{ old('zip', $user->zip) }}" maxlength="10" />
|
|
{!! $errors->first('zip', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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-6">
|
|
<textarea class="form-control" rows="5" id="notes" name="notes">{{ old('notes', $user->notes) }}</textarea>
|
|
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
|
</div>
|
|
</div>
|
|
|
|
@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">
|
|
@if (config('app.lock_passwords'))
|
|
<div class="icheckbox disabled">
|
|
{{ Form::checkbox('two_factor_optin', '1', Request::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', Request::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
|
|
|
|
</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
|
|
|
|
<!-- 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-6">
|
|
|
|
@if ($groups->count())
|
|
@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">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
|
|
@else
|
|
<div class="controls">
|
|
<select
|
|
name="groups[]"
|
|
aria-label="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
|
|
@else
|
|
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
|
|
@endif
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div> <!--/col-md-12-->
|
|
</div>
|
|
</div><!-- /.tab-pane -->
|
|
|
|
<div class="tab-pane" id="permissions">
|
|
<div class="col-md-12">
|
|
@if (!Auth::user()->isSuperUser())
|
|
<p class="alert alert-warning">{{ trans('admin/users/general.superadmin_permission_warning') }}</p>
|
|
@endif
|
|
|
|
@if (!Auth::user()->hasAccess('admin'))
|
|
<p class="alert alert-warning">{{ trans('admin/users/general.admin_permission_warning') }}</p>
|
|
@endif
|
|
</div>
|
|
|
|
<table class="table table-striped permissions">
|
|
<thead>
|
|
<tr class="permissions-row">
|
|
<th class="col-md-5">{{ trans('admin/groups/titles.permission') }}</th>
|
|
<th class="col-md-1">{{ trans('admin/groups/titles.grant') }}</th>
|
|
<th class="col-md-1">{{ trans('admin/groups/titles.deny') }}</th>
|
|
<th class="col-md-1">{{ trans('admin/users/table.inherit') }}</th>
|
|
</tr>
|
|
</thead>
|
|
@include('partials.forms.edit.permissions-base')
|
|
</table>
|
|
</div><!-- /.tab-pane -->
|
|
</div><!-- /.tab-content -->
|
|
<div class="box-footer text-right">
|
|
<button type="submit" accesskey="s" class="btn btn-primary"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
|
</div>
|
|
</div><!-- nav-tabs-custom -->
|
|
</form>
|
|
</div> <!--/col-md-8-->
|
|
</div><!--/row-->
|
|
@stop
|
|
|
|
@section('moar_scripts')
|
|
|
|
<script nonce="{{ csrf_token() }}">
|
|
$(document).ready(function() {
|
|
|
|
$('#activated').on('ifChecked', function(event){
|
|
console.log('user activated is checked');
|
|
$("#email_user_row").show();
|
|
});
|
|
|
|
$('#activated').on('ifUnchecked', function(event){
|
|
$("#email_user_row").hide();
|
|
});
|
|
|
|
$('#email').on('keyup',function(){
|
|
event.preventDefault();
|
|
|
|
if(this.value.length > 5){
|
|
$('#email_user_checkbox').iCheck('enable');
|
|
} else {
|
|
$('#email_user_checkbox').iCheck('disable').iCheck('uncheck');
|
|
}
|
|
});
|
|
|
|
|
|
// 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');
|
|
});
|
|
|
|
$('.header-name').click(function() {
|
|
$(this).parent().nextUntil('tr.header-row').slideToggle(500);
|
|
});
|
|
|
|
$('.tooltip-base').tooltip({container: 'body'})
|
|
$(".superuser").change(function() {
|
|
var perms = $(this).val();
|
|
if (perms =='1') {
|
|
$("#nonadmin").hide();
|
|
} else {
|
|
$("#nonadmin").show();
|
|
}
|
|
});
|
|
|
|
$('#genPassword').pGenerator({
|
|
'bind': 'click',
|
|
'passwordElement': '#password',
|
|
'displayElement': '#generated-password',
|
|
'passwordLength': 16,
|
|
'uppercase': true,
|
|
'lowercase': true,
|
|
'numbers': true,
|
|
'specialChars': true,
|
|
'onPasswordGenerated': function(generatedPassword) {
|
|
$('#password_confirm').val($('#password').val());
|
|
}
|
|
});
|
|
|
|
$("#optional_user_info").on("click",function(){
|
|
$('#optional_user_details').fadeToggle(100);
|
|
$('#optional_user_info_icon').toggleClass('fa-caret-right fa-caret-down');
|
|
var optional_user_info_open = $('#optional_user_info_icon').hasClass('fa-caret-down');
|
|
document.cookie = "optional_user_info_open="+optional_user_info_open+'; path=/';
|
|
});
|
|
|
|
var all_cookies = document.cookie.split(';')
|
|
for(var i in all_cookies) {
|
|
var trimmed_cookie = all_cookies[i].trim(' ')
|
|
if (trimmed_cookie.startsWith('optional_user_info_open=')) {
|
|
elems = all_cookies[i].split('=', 2)
|
|
if (elems[1] == 'true') {
|
|
$('#optional_user_info').trigger('click')
|
|
}
|
|
}
|
|
}
|
|
|
|
$("#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="fas fa-spinner spin"></i>');
|
|
$.ajax({
|
|
url: '{{ route('api.users.two_factor_reset', ['id'=> $user->id]) }}',
|
|
type: 'POST',
|
|
data: {},
|
|
headers: {
|
|
"X-Requested-With": 'XMLHttpRequest',
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
|
},
|
|
dataType: 'json',
|
|
|
|
success: function (data) {
|
|
$("#two_factor_reseticon").html('');
|
|
$("#two_factor_resetstatus").html('<i class="fas fa-check text-success"></i>' + data.message);
|
|
},
|
|
|
|
error: function (data) {
|
|
$("#two_factor_reseticon").html('');
|
|
$("#two_factor_reseticon").html('<i class="fas fa-exclamation-triangle text-danger"></i>');
|
|
$('#two_factor_resetstatus').text(data.message);
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
@stop
|