mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
8810059427
|
@ -149,6 +149,7 @@ AWS_DEFAULT_REGION=null
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
LOGIN_MAX_ATTEMPTS=5
|
LOGIN_MAX_ATTEMPTS=5
|
||||||
LOGIN_LOCKOUT_DURATION=60
|
LOGIN_LOCKOUT_DURATION=60
|
||||||
|
LOGIN_AUTOCOMPLETE=false
|
||||||
|
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS
|
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Label implements View
|
||||||
$assets = $this->data->get('assets');
|
$assets = $this->data->get('assets');
|
||||||
$offset = $this->data->get('offset');
|
$offset = $this->data->get('offset');
|
||||||
$template = $this->data->get('template');
|
$template = $this->data->get('template');
|
||||||
|
|
||||||
// If disabled, pass to legacy view
|
// If disabled, pass to legacy view
|
||||||
if ((!$settings->label2_enable) && (!$template)) {
|
if ((!$settings->label2_enable) && (!$template)) {
|
||||||
return view('hardware/labels')
|
return view('hardware/labels')
|
||||||
|
@ -49,8 +49,12 @@ class Label implements View
|
||||||
->with('count', $this->data->get('count'));
|
->with('count', $this->data->get('count'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($template)) $template = LabelModel::find($settings->label2_template);
|
// If a specific template was set, use it, otherwise fall back to default
|
||||||
elseif (is_string($template)) $template = LabelModel::find($template);
|
if (empty($template)) {
|
||||||
|
$template = LabelModel::find($settings->label2_template);
|
||||||
|
} elseif (is_string($template)) {
|
||||||
|
$template = LabelModel::find($template);
|
||||||
|
}
|
||||||
|
|
||||||
$template->validate();
|
$template->validate();
|
||||||
|
|
||||||
|
@ -87,25 +91,36 @@ class Label implements View
|
||||||
$assetData->put('tag', $asset->asset_tag);
|
$assetData->put('tag', $asset->asset_tag);
|
||||||
|
|
||||||
if ($template->getSupportTitle()) {
|
if ($template->getSupportTitle()) {
|
||||||
$title = !empty($settings->label2_title) ?
|
|
||||||
str_ireplace('{COMPANY}', $asset->company->name, $settings->label2_title) :
|
if ($asset->company && !empty($settings->label2_title)) {
|
||||||
|
$title = str_replace('{COMPANY}', $asset->company->name, $settings->label2_title);
|
||||||
$settings->qr_text;
|
$settings->qr_text;
|
||||||
if (!empty($title)) $assetData->put('title', $title);
|
$assetData->put('title', $title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($template->getSupportLogo()) {
|
if ($template->getSupportLogo()) {
|
||||||
$logo = $settings->label2_asset_logo ?
|
|
||||||
(
|
$logo = null;
|
||||||
!empty($asset->company->image) ?
|
|
||||||
Storage::disk('public')->path('companies/'.e($asset->company->image)) :
|
// Should we be trying to use a logo at all?
|
||||||
null
|
if ($settings->label2_asset_logo='1') {
|
||||||
) :
|
|
||||||
(
|
// If we don't have a company image, fall back to the general site label image
|
||||||
!empty($settings->label_logo) ?
|
if (!empty($settings->label_logo)) {
|
||||||
Storage::disk('public')->path(''.e($settings->label_logo)) :
|
$logo = Storage::disk('public')->path('/'.e($settings->label_logo));
|
||||||
null
|
}
|
||||||
);
|
|
||||||
if (!empty($logo)) $assetData->put('logo', $logo);
|
// If we have a company logo, use that first
|
||||||
|
if (($asset->company) && ($asset->company->image!='')) {
|
||||||
|
$logo = Storage::disk('public')->path('companies/'.e($asset->company->image));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($logo)) {
|
||||||
|
$assetData->put('logo', $logo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($template->getSupport1DBarcode()) {
|
if ($template->getSupport1DBarcode()) {
|
||||||
|
|
|
@ -132,4 +132,16 @@ return [
|
||||||
|
|
||||||
'password_timeout' => env('PASSWORD_CONFIRM_TIMEOUT', 10800),
|
'password_timeout' => env('PASSWORD_CONFIRM_TIMEOUT', 10800),
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Login form autocomplete
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Determine whether to include autocomplete="off" on the login form. Some users may want to disable
|
||||||
|
| autocomplete for compliance with security requirements.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'login_autocomplete' => env('LOGIN_AUTOCOMPLETE', false),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
{{-- Page content --}}
|
{{-- Page content --}}
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
<form role="form" action="{{ url('/login') }}" method="POST" autocomplete="false">
|
<form role="form" action="{{ url('/login') }}" method="POST" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}">
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||||
|
|
||||||
|
|
||||||
<!-- this is a hack to prevent Chrome from trying to autocomplete fields -->
|
<!-- this is a hack to prevent Chrome from trying to autocomplete fields -->
|
||||||
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" aria-hidden="true">
|
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" aria-hidden="true">
|
||||||
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" aria-hidden="true">
|
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" aria-hidden="true">
|
||||||
|
@ -45,12 +46,12 @@
|
||||||
|
|
||||||
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
||||||
<label for="username"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('admin/users/table.username') }}</label>
|
<label for="username"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('admin/users/table.username') }}</label>
|
||||||
<input class="form-control" placeholder="{{ trans('admin/users/table.username') }}" name="username" type="text" id="username" autocomplete="off" autofocus>
|
<input class="form-control" placeholder="{{ trans('admin/users/table.username') }}" name="username" type="text" id="username" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}" autofocus>
|
||||||
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||||
<label for="password"><i class="fa fa-key" aria-hidden="true"></i> {{ trans('admin/users/table.password') }}</label>
|
<label for="password"><i class="fa fa-key" aria-hidden="true"></i> {{ trans('admin/users/table.password') }}</label>
|
||||||
<input class="form-control" placeholder="{{ trans('admin/users/table.password') }}" name="password" type="password" id="password" autocomplete="off">
|
<input class="form-control" placeholder="{{ trans('admin/users/table.password') }}" name="password" type="password" id="password" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}">
|
||||||
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
|
|
||||||
<label class="form-control">
|
<label class="form-control">
|
||||||
<input type="checkbox" value="1" name="label2_asset_logo"{{ ((old('label2_asset_logo') == '1') || ($setting->label2_asset_logo) == '1') ? ' checked="checked"' : '' }} aria-label="label2_asset_logo">
|
<input type="checkbox" value="1" name="label2_asset_logo"{{ ((old('label2_asset_logo') == '1') || ($setting->label2_asset_logo) == '1') ? ' checked="checked"' : '' }} aria-label="label2_asset_logo">
|
||||||
{{ trans('general.yes') }}
|
{{ Form::label('label2_asset_logo', trans('admin/settings/general.label2_asset_logo')) }}
|
||||||
</label>
|
</label>
|
||||||
<p class="help-block">
|
<p class="help-block">
|
||||||
{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' > '.trans('admin/settings/general.label_logo')]) !!}
|
{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' > '.trans('admin/settings/general.label_logo')]) !!}
|
||||||
|
|
Loading…
Reference in a new issue