snipe-it/resources/views/settings/security.blade.php
snipe 296de34e8a
WIP: Upgrade develop to Laravel 6.6.1 (#7637)
I'm going ahead and merging this, since the upgrade doesn't break Flysystem any worse than the current develop is broken, so far as I can tell. 


* Upgraded framework to Laravel 6

### TO DO:

- Fix password restriction rules- the old library isn’t compatible with Laravel 6 :(
- Figure out why in-app API calls are returning “Unauthorized”

* More updates from Input:: to Request:: helper

* Switch to Request:: from Input

* Added passport config

* Fixed goofy password minimum in seeder

* Added laravel/helpers

* Changed ($item)  to ($item->id) in forms

I have no idea why this is necessary

* Changed ($item) to ($item->id) in forms

* Updated API middleware to auth:api

* Updated with added laravel auth.php values

* FIxed *&!^$%^&$^%!!!! ajax issue

* Switch to Request::get from Input::get

* Switched to Request facade

* Added password security minimums back in

The package we were using has not been updated to Laravel v6, so I created custom validators instead

* Added language strings for error messages for password rules

* Fixed `($item)` issue in formActions for partials
2019-12-10 19:32:50 -08:00

184 lines
10 KiB
PHP

@extends('layouts/default')
{{-- Page title --}}
@section('title')
Update Security Settings
@parent
@stop
@section('header_right')
<a href="{{ route('settings.index') }}" class="btn btn-default"> {{ trans('general.back') }}</a>
@stop
{{-- Page content --}}
@section('content')
{{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }}
<!-- CSRF Token -->
{{csrf_field()}}
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
<div class="panel box box-default">
<div class="box-header with-border">
<h4 class="box-title">
<i class="fa fa-lock"></i> Security
</h4>
</div>
<div class="box-body">
<div class="col-md-11 col-md-offset-1">
<!-- Two Factor -->
<div class="form-group {{ $errors->has('brand') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('two_factor_enabled', trans('admin/settings/general.two_factor_enabled_text')) }}
</div>
<div class="col-md-9">
{!! Form::two_factor_options('two_factor_enabled', Request::old('two_factor_enabled', $setting->two_factor_enabled), 'select2') !!}
<p class="help-block">{{ trans('admin/settings/general.two_factor_enabled_warning') }}</p>
@if (config('app.lock_passwords'))
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
@endif
{!! $errors->first('two_factor_enabled', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- Min characters -->
<div class="form-group {{ $errors->has('pwd_secure_min') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('pwd_secure_min', trans('admin/settings/general.pwd_secure_min')) }}
</div>
<div class="col-md-9">
{{ Form::text('pwd_secure_min', Request::old('pwd_secure_min', $setting->pwd_secure_min), array('class' => 'form-control', 'style'=>'width: 50px;')) }}
{!! $errors->first('pwd_secure_min', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.pwd_secure_min_help') }}
</p>
</div>
</div>
<!-- Common Passwords -->
<div class="form-group {{ $errors->has('pwd_secure_uncommon') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('pwd_secure_text',
trans('admin/settings/general.pwd_secure_uncommon')) }}
</div>
<div class="col-md-9">
{{ Form::checkbox('pwd_secure_uncommon', '1', Request::old('pwd_secure_uncommon', $setting->pwd_secure_uncommon),array('class' => 'minimal')) }}
{{ Form::label('pwd_secure_uncommon', trans('general.yes')) }}
{!! $errors->first('pwd_secure_uncommon', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.pwd_secure_uncommon_help') }}
</p>
</div>
</div>
<!-- /.form-group -->
<!-- Common Passwords -->
<div class="form-group">
<div class="col-md-3">
{{ Form::label('pwd_secure_complexity', trans('admin/settings/general.pwd_secure_complexity')) }}
</div>
<div class="col-md-9">
{{ Form::checkbox("pwd_secure_complexity['letters']", 'letters', Request::old('pwd_secure_uncommon', strpos($setting->pwd_secure_complexity, 'letters')!==false), array('class' => 'minimal')) }}
Require at least one letter <br>
{{ Form::checkbox("pwd_secure_complexity['numbers']", 'numbers', Request::old('pwd_secure_uncommon', strpos($setting->pwd_secure_complexity, 'numbers')!==false), array('class' => 'minimal')) }}
Require at least one number<br>
{{ Form::checkbox("pwd_secure_complexity['symbols']", 'symbols', Request::old('pwd_secure_uncommon', strpos($setting->pwd_secure_complexity, 'symbols')!==false), array('class' => 'minimal')) }}
Require at least one symbol<br>
{{ Form::checkbox("pwd_secure_complexity['case_diff']", 'case_diff', Request::old('pwd_secure_uncommon', strpos($setting->pwd_secure_complexity, 'case_diff')!==false), array('class' => 'minimal')) }}
Require at least one uppercase and one lowercase
<p class="help-block">
{{ trans('admin/settings/general.pwd_secure_complexity_help') }}
</p>
</div>
</div>
<!-- /.form-group -->
<hr>
<!-- Remote User Authentication -->
<div class="form-group {{ $errors->has('login_remote_user') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('login_remote_user', trans('admin/settings/general.login_remote_user_text')) }}
</div>
<div class="col-md-9">
<!-- Enable Remote User Login -->
@if (config('app.lock_passwords'))
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
@else
{{ Form::checkbox('login_remote_user_enabled', '1', Request::old('login_remote_user_enabled', $setting->login_remote_user_enabled),array('class' => 'minimal')) }}
{{ Form::label('login_remote_user_enabled', trans('admin/settings/general.login_remote_user_enabled_text')) }}
{!! $errors->first('login_remote_user_enabled', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.login_remote_user_enabled_help') }}
</p>
<!-- Use custom remote user header name -->
{{ Form::label('login_remote_user_header_name', trans('admin/settings/general.login_remote_user_header_name_text')) }}
{{ Form::text('login_remote_user_header_name', Request::old('login_remote_user_header_name', $setting->login_remote_user_header_name),array('class' => 'form-control')) }}
{!! $errors->first('login_remote_user_header_name', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.login_remote_user_header_name_help') }}
</p>
<!-- Custom logout url to redirect to authentication provider -->
{{ Form::label('login_remote_user_custom_logout_url', trans('admin/settings/general.login_remote_user_custom_logout_url_text')) }}
{{ Form::text('login_remote_user_custom_logout_url', Request::old('login_remote_user_custom_logout_url', $setting->login_remote_user_custom_logout_url),array('class' => 'form-control')) }}
{!! $errors->first('login_remote_user_custom_logout_url', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.login_remote_user_custom_logout_url_help') }}
</p>
<!-- Disable other logins mechanism -->
{{ Form::checkbox('login_common_disabled', '1', Request::old('login_common_disabled', $setting->login_common_disabled),array('class' => 'minimal')) }}
{{ Form::label('login_common_disabled', trans('admin/settings/general.login_common_disabled_text')) }}
{!! $errors->first('login_common_disabled', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">
{{ trans('admin/settings/general.login_common_disabled_help') }}
</p>
@endif
</div>
</div>
</div>
</div> <!--/.box-body-->
<div class="box-footer">
<div class="text-left col-md-6">
<a class="btn btn-link text-left" href="{{ route('settings.index') }}">{{ trans('button.cancel') }}</a>
</div>
<div class="text-right col-md-6">
<button type="submit" class="btn btn-success"><i class="fa fa-check icon-white"></i> {{ trans('general.save') }}</button>
</div>
</div>
</div> <!-- /box -->
</div> <!-- /.col-md-8-->
</div> <!-- /.row-->
{{Form::close()}}
@stop