A free open source IT asset/license management system
Fixed #5477 - added GDPR privacy policy link in email and webpage
snipe04709dc1df81
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 6c689554d5..dc1c5b1611 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -347,6 +347,7 @@ class SettingsController extends Controller$setting->default_eula_text = $request->input('default_eula_text');$setting->thumbnail_max_h = $request->input('thumbnail_max_h');+ $setting->privacy_policy_link = $request->input('privacy_policy_link');if (Input::get('per_page')!='') {$setting->per_page = $request->input('per_page');diff --git a/app/Models/Loggable.php b/app/Models/Loggable.phpindex cdebaf11b4..9eea4bc5a7 100644--- a/app/Models/Loggable.php+++ b/app/Models/Loggable.php@@ -76,7 +76,7 @@ trait Loggable$checkoutClass = null;if (method_exists($target, 'notify')) {- \Log::debug('This target is notifiable');+ // \Log::debug('This target is notifiable');$target->notify(new static::$checkoutClass($params));}@@ -84,7 +84,7 @@ trait Loggable$recipient = new \App\Models\Recipients\AdminRecipient();if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) {- \Log::debug('Send an email to the admin - '.$settings->admin_cc_email);+ // \Log::debug('Send an email to the admin - '.$settings->admin_cc_email);$recipient->notify(new static::$checkoutClass($params));}diff --git a/app/Models/Setting.php b/app/Models/Setting.phpindex 4d1e45808d..af8fafb7d3 100755--- a/app/Models/Setting.php+++ b/app/Models/Setting.php@@ -43,6 +43,7 @@ class Setting extends Model'audit_warning_days' => 'numeric|nullable','audit_interval' => 'numeric|nullable','custom_forgot_pass_url' => 'url|nullable',+ 'privacy_policy_link' => 'nullable|url'];protected $fillable = ['site_name','email_domain','email_format','username_format'];diff --git a/database/migrations/2018_05_08_031515_add_gdpr_privacy_footer.php b/database/migrations/2018_05_08_031515_add_gdpr_privacy_footer.phpnew file mode 100644index 0000000000..bc5de9f2c1--- /dev/null+++ b/database/migrations/2018_05_08_031515_add_gdpr_privacy_footer.php@@ -0,0 +1,32 @@+<?php++use Illuminate\Support\Facades\Schema;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Database\Migrations\Migration;++class AddGdprPrivacyFooter extends Migration+{+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::table('settings', function (Blueprint $table) {+ $table->char('privacy_policy_link')->nullable()->default(null);+ });+ }++ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::table('settings', function (Blueprint $table) {+ $table->dropColumn('privacy_policy_link');+ });+ }+}diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.phpindex 6c6ac54672..b1679b1268 100644--- a/resources/lang/en/admin/settings/general.php+++ b/resources/lang/en/admin/settings/general.php@@ -131,8 +131,11 @@ return array('labels_per_page' => 'Labels per page','label_dimensions' => 'Label dimensions (inches)','next_auto_tag_base' => 'Next auto-increment',- 'page_padding' => 'Page margins (inches)',- 'purge' => 'Purge Deleted Records',+ 'page_padding' => 'Page margins (inches)',+ 'privacy_policy_link' => 'Link to Privacy Policy',+ 'privacy_policy' => 'Privacy Policy',+ 'privacy_policy_link_help' => 'If a url is included here, a link to your privacy policy will be included in the app footer and in any emails that the system sends out, in compliance with GDPR. ',+ 'purge' => 'Purge Deleted Records','labels_display_bgutter' => 'Label bottom gutter','labels_display_sgutter' => 'Label side gutter','labels_fontsize' => 'Label font size',diff --git a/resources/views/emails/layouts/default.blade.php b/resources/views/emails/layouts/default.blade.phpindex 021e0b8937..55cc33bb01 100755--- a/resources/views/emails/layouts/default.blade.php+++ b/resources/views/emails/layouts/default.blade.php@@ -21,5 +21,9 @@</head><body>@yield('content')++@if ($snipeSettings->privacy_policy_link!='')+<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>+@endif</body></html>diff --git a/resources/views/layouts/basic.blade.php b/resources/views/layouts/basic.blade.phpindex ca37fadad2..2fc35c6d0e 100644--- a/resources/views/layouts/basic.blade.php+++ b/resources/views/layouts/basic.blade.php@@ -54,6 +54,12 @@+ <div class="text-center" style="padding-top: 100px;">+ @if ($snipeSettings->privacy_policy_link!='')+ <a target="_blank" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>+ @endif+ </div>+</body></html>diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.phpindex 07c01c6376..31e219b1c6 100644--- a/resources/views/layouts/default.blade.php+++ b/resources/views/layouts/default.blade.php@@ -750,6 +750,11 @@@endif@endif+ @if ($snipeSettings->privacy_policy_link!='')+ <a target="_blank" class="btn btn-default btn-xs" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>+ @endif++</div>@if ($snipeSettings->footer_text!='')<div class="pull-right">@@ -757,6 +762,7 @@</div>@endif+<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is open source software, made with <i class="fa fa-heart" style="color: #a94442; font-size: 10px"></i> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a>.</footer>diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.phpindex 6cb6b5c45a..7c2b1997b9 100644--- a/resources/views/settings/general.blade.php+++ b/resources/views/settings/general.blade.php@@ -267,6 +267,18 @@</div></div><!-- /.form-group -->++ <!-- Privacy Polict Footer-->+ <div class="form-group {{ $errors->has('privacy_policy_link') ? 'error' : '' }}">+ <div class="col-md-3">+ {{ Form::label('privacy_policy_link', trans('admin/settings/general.privacy_policy_link')) }}+ </div>+ <div class="col-md-9">+ {{ Form::text('privacy_policy_link', Input::old('privacy_policy_link', $setting->privacy_policy_link), array('class' => 'form-control')) }}+ <span class="help-block">{{ trans('admin/settings/general.privacy_policy_link_help') }}</span>+ {!! $errors->first('privacy_policy_link', '<span class="alert-msg">:message</span>') !!}+ </div>+ </div></div></div> <!--/.box-body-->diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.phpindex d9a1d959b6..b69b4387fc 100644--- a/resources/views/vendor/mail/html/message.blade.php+++ b/resources/views/vendor/mail/html/message.blade.php@@ -35,14 +35,19 @@@endslot@endisset- {{-- Footer --}}- @slot('footer')- @component('mail::footer')- @if($snipeSettings::setupCompleted())- © {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.- @else- © {{ date('Y') }} Snipe-it. All rights reserved.- @endif- @endcomponent+{{-- Footer --}}+@slot('footer')+@component('mail::footer')+@if($snipeSettings::setupCompleted())+© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.+@else+© {{ date('Y') }} Snipe-it. All rights reserved.+@endif++@if ($snipeSettings->privacy_policy_link!='')+<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>+@endif++@endcomponent@endslot@endcomponentdiff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.phpindex fbbf0db699..25e0ab4a4f 100644--- a/resources/views/vendor/mail/markdown/message.blade.php+++ b/resources/views/vendor/mail/markdown/message.blade.php@@ -34,14 +34,19 @@@endslot@endisset- {{-- Footer --}}- @slot('footer')- @component('mail::footer')- @if($snipeSettings::setupCompleted())- © {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.- @else- © {{ date('Y') }} Snipe-it. All rights reserved.- @endif- @endcomponent- @endslot+{{-- Footer --}}+@slot('footer')+@component('mail::footer')+@if($snipeSettings::setupCompleted())+© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.+@else+© {{ date('Y') }} Snipe-it. All rights reserved.+@endif++@if ($snipeSettings->privacy_policy_link!='')+[{{ $snipeSettings->privacy_policy_link }}]({{ trans('admin/settings/general.privacy_policy') }})+@endif++@endcomponent+@endslot@endcomponent