Skip to content

A free open source IT asset/license management system

Added login note to settings

snipe9894edb008d2
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php
index 2d90d45ab5..9e19063463 100755
--- a/app/Http/Controllers/SettingsController.php
+++ b/app/Http/Controllers/SettingsController.php
@@ -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') {
diff --git a/database/migrations/2017_07_07_191533_add_login_text.php b/database/migrations/2017_07_07_191533_add_login_text.php
new file mode 100644
index 0000000000..5fbd953655
--- /dev/null
+++ b/database/migrations/2017_07_07_191533_add_login_text.php
@@ -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');
+ });
+ }
+}
diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php
index ee99da53d4..2f86f03821 100644
--- a/resources/lang/en/admin/settings/general.php
+++ b/resources/lang/en/admin/settings/general.php
@@ -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',
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php
index c69fe6f079..8e734fd453 100755
--- a/resources/views/auth/login.blade.php
+++ b/resources/views/auth/login.blade.php
@@ -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')
diff --git a/resources/views/settings/edit.blade.php b/resources/views/settings/edit.blade.php
index bdb22c564f..3e7d365018 100755
--- a/resources/views/settings/edit.blade.php
+++ b/resources/views/settings/edit.blade.php
@@ -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>