diff --git a/.env.example b/.env.example index a9563e6321..2d45ff580e 100644 --- a/.env.example +++ b/.env.example @@ -149,6 +149,7 @@ AWS_DEFAULT_REGION=null # -------------------------------------------- LOGIN_MAX_ATTEMPTS=5 LOGIN_LOCKOUT_DURATION=60 +LOGIN_AUTOCOMPLETE=false # -------------------------------------------- # OPTIONAL: FORGOTTEN PASSWORD SETTINGS diff --git a/app/View/Label.php b/app/View/Label.php index 99da449827..d581548eb3 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -39,7 +39,7 @@ class Label implements View $assets = $this->data->get('assets'); $offset = $this->data->get('offset'); $template = $this->data->get('template'); - + // If disabled, pass to legacy view if ((!$settings->label2_enable) && (!$template)) { return view('hardware/labels') @@ -49,8 +49,12 @@ class Label implements View ->with('count', $this->data->get('count')); } - if (empty($template)) $template = LabelModel::find($settings->label2_template); - elseif (is_string($template)) $template = LabelModel::find($template); + // If a specific template was set, use it, otherwise fall back to default + if (empty($template)) { + $template = LabelModel::find($settings->label2_template); + } elseif (is_string($template)) { + $template = LabelModel::find($template); + } $template->validate(); @@ -87,25 +91,36 @@ class Label implements View $assetData->put('tag', $asset->asset_tag); 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; - if (!empty($title)) $assetData->put('title', $title); + $assetData->put('title', $title); + } } if ($template->getSupportLogo()) { - $logo = $settings->label2_asset_logo ? - ( - !empty($asset->company->image) ? - Storage::disk('public')->path('companies/'.e($asset->company->image)) : - null - ) : - ( - !empty($settings->label_logo) ? - Storage::disk('public')->path(''.e($settings->label_logo)) : - null - ); - if (!empty($logo)) $assetData->put('logo', $logo); + + $logo = null; + + // Should we be trying to use a logo at all? + if ($settings->label2_asset_logo='1') { + + // If we don't have a company image, fall back to the general site label image + if (!empty($settings->label_logo)) { + $logo = Storage::disk('public')->path('/'.e($settings->label_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()) { diff --git a/config/auth.php b/config/auth.php index 7f580d68b1..1603c93337 100644 --- a/config/auth.php +++ b/config/auth.php @@ -132,4 +132,16 @@ return [ '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), + ]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 8d9f648a9a..bd91170b7d 100755 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -4,9 +4,10 @@ {{-- Page content --}} @section('content') -
+ + @@ -45,12 +46,12 @@
- + {!! $errors->first('username', '') !!}
- + {!! $errors->first('password', '') !!}
diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index 32dda8118f..d23ff8ef2c 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -128,7 +128,7 @@

{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' > '.trans('admin/settings/general.label_logo')]) !!}