Added login note to settings

This commit is contained in:
snipe 2017-07-07 19:54:10 -07:00
parent c2e8803d1e
commit 9894edb008
5 changed files with 65 additions and 0 deletions

View file

@ -418,6 +418,7 @@ class SettingsController extends Controller
$setting->date_display_format = $request->input('date_display_format');
$setting->time_display_format = $request->input('time_display_format');
$setting->brand = $request->input('brand', '1');
$setting->login_note = $request->input('login_note');
if ($request->input('clear_logo')=='1') {

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLoginText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->text('login_note')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('login_note');
});
}
}

View file

@ -63,6 +63,8 @@ return array(
'ldap_email' => 'LDAP Email',
'load_remote_text' => 'Remote Scripts',
'load_remote_help_text' => 'This Snipe-IT install can load scripts from the outside world.',
'login_note' => 'Login Note',
'login_note_help' => 'Optionally include a few sentences on your login screen, for example to assist people who have found a lost or stolen device. This field accepts <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>',
'logo' => 'Logo',
'full_multiple_companies_support_help_text' => 'Restricting users (including admins) assigned to companies to their company\'s assets.',
'full_multiple_companies_support_text' => 'Full Multiple Companies Support',

View file

@ -21,6 +21,13 @@
<div class="login-box-body">
<div class="row">
@if ($snipeSettings->login_note)
<div class="col-md-12">
<div class="alert alert-info">
{!! Parsedown::instance()->text(e($snipeSettings->login_note)) !!}
</div>
</div>
@endif
<!-- Notifications -->
@include('notifications')

View file

@ -312,6 +312,29 @@
{!! $errors->first('per_page', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- login text -->
<div class="form-group {{ $errors->has('custom_css') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('login_note', trans('admin/settings/general.login_note')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
<textarea class="form-control" name="login_note" placeholder="If you do not have a login or have found a device belonging to this company, please call technical support at 888-555-1212. Thank you." rows="2">{{ Input::old('login_note', $setting->login_note) }}</textarea>
{!! $errors->first('custom_css', '<span class="alert-msg">:message</span>') !!}
<p class="help-block">{{ trans('general.lock_passwords') }}</p>
@else
<textarea class="form-control" name="login_note" placeholder="If you do not have a login or have found a device belonging to this company, please call technical support at 888-555-1212. Thank you." rows="2">{{ Input::old('login_note', $setting->login_note) }}</textarea>
{!! $errors->first('login_note', '<span class="alert-msg">:message</span>') !!}
@endif
<p class="help-block">{!! trans('admin/settings/general.login_note_help') !!}</p>
</div>
</div>
</div> <!-- .box-body-->
</div> <!--/.collapseOne-->
</div>