From e4f6aefdadc8222e68c12ed3889a257e36407c65 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 21 Aug 2018 23:26:12 -0700 Subject: [PATCH 1/7] Added self-checkout permission option --- app/Providers/AuthServiceProvider.php | 4 ++++ config/permissions.php | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index bff39fbf1..d5f1dbd58 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -139,6 +139,10 @@ class AuthServiceProvider extends ServiceProvider return $user->hasAccess('self.edit_location'); }); + Gate::define('self.checkout_assets', function($user) { + return $user->hasAccess('self.checkout_assets'); + }); + Gate::define('backend.interact', function ($user) { return $user->can('view', Statuslabel::class) || $user->can('view', AssetModel::class) diff --git a/config/permissions.php b/config/permissions.php index 295039180..055088616 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -578,6 +578,13 @@ return array( 'display' => true, ), + array( + 'permission' => 'self.checkout_assets', + 'label' => 'Self-Checkout', + 'note' => 'This user may check out assets that are marked for self-checkout.', + 'display' => true, + ), + ), From 0b8d70c7ecdb68db945e3ba347e89752a34272cd Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 23 Aug 2018 21:06:04 -0700 Subject: [PATCH 2/7] Fixed #6124 --- resources/views/layouts/basic.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/basic.blade.php b/resources/views/layouts/basic.blade.php index bcf1aa4e1..eb587bcc9 100644 --- a/resources/views/layouts/basic.blade.php +++ b/resources/views/layouts/basic.blade.php @@ -56,7 +56,7 @@
- @if ($snipeSettings->privacy_policy_link!='') + @if (($snipeSettings) && ($snipeSettings->privacy_policy_link!='')) {{ trans('admin/settings/general.privacy_policy') }} @endif
From 5b8cbe29e182c691fa71911bdee403610bda2978 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 27 Aug 2018 14:51:37 -0700 Subject: [PATCH 3/7] Possible fix for #5054 - OpenLDAP (non-AD) LDAP users being deactivated --- app/Console/Commands/LdapSync.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index 4ec7509d1..bcbc6a7b5 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -169,6 +169,11 @@ class LdapSync extends Command $item['activated'] = ( in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts) ) ? 1 : 0; } else { $item['activated'] = 0; + + // If there is no activated flag, assume this is handled via the OU and activate the users + if (empty($ldap_result_active_flag)) { + $item['activated'] = 1; + } } // User exists From 678ba228cb9a7b787f70605b9b4c6849db7d534e Mon Sep 17 00:00:00 2001 From: liquidhorse Date: Tue, 28 Aug 2018 15:29:50 -0400 Subject: [PATCH 4/7] Fixed #6079: QR Code unnecessarily squished. (#6080) * Fixed 2D barcode from being squished unnecessarily when 1D barcode is omitted. Added one character of whitespace for code readability. --- composer.json | 2 +- resources/views/hardware/labels.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d72a02485..1ed5fe51a 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "snipe/snipe-it", "description": "Open source asset management system built on Laravel.", "keywords": ["assets", "asset-management", "laravel"], - "license": "AGPL-3", + "license": "AGPL-3.0-or-later", "type": "project", "require": { "php": ">=7.1.3", diff --git a/resources/views/hardware/labels.blade.php b/resources/views/hardware/labels.blade.php index b0a83031c..d5fef3942 100644 --- a/resources/views/hardware/labels.blade.php +++ b/resources/views/hardware/labels.blade.php @@ -11,9 +11,9 @@ $settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter; $settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter; // Leave space on bottom for 1D barcode if necessary - $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - .3; + $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height; // Leave space on left for QR code if necessary - $qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width); + $qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1 : $settings->labels_width); ?>