From 2aa50859b325ea0d31a0ab1e64da1acd34b1c937 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:01:03 -0800 Subject: [PATCH 001/159] Bump Dusk version to fix broken macOS chrome driver link --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 07dbf20639..06d8563039 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ }, "require-dev": { "fakerphp/faker": "^1.16", - "laravel/dusk": "^6.19", + "laravel/dusk": "^6.25", "mockery/mockery": "^1.4", "phpunit/php-token-stream": "^3.1", "phpunit/phpunit": "^9.0", diff --git a/composer.lock b/composer.lock index bf8cb1f758..7c8b7030ba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0c1f3848f8c9ede2b5f1513e4feaa7d7", + "content-hash": "4fed0ab76a34ef85a44568e470abab48", "packages": [ { "name": "alek13/slack", @@ -11847,16 +11847,16 @@ }, { "name": "laravel/dusk", - "version": "v6.25.0", + "version": "v6.25.2", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "b4632b7493a187d31afc5c9ddec437c81b16421a" + "reference": "25a595ac3dc82089a91af10dd23b0d58fd3f6d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/b4632b7493a187d31afc5c9ddec437c81b16421a", - "reference": "b4632b7493a187d31afc5c9ddec437c81b16421a", + "url": "https://api.github.com/repos/laravel/dusk/zipball/25a595ac3dc82089a91af10dd23b0d58fd3f6d0b", + "reference": "25a595ac3dc82089a91af10dd23b0d58fd3f6d0b", "shasum": "" }, "require": { @@ -11914,9 +11914,9 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.25.0" + "source": "https://github.com/laravel/dusk/tree/v6.25.2" }, - "time": "2022-07-11T11:38:43+00:00" + "time": "2022-09-29T09:37:07+00:00" }, { "name": "mockery/mockery", From 581655f7562199c61267e15e8ba05f1b3fd32b52 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:02:11 -0800 Subject: [PATCH 002/159] Run database migrations for all Dusk tests --- tests/DuskTestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php index ac750d9efc..e591a7c771 100644 --- a/tests/DuskTestCase.php +++ b/tests/DuskTestCase.php @@ -5,11 +5,13 @@ namespace Tests; use Facebook\WebDriver\Chrome\ChromeOptions; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; +use Illuminate\Foundation\Testing\DatabaseMigrations; use Laravel\Dusk\TestCase as BaseTestCase; abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; + use DatabaseMigrations; /** * Prepare for Dusk test execution. From bc0f666906d81eaedc0d9273ed54fb1cc8a6e496 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:03:09 -0800 Subject: [PATCH 003/159] Create Setting in test to avoid being redirected to the setup screen --- tests/Browser/LoginTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Browser/LoginTest.php b/tests/Browser/LoginTest.php index 5ed055cda9..18f5172f15 100644 --- a/tests/Browser/LoginTest.php +++ b/tests/Browser/LoginTest.php @@ -2,8 +2,8 @@ namespace Tests\Browser; +use App\Models\Setting; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; use Laravel\Dusk\Browser; use Tests\DuskTestCase; @@ -26,6 +26,9 @@ class LoginTest extends DuskTestCase $user->permissions = '{"superuser": 1}'; $user->save(); + + Setting::factory()->create(); + $this->browse(function (Browser $browser) { $browser->visitRoute('login') ->assertSee(trans('auth/general.login_prompt')); @@ -37,10 +40,7 @@ class LoginTest extends DuskTestCase ->type('password', 'password') ->press(trans('auth/general.login')) ->assertPathIs('/'); - $browser->screenshot('dashboard'); + $browser->screenshot('dashboard'); }); - - // Delete the user afterwards - $user->delete(); } } From b8b2543b0dca61c29e90eac45a44d6852b6d4491 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:04:21 -0800 Subject: [PATCH 004/159] Reference the correct table in migration down method --- .../migrations/2017_03_10_210807_add_fields_to_manufacturer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php b/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php index 0d05a680c1..05af7c8316 100644 --- a/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php +++ b/database/migrations/2017_03_10_210807_add_fields_to_manufacturer.php @@ -28,7 +28,7 @@ class AddFieldsToManufacturer extends Migration */ public function down() { - Schema::table('settings', function ($table) { + Schema::table('manufacturers', function ($table) { $table->dropColumn('url'); $table->dropColumn('support_url'); $table->dropColumn('support_phone'); From e5cb68cc5ebc73fda5266b783440117550f72f6c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:06:16 -0800 Subject: [PATCH 005/159] Move drop column command to correct migration --- .../2016_08_23_145619_add_show_in_nav_to_status_labels.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php b/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php index c4e1a18177..5ea26bf4c1 100644 --- a/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php +++ b/database/migrations/2016_08_23_145619_add_show_in_nav_to_status_labels.php @@ -25,7 +25,7 @@ class AddShowInNavToStatusLabels extends Migration public function down() { Schema::table('status_labels', function (Blueprint $table) { - $table->dropColumn('show_in_nav', 'field_encrypted'); + $table->dropColumn('show_in_nav'); }); } } From 39ab545cf5b08d3a79d6d4a84d96874db11519ba Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:08:28 -0800 Subject: [PATCH 006/159] Update alter statement to use correct suffix for column This is brittle... --- database/migrations/2015_09_22_003413_migrate_mac_address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2015_09_22_003413_migrate_mac_address.php b/database/migrations/2015_09_22_003413_migrate_mac_address.php index 516b5c2ec7..8167e28adf 100644 --- a/database/migrations/2015_09_22_003413_migrate_mac_address.php +++ b/database/migrations/2015_09_22_003413_migrate_mac_address.php @@ -55,6 +55,6 @@ class MigrateMacAddress extends Migration Schema::table('models', function (Blueprint $table) { $table->renameColumn('deprecated_mac_address', 'show_mac_address'); }); - DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address mac_address varchar(255)'); + DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address_1 mac_address varchar(255)'); } } From 4ee3cbf60e5b6f17ecae9e6fc2025795f26008bd Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:20:20 -0800 Subject: [PATCH 007/159] Comment out migration's down method to match its up method --- ...015_07_29_230054_add_thread_id_to_asset_logs_table.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php index eefc283e3f..f14dc078cc 100644 --- a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php +++ b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php @@ -105,10 +105,10 @@ */ public function down() { - Schema::table('asset_logs', function (Blueprint $table) { - $table->dropIndex('thread_id'); - $table->dropColumn('thread_id'); - }); + // Schema::table('asset_logs', function (Blueprint $table) { + // $table->dropIndex('thread_id'); + // $table->dropColumn('thread_id'); + // }); } /** From c5b09ed95584b01e649c670f9d8b8e2a8778e041 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:21:46 -0800 Subject: [PATCH 008/159] Fix column name typo --- .../migrations/2013_12_10_084038_add_eol_on_models_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2013_12_10_084038_add_eol_on_models_table.php b/database/migrations/2013_12_10_084038_add_eol_on_models_table.php index d8d222deec..97e7b266e6 100755 --- a/database/migrations/2013_12_10_084038_add_eol_on_models_table.php +++ b/database/migrations/2013_12_10_084038_add_eol_on_models_table.php @@ -24,7 +24,7 @@ class AddEolOnModelsTable extends Migration public function down() { Schema::table('models', function ($table) { - $table->dropColumn('old'); + $table->dropColumn('eol'); }); } } From 296c9a723d25ec46190273ec39426d489cbe25c3 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:22:29 -0800 Subject: [PATCH 009/159] Reverse column rename in migration's down method --- .../2013_11_25_104343_alter_warranty_column_on_assets.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php b/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php index be62374dce..d63a6ad9b4 100755 --- a/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php +++ b/database/migrations/2013_11_25_104343_alter_warranty_column_on_assets.php @@ -23,6 +23,8 @@ class AlterWarrantyColumnOnAssets extends Migration */ public function down() { - // + Schema::table('assets', function ($table) { + $table->renameColumn('warranty_months', 'warrantee_months'); + }); } } From 03938d0f32fd6f1b6891d5aa75e83edc7f8eccc1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:24:38 -0800 Subject: [PATCH 010/159] Conditionally drop table --- .../migrations/2013_11_25_013244_recreate_licenses_table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2013_11_25_013244_recreate_licenses_table.php b/database/migrations/2013_11_25_013244_recreate_licenses_table.php index fb18452794..a22349dcd6 100755 --- a/database/migrations/2013_11_25_013244_recreate_licenses_table.php +++ b/database/migrations/2013_11_25_013244_recreate_licenses_table.php @@ -37,7 +37,7 @@ class ReCreateLicensesTable extends Migration */ public function down() { - // - Schema::drop('licenses'); + // This was most likely handled in 2013_11_17_054359_drop_licenses_table.php + Schema::dropIfExists('licenses'); } } From aec64fa64ac2a7b59e953972af55c349de7864d7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:25:25 -0800 Subject: [PATCH 011/159] Comment out migration's down method to match its up method --- .../migrations/2013_11_17_054526_add_physical_to_assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2013_11_17_054526_add_physical_to_assets.php b/database/migrations/2013_11_17_054526_add_physical_to_assets.php index 2ccc7c43dc..28d1117201 100755 --- a/database/migrations/2013_11_17_054526_add_physical_to_assets.php +++ b/database/migrations/2013_11_17_054526_add_physical_to_assets.php @@ -26,6 +26,6 @@ class AddPhysicalToAssets extends Migration */ public function down() { - $table->dropColumn('physical'); + // $table->dropColumn('physical'); } } From b5ea8b8a4fd17bc27ddffb05881a748fec4526b2 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Jan 2023 17:29:38 -0800 Subject: [PATCH 012/159] Conditionally drop table --- ..._12_06_225929_migration_cartalyst_sentry_install_groups.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php index cd45847bc7..49242f2e30 100644 --- a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php +++ b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php @@ -44,6 +44,7 @@ class MigrationCartalystSentryInstallGroups extends Migration */ public function down() { - Schema::drop('permission_groups'); + // See 2014_11_04_231416_update_group_field_for_reporting.php and 2019_06_12_184327_rename_groups_table.php + Schema::dropIfExists('permission_groups'); } } From e8c2b84d24b7fcfbd0bcced9bee09e0e701b5bed Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:51:15 -0800 Subject: [PATCH 013/159] Add example dusk environment file --- .env.dusk.example | 106 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 .env.dusk.example diff --git a/.env.dusk.example b/.env.dusk.example new file mode 100644 index 0000000000..074f6fc3d7 --- /dev/null +++ b/.env.dusk.example @@ -0,0 +1,106 @@ +# -------------------------------------------- +# REQUIRED: BASIC APP SETTINGS +# -------------------------------------------- +APP_ENV=local +APP_DEBUG=false +APP_KEY=base64:hTUIUh9CP6dQx+6EjSlfWTgbaMaaRvlpEwk45vp+xmk= +APP_URL=http://127.0.0.1:8000 +APP_TIMEZONE='US/Eastern' +APP_LOCALE=en +APP_LOCKED=false +MAX_RESULTS=200 + +# -------------------------------------------- +# REQUIRED: UPLOADED FILE STORAGE SETTINGS +# -------------------------------------------- +PRIVATE_FILESYSTEM_DISK=local +PUBLIC_FILESYSTEM_DISK=local_public + +# -------------------------------------------- +# REQUIRED: DATABASE SETTINGS +# -------------------------------------------- +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=null +DB_USERNAME=null +DB_PASSWORD=null +DB_PREFIX=null +#DB_DUMP_PATH= + +# -------------------------------------------- +# OPTIONAL: SSL DATABASE SETTINGS +# -------------------------------------------- +DB_SSL=false +DB_SSL_KEY_PATH=null +DB_SSL_CERT_PATH=null +DB_SSL_CA_PATH=null +DB_SSL_CIPHER=null + +# -------------------------------------------- +# REQUIRED: OUTGOING MAIL SERVER SETTINGS +# -------------------------------------------- +MAIL_DRIVER="log" + + +# -------------------------------------------- +# REQUIRED: IMAGE LIBRARY +# This should be gd or imagick +# -------------------------------------------- +IMAGE_LIB=gd + + +# -------------------------------------------- +# OPTIONAL: SESSION SETTINGS +# -------------------------------------------- +SESSION_LIFETIME=12000 +EXPIRE_ON_CLOSE=false +ENCRYPT=true +COOKIE_NAME=snipeit_v5_local +SECURE_COOKIES=true + +# -------------------------------------------- +# OPTIONAL: SECURITY HEADER SETTINGS +# -------------------------------------------- +REFERRER_POLICY=same-origin +ENABLE_CSP=true +CORS_ALLOWED_ORIGINS="*" + +# -------------------------------------------- +# OPTIONAL: CACHE SETTINGS +# -------------------------------------------- +CACHE_DRIVER=file +SESSION_DRIVER=file +QUEUE_DRIVER=sync + +# -------------------------------------------- +# OPTIONAL: LOGIN THROTTLING +# -------------------------------------------- +LOGIN_MAX_ATTEMPTS=50000 +LOGIN_LOCKOUT_DURATION=1000 +RESET_PASSWORD_LINK_EXPIRES=15 + +# -------------------------------------------- +# OPTIONAL: API +# -------------------------------------------- +API_MAX_REQUESTS_PER_HOUR=200 + +# -------------------------------------------- +# OPTIONAL: SAML SETTINGS +# -------------------------------------------- +DISABLE_NOSAML_LOCAL_LOGIN=true + + +# -------------------------------------------- +# OPTIONAL: MISC +# -------------------------------------------- +LOG_CHANNEL=single +LOG_LEVEL=debug +LOG_CHANNEL=stack +LOG_SLACK_WEBHOOK_URL=null +APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1 +ALLOW_IFRAMING=true +ENABLE_HSTS=false +WARN_DEBUG=false +APP_CIPHER=AES-256-CBC + From 9a3a796e176ad593619d8633b73db77fe1d81ed7 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:57:05 -0800 Subject: [PATCH 014/159] Add dusk environment files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 37e9d3f68c..cc67e5c40d 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .couscous .DS_Store .env +.env.dusk.* .idea /bin/ /bootstrap/compiled.php From 49383ddbe0fd3c6a37a5a22a7cfeaa67c0c49926 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 12:58:57 -0800 Subject: [PATCH 015/159] Delete old dusk local configuration --- .env.dusk.local | 106 ------------------------------------------------ 1 file changed, 106 deletions(-) delete mode 100644 .env.dusk.local diff --git a/.env.dusk.local b/.env.dusk.local deleted file mode 100644 index 33343ffc51..0000000000 --- a/.env.dusk.local +++ /dev/null @@ -1,106 +0,0 @@ -# -------------------------------------------- -# REQUIRED: BASIC APP SETTINGS -# -------------------------------------------- -APP_ENV=local -APP_DEBUG=false -APP_KEY=base64:hTUIUh9CP6dQx+6EjSlfWTgbaMaaRvlpEwk45vp+xmk= -APP_URL=http://127.0.0.1:8000 -APP_TIMEZONE='US/Eastern' -APP_LOCALE=en -APP_LOCKED=false -MAX_RESULTS=200 - -# -------------------------------------------- -# REQUIRED: UPLOADED FILE STORAGE SETTINGS -# -------------------------------------------- -PRIVATE_FILESYSTEM_DISK=local -PUBLIC_FILESYSTEM_DISK=local_public - -# -------------------------------------------- -# REQUIRED: DATABASE SETTINGS -# -------------------------------------------- -DB_CONNECTION=mysql -DB_HOST=localhost -DB_PORT=3306 -DB_DATABASE=snipeit-local -DB_USERNAME=snipeit-local -DB_PASSWORD=snipeit-local -DB_PREFIX=null -DB_DUMP_PATH='/Applications/MAMP/Library/bin' - -# -------------------------------------------- -# OPTIONAL: SSL DATABASE SETTINGS -# -------------------------------------------- -DB_SSL=false -DB_SSL_KEY_PATH=null -DB_SSL_CERT_PATH=null -DB_SSL_CA_PATH=null -DB_SSL_CIPHER=null - -# -------------------------------------------- -# REQUIRED: OUTGOING MAIL SERVER SETTINGS -# -------------------------------------------- -MAIL_DRIVER="log" - - -# -------------------------------------------- -# REQUIRED: IMAGE LIBRARY -# This should be gd or imagick -# -------------------------------------------- -IMAGE_LIB=gd - - -# -------------------------------------------- -# OPTIONAL: SESSION SETTINGS -# -------------------------------------------- -SESSION_LIFETIME=12000 -EXPIRE_ON_CLOSE=false -ENCRYPT=true -COOKIE_NAME=snipeit_v5_local -SECURE_COOKIES=true - -# -------------------------------------------- -# OPTIONAL: SECURITY HEADER SETTINGS -# -------------------------------------------- -REFERRER_POLICY=same-origin -ENABLE_CSP=true -CORS_ALLOWED_ORIGINS="*" - -# -------------------------------------------- -# OPTIONAL: CACHE SETTINGS -# -------------------------------------------- -CACHE_DRIVER=file -SESSION_DRIVER=file -QUEUE_DRIVER=sync - -# -------------------------------------------- -# OPTIONAL: LOGIN THROTTLING -# -------------------------------------------- -LOGIN_MAX_ATTEMPTS=50000 -LOGIN_LOCKOUT_DURATION=1000 -RESET_PASSWORD_LINK_EXPIRES=15 - -# -------------------------------------------- -# OPTIONAL: API -# -------------------------------------------- -API_MAX_REQUESTS_PER_HOUR=200 - -# -------------------------------------------- -# OPTIONAL: SAML SETTINGS -# -------------------------------------------- -DISABLE_NOSAML_LOCAL_LOGIN=true - - -# -------------------------------------------- -# OPTIONAL: MISC -# -------------------------------------------- -LOG_CHANNEL=single -LOG_LEVEL=debug -LOG_CHANNEL=stack -LOG_SLACK_WEBHOOK_URL=null -APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1 -ALLOW_IFRAMING=true -ENABLE_HSTS=false -WARN_DEBUG=false -APP_CIPHER=AES-256-CBC - From bc80f672ee1f88e8d4bc66facee410f439bcdedd Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:00:34 -0800 Subject: [PATCH 016/159] Keep the example dusk environment file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cc67e5c40d..078a7e4b8a 100755 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .DS_Store .env .env.dusk.* +!.env.dusk.example .idea /bin/ /bootstrap/compiled.php From 49f2573f36602370666808494d9d738cd96ee436 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:51:01 -0800 Subject: [PATCH 017/159] Update testing readme --- TESTING.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/TESTING.md b/TESTING.md index 6624289758..f7034895a3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -43,23 +43,25 @@ you want to run. ## Browser Tests -The browser tests use [Dusk](https://laravel.com/docs/8.x/dusk) to run them. -When troubleshooting any problems, make sure that your `.env` file is configured -correctly to run the existing application. +Browser tests are run via [Laravel Dusk](https://laravel.com/docs/8.x/dusk) and require Google Chrome to be installed. + +Before attempting to run Dusk tests copy the example environment file for Dusk and update the values to match your environment: + +`cp .env.dusk.example .env.dusk.local` +> `local` refers to the value of `APP_ENV` in your `.env` so if you have it set to `dev` then the file should be named `.env.dusk.dev`. ### Test Setup -Your application needs to be configued and up and running in order for the browser +Your application needs to be configured and up and running in order for the browser tests to actually run. When running the tests locally, you can start the application using the following command: `php artisan serve` - -To run the test suite use the following command from another terminal tab or window: +Now you are ready to run the test suite. Use the following command from another terminal tab or window: `php artisan dusk` -To run individual test files, you can pass the path to the test that you want to run. +To run individual test files, you can pass the path to the test that you want to run: `php artisan dusk tests/Browser/LoginTest.php` From 0dd7cc9967941a821fe9d45864ab0c6844c8be4d Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 13:54:28 -0800 Subject: [PATCH 018/159] Add note about installing ChromeDriver to testing readme --- TESTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TESTING.md b/TESTING.md index f7034895a3..a1706177a9 100644 --- a/TESTING.md +++ b/TESTING.md @@ -65,3 +65,9 @@ Now you are ready to run the test suite. Use the following command from another To run individual test files, you can pass the path to the test that you want to run: `php artisan dusk tests/Browser/LoginTest.php` + +If you get an error when attempting to run Dusk tests that says `Couldn't connect to server` run: + +`php artisan dusk:chrome-driver --detect` + +This command will install the specific ChromeDriver Dusk needs for your operating system and Chrome version. From 51da747809ff039d5d294f493f13cd726cd4fbc3 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 11 Jan 2023 18:05:07 -0800 Subject: [PATCH 019/159] Add note about database requirements when running Dusk tests --- TESTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TESTING.md b/TESTING.md index a1706177a9..8a430d498e 100644 --- a/TESTING.md +++ b/TESTING.md @@ -50,6 +50,8 @@ Before attempting to run Dusk tests copy the example environment file for Dusk a `cp .env.dusk.example .env.dusk.local` > `local` refers to the value of `APP_ENV` in your `.env` so if you have it set to `dev` then the file should be named `.env.dusk.dev`. +**Important**: Dusk tests cannot be run using an in-memory SQLite database. Additionally, the Dusk test suite uses the `DatabaseMigrations` trait which will leave the database in a fresh state after running. Therefore, it is recommended that you create a test database and point `DB_DATABASE` in `.env.dusk.local` to it. + ### Test Setup Your application needs to be configured and up and running in order for the browser From fd73bee8505b766d102cb2003ae6bb6e0437dc92 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:38:05 -0800 Subject: [PATCH 020/159] Fixed hardcoded string and added new checkout count to accessory view Signed-off-by: snipe --- resources/views/accessories/view.blade.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/views/accessories/view.blade.php b/resources/views/accessories/view.blade.php index 82d7c8201a..59ff1b9c80 100644 --- a/resources/views/accessories/view.blade.php +++ b/resources/views/accessories/view.blade.php @@ -327,13 +327,22 @@
- Number remaining + {{ trans('admin/accessories/general.remaining') }}
{{ $accessory->numRemaining() }}
+
+
+ {{ trans('general.checked_out') }} +
+
+ {{ $accessory->users_count }} +
+
+ @can('checkout', \App\Models\Accessory::class) From 56090bc64534f73d9e2cab10ff4f70e4d97d65ef Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:38:35 -0800 Subject: [PATCH 021/159] Re-ordered notes to be more consistent, fixed missing iCheck class Signed-off-by: snipe --- resources/views/accessories/edit.blade.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php index d6233d4e5a..c16e57cb22 100755 --- a/resources/views/accessories/edit.blade.php +++ b/resources/views/accessories/edit.blade.php @@ -21,22 +21,24 @@ @include ('partials.forms.edit.purchase_cost') @include ('partials.forms.edit.quantity') @include ('partials.forms.edit.minimum_quantity') - +@include ('partials.forms.edit.notes') @if ($item->image)
- {{ Form::checkbox('image_delete') }} - - {!! $errors->first('image_delete', '') !!} + +
+ +
@endif -@include ('partials.forms.edit.notes') - @include ('partials.forms.edit.image-upload') @stop From 46e3e8a3dd9b80e1c33b0a3af951ec547f8b638c Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:39:53 -0800 Subject: [PATCH 022/159] Added new users_count field to API Signed-off-by: snipe --- app/Presenters/AccessoryPresenter.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Presenters/AccessoryPresenter.php b/app/Presenters/AccessoryPresenter.php index 7d77acc8d7..cc4f9badfc 100644 --- a/app/Presenters/AccessoryPresenter.php +++ b/app/Presenters/AccessoryPresenter.php @@ -80,19 +80,25 @@ class AccessoryPresenter extends Presenter ], [ 'field' => 'qty', 'searchable' => false, - 'sortable' => false, - 'title' => trans('admin/accessories/general.total'), - ], [ - 'field' => 'min_qty', - 'searchable' => false, 'sortable' => true, - 'title' => trans('general.min_amt'), + 'title' => trans('admin/accessories/general.total'), ], [ 'field' => 'remaining_qty', 'searchable' => false, 'sortable' => false, 'visible' => false, 'title' => trans('admin/accessories/general.remaining'), + ],[ + 'field' => 'users_count', + 'searchable' => false, + 'sortable' => true, + 'visible' => true, + 'title' => trans('general.checked_out'), + ], [ + 'field' => 'min_qty', + 'searchable' => false, + 'sortable' => true, + 'title' => trans('general.min_amt'), ], [ 'field' => 'purchase_date', 'searchable' => true, From dceb77d4d4a70df6a1ab0b4a70b1bf0ad500e64a Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:40:20 -0800 Subject: [PATCH 023/159] Refactored numRemaining, removed unnecessary numCheckout Signed-off-by: snipe --- app/Models/Accessory.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index 3f2004b047..d39d653382 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -327,20 +327,6 @@ class Accessory extends SnipeModel return null; } - /** - * Check how many items within an accessory are checked out - * - * @author [A. Gianotto] [] - * @since [v5.0] - * @return int - */ - public function numCheckedOut() - { - $checkedout = 0; - $checkedout = $this->users->count(); - - return $checkedout; - } /** * Check how many items of an accessory remain @@ -351,11 +337,11 @@ class Accessory extends SnipeModel */ public function numRemaining() { - $checkedout = $this->users->count(); + $checkedout = $this->users_count; $total = $this->qty; $remaining = $total - $checkedout; - return $remaining; + return (int) $remaining; } /** From 90c16318201b45fa233e07ca19f0e4f8a38c7c54 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:40:35 -0800 Subject: [PATCH 024/159] Added users_count to transformer for API Signed-off-by: snipe --- app/Http/Transformers/AccessoriesTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Transformers/AccessoriesTransformer.php b/app/Http/Transformers/AccessoriesTransformer.php index 6f254b3b87..00c30f9ea2 100644 --- a/app/Http/Transformers/AccessoriesTransformer.php +++ b/app/Http/Transformers/AccessoriesTransformer.php @@ -38,7 +38,8 @@ class AccessoriesTransformer 'purchase_cost' => Helper::formatCurrencyOutput($accessory->purchase_cost), 'order_number' => ($accessory->order_number) ? e($accessory->order_number) : null, 'min_qty' => ($accessory->min_amt) ? (int) $accessory->min_amt : null, - 'remaining_qty' => $accessory->numRemaining(), + 'remaining_qty' => (int) $accessory->numRemaining(), + 'users_count' => $accessory->users_count, 'created_at' => Helper::getFormattedDateObject($accessory->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($accessory->updated_at, 'datetime'), From 60eab08735187044240c3f180867411c9b772813 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:41:07 -0800 Subject: [PATCH 025/159] =?UTF-8?q?Added=20`->with(=E2=80=98users=20as=20u?= =?UTF-8?q?sers=5Fcount=E2=80=99)`=20in=20Accessory=20query?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- .../Accessories/AccessoriesController.php | 74 +++++++++---------- .../Controllers/Api/AccessoriesController.php | 5 +- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesController.php b/app/Http/Controllers/Accessories/AccessoriesController.php index d1af79adf1..96f83d7665 100755 --- a/app/Http/Controllers/Accessories/AccessoriesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesController.php @@ -127,45 +127,45 @@ class AccessoriesController extends Controller */ public function update(ImageUploadRequest $request, $accessoryId = null) { - if (is_null($accessory = Accessory::find($accessoryId))) { + if ($accessory = Accessory::withCount('users as users_count')->find($accessoryId)) { + + $validator = Validator::make($request->all(), [ + "qty" => "required|numeric|min:$accessory->users_count" + ]); + + if ($validator->fails()) { + return redirect()->back() + ->withErrors($validator) + ->withInput(); + } + + $this->authorize($accessory); + + // Update the accessory data + $accessory->name = request('name'); + $accessory->location_id = request('location_id'); + $accessory->min_amt = request('min_amt'); + $accessory->category_id = request('category_id'); + $accessory->company_id = Company::getIdForCurrentUser(request('company_id')); + $accessory->manufacturer_id = request('manufacturer_id'); + $accessory->order_number = request('order_number'); + $accessory->model_number = request('model_number'); + $accessory->purchase_date = request('purchase_date'); + $accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost')); + $accessory->qty = request('qty'); + $accessory->supplier_id = request('supplier_id'); + $accessory->notes = request('notes'); + + $accessory = $request->handleImages($accessory); + + // Was the accessory updated? + if ($accessory->save()) { + return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success')); + } + } else { return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist')); } - $min = $accessory->numCheckedOut(); - $validator = Validator::make($request->all(), [ - "qty" => "required|numeric|min:$min" - ]); - - if ($validator->fails()) { - return redirect()->back() - ->withErrors($validator) - ->withInput(); - } - - $this->authorize($accessory); - - // Update the accessory data - $accessory->name = request('name'); - $accessory->location_id = request('location_id'); - $accessory->min_amt = request('min_amt'); - $accessory->category_id = request('category_id'); - $accessory->company_id = Company::getIdForCurrentUser(request('company_id')); - $accessory->manufacturer_id = request('manufacturer_id'); - $accessory->order_number = request('order_number'); - $accessory->model_number = request('model_number'); - $accessory->purchase_date = request('purchase_date'); - $accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost')); - $accessory->qty = request('qty'); - $accessory->supplier_id = request('supplier_id'); - $accessory->notes = request('notes'); - - $accessory = $request->handleImages($accessory); - - // Was the accessory updated? - if ($accessory->save()) { - return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success')); - } - return redirect()->back()->withInput()->withErrors($accessory->getErrors()); } @@ -217,7 +217,7 @@ class AccessoriesController extends Controller */ public function show($accessoryID = null) { - $accessory = Accessory::find($accessoryID); + $accessory = Accessory::withCount('users as users_count')->find($accessoryID); $this->authorize('view', $accessory); if (isset($accessory->id)) { return view('accessories/view', compact('accessory')); diff --git a/app/Http/Controllers/Api/AccessoriesController.php b/app/Http/Controllers/Api/AccessoriesController.php index a894dc3760..fd21ebaf3a 100644 --- a/app/Http/Controllers/Api/AccessoriesController.php +++ b/app/Http/Controllers/Api/AccessoriesController.php @@ -41,10 +41,13 @@ class AccessoriesController extends Controller 'min_amt', 'company_id', 'notes', + 'users_count', + 'qty', ]; - $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier'); + $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier') + ->withCount('users as users_count'); if ($request->filled('search')) { $accessories = $accessories->TextSearch($request->input('search')); From 2bdf3d3f44cc460c26f68949891ea16c5f0025c8 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:44:10 -0800 Subject: [PATCH 026/159] Missed a few strong HTML tags Signed-off-by: snipe --- resources/views/accessories/view.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/accessories/view.blade.php b/resources/views/accessories/view.blade.php index 59ff1b9c80..fd31722204 100644 --- a/resources/views/accessories/view.blade.php +++ b/resources/views/accessories/view.blade.php @@ -290,7 +290,7 @@ @if ($accessory->company)
- {{ trans('general.company')}} + {{ trans('general.company')}}
{{ $accessory->company->name }} @@ -302,7 +302,7 @@ @if ($accessory->category)
- {{ trans('general.category')}} + {{ trans('general.category')}}
{{ $accessory->category->name }} From e6dc61d2cffe712f9f0a77b78eed83f84ed7f5f1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 23 Jan 2023 15:42:05 -0800 Subject: [PATCH 027/159] Revert column names to legacy versions in down method --- ...357_fix_utf8_custom_field_column_names.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php b/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php index 72e85698e0..4725cccfe1 100644 --- a/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php +++ b/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php @@ -4,6 +4,7 @@ use App\Models\CustomField; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Str; /** * Fixes issue #2551 where columns got donked if the field name in non-ascii @@ -71,6 +72,25 @@ class FixUtf8CustomFieldColumnNames extends Migration */ public function down() { + // In the up method above, updateLegacyColumnName is called and custom fields in the assets table are prefixed + // with "_snipe_it_", suffixed with "_{id of the CustomField}", and stored in custom_fields.db_column. + // The following reverses those changes. + foreach (CustomField::all() as $field) { + $currentColumnName = $field->db_column; + + // "_snipeit_imei_1" becomes "_snipeit_imei" + $legacyColumnName = (string) Str::of($currentColumnName)->replaceMatches('/_(\d)+$/', ''); + + if (Schema::hasColumn(CustomField::$table_name, $currentColumnName)) { + Schema::table(CustomField::$table_name, function (Blueprint $table) use ($currentColumnName, $legacyColumnName) { + $table->renameColumn( + $currentColumnName, + $legacyColumnName + ); + }); + } + } + Schema::table('custom_fields', function ($table) { $table->dropColumn('db_column'); $table->dropColumn('help_text'); From 760844de6fb252bd7f979d8eaa6fa3a92283caf2 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 23 Jan 2023 15:42:33 -0800 Subject: [PATCH 028/159] Add conditionals --- .../2015_09_22_003413_migrate_mac_address.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/database/migrations/2015_09_22_003413_migrate_mac_address.php b/database/migrations/2015_09_22_003413_migrate_mac_address.php index 8167e28adf..3c4bf93e15 100644 --- a/database/migrations/2015_09_22_003413_migrate_mac_address.php +++ b/database/migrations/2015_09_22_003413_migrate_mac_address.php @@ -48,13 +48,19 @@ class MigrateMacAddress extends Migration */ public function down() { - // $f = \App\Models\CustomFieldset::where(['name' => 'Asset with MAC Address'])->first(); - $f->fields()->delete(); - $f->delete(); + + if ($f) { + $f->fields()->delete(); + $f->delete(); + } + Schema::table('models', function (Blueprint $table) { $table->renameColumn('deprecated_mac_address', 'show_mac_address'); }); - DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address_1 mac_address varchar(255)'); + + if (Schema::hasColumn('assets', '_snipeit_mac_address')) { + DB::statement('ALTER TABLE assets CHANGE _snipeit_mac_address mac_address varchar(255)'); + } } } From cd582be851b6dff9d1c3135ff3c0a7d79519ecae Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 23 Jan 2023 15:42:45 -0800 Subject: [PATCH 029/159] Drop tables that may exist in down methods --- ...2_12_06_225929_migration_cartalyst_sentry_install_groups.php | 1 + .../migrations/2013_11_25_031458_create_license_seats_table.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php index 49242f2e30..55d7318736 100644 --- a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php +++ b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php @@ -46,5 +46,6 @@ class MigrationCartalystSentryInstallGroups extends Migration { // See 2014_11_04_231416_update_group_field_for_reporting.php and 2019_06_12_184327_rename_groups_table.php Schema::dropIfExists('permission_groups'); + Schema::dropIfExists('groups'); } } diff --git a/database/migrations/2013_11_25_031458_create_license_seats_table.php b/database/migrations/2013_11_25_031458_create_license_seats_table.php index 466ef00870..d023b8ebec 100755 --- a/database/migrations/2013_11_25_031458_create_license_seats_table.php +++ b/database/migrations/2013_11_25_031458_create_license_seats_table.php @@ -31,6 +31,6 @@ class CreateLicenseSeatsTable extends Migration */ public function down() { - // + Schema::dropIfExists('license_seats'); } } From dc155846ca11d404aed416bf7bc0bc64f2252b1b Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 23 Jan 2023 21:49:17 -0800 Subject: [PATCH 030/159] =?UTF-8?q?Hoist=20the=20autorization=20higher=20i?= =?UTF-8?q?n=20the=20stack=20so=20we=E2=80=99re=20not=20doing=20logic=20or?= =?UTF-8?q?=20math=20when=20the=20user=20isn=E2=80=99t=20authorized=20to?= =?UTF-8?q?=20touch=20this?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Http/Controllers/Accessories/AccessoriesController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesController.php b/app/Http/Controllers/Accessories/AccessoriesController.php index 96f83d7665..f0b54a9498 100755 --- a/app/Http/Controllers/Accessories/AccessoriesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesController.php @@ -63,6 +63,7 @@ class AccessoriesController extends Controller public function store(ImageUploadRequest $request) { $this->authorize(Accessory::class); + // create a new model instance $accessory = new Accessory(); @@ -82,7 +83,6 @@ class AccessoriesController extends Controller $accessory->supplier_id = request('supplier_id'); $accessory->notes = request('notes'); - $accessory = $request->handleImages($accessory); // Was the accessory created? @@ -129,6 +129,8 @@ class AccessoriesController extends Controller { if ($accessory = Accessory::withCount('users as users_count')->find($accessoryId)) { + $this->authorize($accessory); + $validator = Validator::make($request->all(), [ "qty" => "required|numeric|min:$accessory->users_count" ]); @@ -139,7 +141,7 @@ class AccessoriesController extends Controller ->withInput(); } - $this->authorize($accessory); + // Update the accessory data $accessory->name = request('name'); From 0f8ee220534b89fe5ef3b7a8f652ce306d3c0752 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 24 Jan 2023 09:25:05 -0800 Subject: [PATCH 031/159] Creates Slack Setting Form --- app/Http/Livewire/SlackSettingsForm.php | 21 +++++++++++++++++++ .../livewire/slack-settings-form.blade.php | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 app/Http/Livewire/SlackSettingsForm.php create mode 100644 resources/views/livewire/slack-settings-form.blade.php diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php new file mode 100644 index 0000000000..c796ee53cc --- /dev/null +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -0,0 +1,21 @@ + + {{-- In work, do what you enjoy. --}} +
From cafe8f3074276c33aba4cf7537c008de14f12351 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 16:20:20 -0500 Subject: [PATCH 032/159] notification for slack message --- resources/views/consumables/checkout.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/consumables/checkout.blade.php b/resources/views/consumables/checkout.blade.php index f768f78484..85cec320e2 100644 --- a/resources/views/consumables/checkout.blade.php +++ b/resources/views/consumables/checkout.blade.php @@ -60,7 +60,7 @@ @if ($snipeSettings->slack_endpoint!='') - A slack message will be sent + {{ trans('general.slack_msg_note') }} @endif
From 3c4f254583d8454a70c50f95538b7f61f4c7ba10 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Jan 2023 13:38:53 -0800 Subject: [PATCH 033/159] Enforce Y-m-d as date format for date fields Signed-off-by: snipe --- app/Models/Accessory.php | 1 + app/Models/Asset.php | 9 +++++---- app/Models/Component.php | 2 +- app/Models/Consumable.php | 1 + app/Models/License.php | 3 +++ app/Models/User.php | 4 ++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index 3f2004b047..9569917ab3 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -63,6 +63,7 @@ class Accessory extends SnipeModel 'company_id' => 'integer|nullable', 'min_amt' => 'integer|min:0|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', + 'purchase_date' => 'date_format:Y-m-d|nullable', ]; diff --git a/app/Models/Asset.php b/app/Models/Asset.php index f8e0cab314..75e1f38e45 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -105,16 +105,17 @@ class Asset extends Depreciable 'company_id' => 'integer|nullable', 'warranty_months' => 'numeric|nullable|digits_between:0,240', 'physical' => 'numeric|max:1|nullable', - 'checkout_date' => 'date|max:10|min:10|nullable', - 'checkin_date' => 'date|max:10|min:10|nullable', + 'checkout_date' => 'date_format:Y-m-d|max:10|min:10|nullable', + 'checkin_date' => 'date_format:Y-m-d|max:10|min:10|nullable', 'location_id' => 'exists:locations,id|nullable', 'rtd_location_id' => 'exists:locations,id|nullable', 'asset_tag' => 'required|min:1|max:255|unique_undeleted', 'status' => 'integer', + 'purchase_date' => 'date_format:Y-m-d|nullable', 'serial' => 'unique_serial|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', - 'next_audit_date' => 'date|nullable', - 'last_audit_date' => 'date|nullable', + 'next_audit_date' => 'date_format:Y-m-d|nullable', + 'last_audit_date' => 'date_format:Y-m-d|nullable', 'supplier_id' => 'exists:suppliers,id|nullable', ]; diff --git a/app/Models/Component.php b/app/Models/Component.php index dc353d288c..98230132be 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -35,7 +35,7 @@ class Component extends SnipeModel 'category_id' => 'required|integer|exists:categories,id', 'company_id' => 'integer|nullable', 'min_amt' => 'integer|min:0|nullable', - 'purchase_date' => 'date|nullable', + 'purchase_date' => 'date_format:Y-m-d|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', ]; diff --git a/app/Models/Consumable.php b/app/Models/Consumable.php index c04c9b53d5..ea4ac6086b 100644 --- a/app/Models/Consumable.php +++ b/app/Models/Consumable.php @@ -41,6 +41,7 @@ class Consumable extends SnipeModel 'company_id' => 'integer|nullable', 'min_amt' => 'integer|min:0|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', + 'purchase_date' => 'date_format:Y-m-d|nullable', ]; /** diff --git a/app/Models/License.php b/app/Models/License.php index b59387a42e..d3c4d8a1c3 100755 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -50,6 +50,9 @@ class License extends Depreciable 'category_id' => 'required|exists:categories,id', 'company_id' => 'integer|nullable', 'purchase_cost'=> 'numeric|nullable|gte:0', + 'purchase_date' => 'date_format:Y-m-d|nullable', + 'expiration_date' => 'date_format:Y-m-d|nullable', + 'termination_date' => 'date_format:Y-m-d|nullable', ]; /** diff --git a/app/Models/User.php b/app/Models/User.php index 34c0af6b2e..4d430af741 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -98,8 +98,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'website' => 'url|nullable|max:191', 'manager_id' => 'nullable|exists:users,id|cant_manage_self', 'location_id' => 'exists:locations,id|nullable', - 'start_date' => 'nullable|date', - 'end_date' => 'nullable|date|after_or_equal:start_date', + 'start_date' => 'nullable|date_format:Y-m-d', + 'end_date' => 'nullable|date_format:Y-m-d|after_or_equal:start_date', ]; /** From 3ba79600fb6e163c9afec105a345cfabeef07c56 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 18:17:49 -0500 Subject: [PATCH 034/159] checkin limit for the components checkin --- resources/lang/en/admin/components/general.php | 1 + resources/views/components/checkin.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/en/admin/components/general.php b/resources/lang/en/admin/components/general.php index f7689a7ad1..5d93036054 100644 --- a/resources/lang/en/admin/components/general.php +++ b/resources/lang/en/admin/components/general.php @@ -12,4 +12,5 @@ return array( 'remaining' => 'Remaining', 'total' => 'Total', 'update' => 'Update Component', + 'checkin_limit' => 'Amount checked in must be equal to or less than this amount' ); diff --git a/resources/views/components/checkin.blade.php b/resources/views/components/checkin.blade.php index 8dca260443..55822fb9cf 100644 --- a/resources/views/components/checkin.blade.php +++ b/resources/views/components/checkin.blade.php @@ -42,7 +42,7 @@
-

Must be {{ $component_assets->assigned_qty }} or less.

+

{{ trans(admin/components/general.checkin_limit) }}: {{ $component_assets->assigned_qty }}

{!! $errors->first('checkin_qty', '') !!}
From 91394f72624a501fde291c5631044e4bbb4fa261 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Jan 2023 17:23:06 -0800 Subject: [PATCH 035/159] Removed duplicate comment section Signed-off-by: snipe --- resources/lang/en/validation.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 04f8d65303..18387310f8 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -103,17 +103,6 @@ return [ ], - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - /* |-------------------------------------------------------------------------- | Custom Validation Language Lines From a61ccbb9658da024185575fe017fe81b86b64776 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Jan 2023 17:33:49 -0800 Subject: [PATCH 036/159] Added very clunky but better error messages on that validation for date_format Signed-off-by: snipe --- resources/lang/en/validation.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 18387310f8..31c9dcd85d 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -120,6 +120,18 @@ return [ 'hashed_pass' => 'Your current password is incorrect', 'dumbpwd' => 'That password is too common.', 'statuslabel_type' => 'You must select a valid status label type', + + // date_format validation with slightly less stupid messages. It duplicates a lot, but it gets the job done :( + // We use this because the default error message for date_format is reflects php Y-m-d, which non-PHP + // people won't know how to format. + 'purchase_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + 'last_audit_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD hh:mm:ss format', + 'expiration_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + 'termination_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + 'expected_checkin.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + 'start_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + 'end_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format', + ], /* From fd2a057d384d9a57b6717fd92020e2f44c4f460f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Jan 2023 17:36:58 -0800 Subject: [PATCH 037/159] Make audit dates fillable Signed-off-by: snipe --- app/Models/Asset.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 75e1f38e45..e3e2e96b0c 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -146,6 +146,9 @@ class Asset extends Depreciable 'last_checkout', 'expected_checkin', 'byod', + 'last_audit_date', + 'next_audit_date', + ]; use Searchable; From 9c79fc19cb6eab3f31d587120b1c9c9534a34dd9 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Jan 2023 17:37:15 -0800 Subject: [PATCH 038/159] =?UTF-8?q?Tightened=20up=20and=20removed=20some?= =?UTF-8?q?=20validation=20that=20wasn=E2=80=99t=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Models/Asset.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index e3e2e96b0c..3c1bc9beca 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -84,11 +84,11 @@ class Asset extends Depreciable protected $casts = [ - 'purchase_date' => 'datetime', + 'purchase_date' => 'date', 'last_checkout' => 'datetime', - 'expected_checkin' => 'datetime', + 'expected_checkin' => 'date', 'last_audit_date' => 'datetime', - 'next_audit_date' => 'datetime', + 'next_audit_date' => 'date', 'model_id' => 'integer', 'status_id' => 'integer', 'company_id' => 'integer', @@ -105,17 +105,14 @@ class Asset extends Depreciable 'company_id' => 'integer|nullable', 'warranty_months' => 'numeric|nullable|digits_between:0,240', 'physical' => 'numeric|max:1|nullable', - 'checkout_date' => 'date_format:Y-m-d|max:10|min:10|nullable', - 'checkin_date' => 'date_format:Y-m-d|max:10|min:10|nullable', + 'last_checkout' => 'date|date_format:Y-m-d H:i:s|nullable', + 'expected_checkin' => 'date|date_format:Y-m-d|nullable', 'location_id' => 'exists:locations,id|nullable', 'rtd_location_id' => 'exists:locations,id|nullable', 'asset_tag' => 'required|min:1|max:255|unique_undeleted', - 'status' => 'integer', - 'purchase_date' => 'date_format:Y-m-d|nullable', + 'purchase_date' => 'date|date_format:Y-m-d|nullable', 'serial' => 'unique_serial|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', - 'next_audit_date' => 'date_format:Y-m-d|nullable', - 'last_audit_date' => 'date_format:Y-m-d|nullable', 'supplier_id' => 'exists:suppliers,id|nullable', ]; From 2e22eeade548c18228a9852e63a0472051bad29e Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Jan 2023 14:29:20 -0800 Subject: [PATCH 039/159] adds one input --- app/Http/Livewire/SlackSettingsForm.php | 5 +++++ .../livewire/slack-settings-form.blade.php | 19 ++++++++++++++++++- resources/views/settings/slack.blade.php | 17 +---------------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index c796ee53cc..0193aa7daf 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -11,6 +11,11 @@ class SlackSettingsForm extends Component { public Setting $setting; + protected $rules = [ + 'setting.slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', + 'setting.slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', + 'setting.slack_botname' => 'string|nullable', + ]; public function render() diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index cdda2ce1ff..4846aa95fb 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,3 +1,20 @@
- {{-- In work, do what you enjoy. --}} +
+
+
+ {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} +
+
+ @if (config('app.lock_passwords')===true) + {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} +

{{ trans('general.feature_disabled') }}

+ slack_endpoint)}} > + @else + slack_endpoint)}} > + {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} + @endif + {!! $errors->first('slack_endpoint', '') !!} +
+
+
diff --git a/resources/views/settings/slack.blade.php b/resources/views/settings/slack.blade.php index 705510ab8e..f5f21c5aa9 100644 --- a/resources/views/settings/slack.blade.php +++ b/resources/views/settings/slack.blade.php @@ -50,22 +50,7 @@
- -
-
- {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} -
-
- @if (config('app.lock_passwords')===true) - {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }} -

{{ trans('general.feature_disabled') }}

- - @else - {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }} - @endif - {!! $errors->first('slack_endpoint', '') !!} -
-
+ @livewire('slack-settings-form', ['setting' => $setting])
From 91cf683f3db002299d9237c1411f4969804ed339 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Thu, 10 Nov 2022 17:14:37 +0000 Subject: [PATCH 040/159] Re-do the entire SCIM config so it no longer inherits --- app/Models/SnipeSCIMConfig.php | 328 ++++++++++++++++++++------------- 1 file changed, 195 insertions(+), 133 deletions(-) diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php index 36a9ac855c..ea442bbdda 100644 --- a/app/Models/SnipeSCIMConfig.php +++ b/app/Models/SnipeSCIMConfig.php @@ -12,94 +12,9 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig { public function getUserConfig() { - $config = parent::getUserConfig(); - // Much of this is copied verbatim from the library, then adjusted for our needs - $config['class'] = SCIMUser::class; - unset($config['mapping']['example:name:space']); - - $config['map_unmapped'] = false; // anything we don't explicitly map will _not_ show up. - - $core_namespace = 'urn:ietf:params:scim:schemas:core:2.0:User'; - $core = $core_namespace.':'; - $mappings =& $config['mapping'][$core_namespace]; //grab this entire key, we don't want to be repeating ourselves - - //username - *REQUIRED* - $config['validations'][$core.'userName'] = 'required'; - $mappings['userName'] = AttributeMapping::eloquent('username'); - - //human name - *FIRST NAME REQUIRED* - $config['validations'][$core.'name.givenName'] = 'required'; - $config['validations'][$core.'name.familyName'] = 'string'; //not required - - $mappings['name']['familyName'] = AttributeMapping::eloquent("last_name"); - $mappings['name']['givenName'] = AttributeMapping::eloquent("first_name"); - $mappings['name']['formatted'] = (new AttributeMapping())->ignoreWrite()->setRead( - function (&$object) { - return $object->getFullNameAttribute(); - } - ); - - // externalId support - $config['validations'][$core.'externalId'] = 'string|nullable'; // not required, but supported mostly just for Okta - // note that the mapping is *not* namespaced like the other $mappings - $config['mapping']['externalId'] = AttributeMapping::eloquent('scim_externalid'); - - $config['validations'][$core.'emails'] = 'nullable|array'; // emails are not required in Snipe-IT... - $config['validations'][$core.'emails.*.value'] = 'email'; // ...(had to remove the recommended 'required' here) - - $mappings['emails'] = [[ - "value" => AttributeMapping::eloquent("email"), - "display" => null, - "type" => AttributeMapping::constant("work")->ignoreWrite(), - "primary" => AttributeMapping::constant(true)->ignoreWrite() - ]]; - - //active - $config['validations'][$core.'active'] = 'boolean'; - - $mappings['active'] = AttributeMapping::eloquent('activated'); - - //phone - $config['validations'][$core.'phoneNumbers'] = 'nullable|array'; - $config['validations'][$core.'phoneNumbers.*.value'] = 'string'; // another one where want to say 'we don't _need_ a phone number, but if you have one it better have a value. - - $mappings['phoneNumbers'] = [[ - "value" => AttributeMapping::eloquent("phone"), - "display" => null, - "type" => AttributeMapping::constant("work")->ignoreWrite(), - "primary" => AttributeMapping::constant(true)->ignoreWrite() - ]]; - - //address - $config['validations'][$core.'addresses'] = 'nullable|array'; - $config['validations'][$core.'addresses.*.streetAddress'] = 'string'; - $config['validations'][$core.'addresses.*.locality'] = 'string'; - $config['validations'][$core.'addresses.*.region'] = 'nullable|string'; - $config['validations'][$core.'addresses.*.postalCode'] = 'nullable|string'; - $config['validations'][$core.'addresses.*.country'] = 'string'; - - $mappings['addresses'] = [[ - 'type' => AttributeMapping::constant("work")->ignoreWrite(), - 'formatted' => AttributeMapping::constant("n/a")->ignoreWrite(), // TODO - is this right? This doesn't look right. - 'streetAddress' => AttributeMapping::eloquent("address"), - 'locality' => AttributeMapping::eloquent("city"), - 'region' => AttributeMapping::eloquent("state"), - 'postalCode' => AttributeMapping::eloquent("zip"), - 'country' => AttributeMapping::eloquent("country"), - 'primary' => AttributeMapping::constant(true)->ignoreWrite() //this isn't in the example? - ]]; - - //title - $config['validations'][$core.'title'] = 'string'; - $mappings['title'] = AttributeMapping::eloquent('jobtitle'); - - //Preferred Language - $config['validations'][$core.'preferredLanguage'] = 'string'; - $mappings['preferredLanguage'] = AttributeMapping::eloquent('locale'); - - /* + /* more snipe-it attributes I'd like to check out (to map to 'enterprise' maybe?): - website - notes? @@ -108,66 +23,213 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig - company_id to "organization?" */ - $enterprise_namespace = 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User'; - $ent = $enterprise_namespace.':'; - // we remove the 'example' namespace and add the Enterprise one - $config['mapping']['schemas'] = AttributeMapping::constant( [$core_namespace, $enterprise_namespace] )->ignoreWrite(); + $user_prefix = 'urn:ietf:params:scim:schemas:core:2.0:User:'; + $enterprise_prefix = 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:'; - $config['validations'][$ent.'employeeNumber'] = 'string'; - $config['validations'][$ent.'department'] = 'string'; - $config['validations'][$ent.'manager'] = 'nullable'; - $config['validations'][$ent.'manager.value'] = 'string'; + return [ - $config['mapping'][$enterprise_namespace] = [ - 'employeeNumber' => AttributeMapping::eloquent('employee_num'), - 'department' =>(new AttributeMapping())->setAdd( // FIXME parent? - function ($value, &$object) { - $department = Department::where("name", $value)->first(); - if ($department) { - $object->department_id = $department->id; - } - } - )->setReplace( - function ($value, &$object) { - $department = Department::where("name", $value)->first(); - if ($department) { - $object->department_id = $department->id; + // Set to 'null' to make use of auth.providers.users.model (App\User::class) + 'class' => SCIMUser::class, + + 'validations' => [ + $user_prefix . 'userName' => 'required', + $user_prefix . 'name.givenName' => 'required', + $user_prefix . 'name.familyName' => 'string', + $user_prefix . 'externalId' => 'string|nullable', + $user_prefix . 'emails' => 'nullable|array', + $user_prefix . 'emails.*.value' => 'email', + $user_prefix . 'active' => 'boolean', + $user_prefix . 'phoneNumbers' => 'nullable|array', + $user_prefix . 'phoneNumbers.*.value' => 'string', + $user_prefix . 'addresses' => 'nullable|array', + $user_prefix . 'addresses.*.streetAddress' => 'string', + $user_prefix . 'addresses.*.locality' => 'string', + $user_prefix . 'addresses.*.region' => 'nullable|string', + $user_prefix . 'addresses.*.postalCode' => 'nullable|string', + $user_prefix . 'addresses.*.country' => 'string', + $user_prefix . 'title' => 'string', + $user_prefix . 'preferredLanguage' => 'string', + + // Enterprise validations: + $enterprise_prefix . 'employeeNumber' => 'string', + $enterprise_prefix . 'department' => 'string', + $enterprise_prefix . 'manager' => 'nullable', + $enterprise_prefix . 'manager.value' => 'string' + ], + + 'singular' => 'User', + 'schema' => [Schema::SCHEMA_USER], + + //eager loading + 'withRelations' => [], + 'map_unmapped' => false, +// 'unmapped_namespace' => 'urn:ietf:params:scim:schemas:laravel:unmapped', + 'description' => 'User Account', + + // Map a SCIM attribute to an attribute of the object. + 'mapping' => [ + + 'id' => AttributeMapping::eloquent("id")->disableWrite(), + + 'externalId' => AttributeMapping::eloquent('scim_externalid'), // FIXME - I have a PR that changes a lot of this. + + 'meta' => [ + 'created' => AttributeMapping::eloquent("created_at")->disableWrite(), + 'lastModified' => AttributeMapping::eloquent("updated_at")->disableWrite(), + + 'location' => (new AttributeMapping())->setRead( + function ($object) { + return route( + 'scim.resource', + [ + 'resourceType' => 'Users', + 'resourceObject' => $object->id + ] + ); } - } - )->setRead( - function (&$object) { - return $object->department ? $object->department->name : null; - } - ), - 'manager' => [ - // FIXME - manager writes are disabled. This kinda works but it leaks errors all over the place. Not cool. - // '$ref' => (new AttributeMapping())->ignoreWrite()->ignoreRead(), - // 'displayName' => (new AttributeMapping())->ignoreWrite()->ignoreRead(), - // NOTE: you could probably do a 'plain' Eloquent mapping here, but we don't for future-proofing - 'value' => (new AttributeMapping())->setAdd( - function ($value, &$object) { - $manager = User::find($value); - if ($manager) { - $object->manager_id = $manager->id; + )->disableWrite(), + + 'resourceType' => AttributeMapping::constant("User") + ], + + 'schemas' => AttributeMapping::constant( + [ + 'urn:ietf:params:scim:schemas:core:2.0:User', + 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User' + ] + )->ignoreWrite(), + + 'urn:ietf:params:scim:schemas:core:2.0:User' => [ + + 'userName' => AttributeMapping::eloquent("username"), + + 'name' => [ + 'formatted' => (new AttributeMapping())->ignoreWrite()->setRead( + function (&$object) { + return $object->getFullNameAttribute(); + } + ), + 'familyName' => AttributeMapping::eloquent("last_name"), + 'givenName' => AttributeMapping::eloquent("first_name"), + 'middleName' => null, + 'honorificPrefix' => null, + 'honorificSuffix' => null + ], + + 'displayName' => null, + 'nickName' => null, + 'profileUrl' => null, + 'title' => AttributeMapping::eloquent('jobtitle'), + 'userType' => null, + 'preferredLanguage' => AttributeMapping::eloquent('locale'), // Section 5.3.5 of [RFC7231] + 'locale' => null, // see RFC5646 + 'timezone' => null, // see RFC6557 + 'active' => AttributeMapping::eloquent('activated'), + + 'password' => AttributeMapping::eloquent('password')->disableRead(), + + // Multi-Valued Attributes + 'emails' => [[ + "value" => AttributeMapping::eloquent("email"), + "display" => null, + "type" => AttributeMapping::constant("work")->ignoreWrite(), + "primary" => AttributeMapping::constant(true)->ignoreWrite() + ]], + + 'phoneNumbers' => [[ + "value" => AttributeMapping::eloquent("phone"), + "display" => null, + "type" => AttributeMapping::constant("work")->ignoreWrite(), + "primary" => AttributeMapping::constant(true)->ignoreWrite() + ]], + + 'ims' => [[ + "value" => null, + "display" => null, + "type" => null, + "primary" => null + ]], // Instant messaging addresses for the User + + 'photos' => [[ + "value" => null, + "display" => null, + "type" => null, + "primary" => null + ]], + + 'addresses' => [[ + 'type' => AttributeMapping::constant("work")->ignoreWrite(), + 'formatted' => AttributeMapping::constant("n/a")->ignoreWrite(), // TODO - is this right? This doesn't look right. + 'streetAddress' => AttributeMapping::eloquent("address"), + 'locality' => AttributeMapping::eloquent("city"), + 'region' => AttributeMapping::eloquent("state"), + 'postalCode' => AttributeMapping::eloquent("zip"), + 'country' => AttributeMapping::eloquent("country"), + 'primary' => AttributeMapping::constant(true)->ignoreWrite() //this isn't in the example? + ]], + + 'groups' => [[ + 'value' => null, + '$ref' => null, + 'display' => null, + 'type' => null, + 'type' => null + ]], + + 'entitlements' => null, + 'roles' => null, + 'x509Certificates' => null + ], + + 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User' => [ + 'employeeNumber' => AttributeMapping::eloquent('employee_num'), + 'department' => (new AttributeMapping())->setAdd( // FIXME parent? + function ($value, &$object) { + $department = Department::where("name", $value)->first(); + if ($department) { + $object->department_id = $department->id; + } } - } )->setReplace( function ($value, &$object) { - $manager = User::find($value); - if ($manager) { - $object->manager_id = $manager->id; + $department = Department::where("name", $value)->first(); + if ($department) { + $object->department_id = $department->id; } } )->setRead( function (&$object) { - return $object->manager_id; - } + return $object->department ? $object->department->name : null; + } ), + 'manager' => [ + // FIXME - manager writes are disabled. This kinda works but it leaks errors all over the place. Not cool. + // '$ref' => (new AttributeMapping())->ignoreWrite()->ignoreRead(), + // 'displayName' => (new AttributeMapping())->ignoreWrite()->ignoreRead(), + // NOTE: you could probably do a 'plain' Eloquent mapping here, but we don't for future-proofing + 'value' => (new AttributeMapping())->setAdd( + function ($value, &$object) { + $manager = User::find($value); + if ($manager) { + $object->manager_id = $manager->id; + } + } + )->setReplace( + function ($value, &$object) { + $manager = User::find($value); + if ($manager) { + $object->manager_id = $manager->id; + } + } + )->setRead( + function (&$object) { + return $object->manager_id; + } + ), + ] + ] ] ]; - - return $config; } - } From cfe9c687f980dfab7656fcaffe7675a8bc1c1b9d Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 4 Jan 2023 12:17:08 -0800 Subject: [PATCH 041/159] Mark a bunch of SCIM config as nullable --- app/Models/SnipeSCIMConfig.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php index ea442bbdda..77cbf01c1a 100644 --- a/app/Models/SnipeSCIMConfig.php +++ b/app/Models/SnipeSCIMConfig.php @@ -35,27 +35,27 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig 'validations' => [ $user_prefix . 'userName' => 'required', $user_prefix . 'name.givenName' => 'required', - $user_prefix . 'name.familyName' => 'string', - $user_prefix . 'externalId' => 'string|nullable', + $user_prefix . 'name.familyName' => 'nullable|string', + $user_prefix . 'externalId' => 'nullable|string', $user_prefix . 'emails' => 'nullable|array', - $user_prefix . 'emails.*.value' => 'email', + $user_prefix . 'emails.*.value' => 'nullable|email', $user_prefix . 'active' => 'boolean', $user_prefix . 'phoneNumbers' => 'nullable|array', - $user_prefix . 'phoneNumbers.*.value' => 'string', + $user_prefix . 'phoneNumbers.*.value' => 'nullable|string', $user_prefix . 'addresses' => 'nullable|array', - $user_prefix . 'addresses.*.streetAddress' => 'string', - $user_prefix . 'addresses.*.locality' => 'string', + $user_prefix . 'addresses.*.streetAddress' => 'nullable|string', + $user_prefix . 'addresses.*.locality' => 'nullable|string', $user_prefix . 'addresses.*.region' => 'nullable|string', $user_prefix . 'addresses.*.postalCode' => 'nullable|string', - $user_prefix . 'addresses.*.country' => 'string', - $user_prefix . 'title' => 'string', - $user_prefix . 'preferredLanguage' => 'string', + $user_prefix . 'addresses.*.country' => 'nullable|string', + $user_prefix . 'title' => 'nullable|string', + $user_prefix . 'preferredLanguage' => 'nullable|string', // Enterprise validations: - $enterprise_prefix . 'employeeNumber' => 'string', - $enterprise_prefix . 'department' => 'string', + $enterprise_prefix . 'employeeNumber' => 'nullable|string', + $enterprise_prefix . 'department' => 'nullable|string', $enterprise_prefix . 'manager' => 'nullable', - $enterprise_prefix . 'manager.value' => 'string' + $enterprise_prefix . 'manager.value' => 'nullable|string' ], 'singular' => 'User', From c5d3b3ab8155f485eef6b64af70205be22f75044 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 11 Jan 2023 17:15:52 -0800 Subject: [PATCH 042/159] Change out the SCIM config for a fixed one; update our fork of the SCIM-server --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index bf8cb1f758..d6067c5e27 100644 --- a/composer.lock +++ b/composer.lock @@ -78,12 +78,12 @@ "source": { "type": "git", "url": "https://github.com/grokability/laravel-scim-server.git", - "reference": "2c7ecc450eee59234e059ec2e7724b2d8f3a8369" + "reference": "9e8dd2d3958d3c3c05d0a99fe6475361ad9e9419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grokability/laravel-scim-server/zipball/2c7ecc450eee59234e059ec2e7724b2d8f3a8369", - "reference": "2c7ecc450eee59234e059ec2e7724b2d8f3a8369", + "url": "https://api.github.com/repos/grokability/laravel-scim-server/zipball/9e8dd2d3958d3c3c05d0a99fe6475361ad9e9419", + "reference": "9e8dd2d3958d3c3c05d0a99fe6475361ad9e9419", "shasum": "" }, "require": { @@ -133,7 +133,7 @@ "support": { "source": "https://github.com/grokability/laravel-scim-server/tree/master" }, - "time": "2022-11-22T20:26:54+00:00" + "time": "2023-01-12T00:32:07+00:00" }, { "name": "asm89/stack-cors", From a69cb6204a603edf4d861dffed532f5e8784b62f Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Jan 2023 16:22:34 -0800 Subject: [PATCH 043/159] adds rest of inputs, and corrects Data binding --- app/Http/Livewire/SlackSettingsForm.php | 29 ++++++++++++-- .../livewire/slack-settings-form.blade.php | 40 ++++++++++++++++++- resources/views/settings/slack.blade.php | 34 +--------------- 3 files changed, 65 insertions(+), 38 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 0193aa7daf..42d5a70824 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -4,23 +4,46 @@ namespace App\Http\Livewire; use Livewire\Component; use App\Models\Setting; +use App\Http\Requests\Request; class SlackSettingsForm extends Component { + public $slack_endpoint; + public $slack_channel; + public $slack_botname; + public Setting $setting; protected $rules = [ - 'setting.slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', - 'setting.slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', - 'setting.slack_botname' => 'string|nullable', + 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', + 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', + 'slack_botname' => 'string|nullable', ]; + public function mount(){ + + $this->setting= Setting::getSettings(); + $this->slack_endpoint = $this->setting->slack_endpoint; + $this->slack_channel = $this->setting->slack_channel; + $this->slack_botname = $this->setting->slack_botname; + + } public function render() { return view('livewire.slack-settings-form'); } + public function submit() + { + + $this->validate(); + + $this->setting->slack_endpoint = $this->slack_endpoint; + $this->setting->slack_channel = $this->slack_channel; + $this->setting->slack_botname = $this->slack_botname; + + } } diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index 4846aa95fb..cd7978f08e 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -8,13 +8,49 @@ @if (config('app.lock_passwords')===true) {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}}

{{ trans('general.feature_disabled') }}

- slack_endpoint)}} > + @else - slack_endpoint)}} > + {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} @endif {!! $errors->first('slack_endpoint', '') !!}
+ + +
+
+ {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} +
+
+ @if (config('app.lock_passwords')===true) + +

{{ trans('general.feature_disabled') }}

+ + @else + + @endif + {!! $errors->first('slack_channel', '') !!} +
+
+ + +
+
+ {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} +
+
+ @if (config('app.lock_passwords')===true) + {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }} + + +

{{ trans('general.feature_disabled') }}

+ + @else + + @endif + {!! $errors->first('slack_botname', '') !!} +
+
diff --git a/resources/views/settings/slack.blade.php b/resources/views/settings/slack.blade.php index f5f21c5aa9..6bbd321662 100644 --- a/resources/views/settings/slack.blade.php +++ b/resources/views/settings/slack.blade.php @@ -50,41 +50,9 @@
- @livewire('slack-settings-form', ['setting' => $setting]) + @livewire('slack-settings-form') - -
-
- {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} -
-
- @if (config('app.lock_passwords')===true) - {{ Form::text('slack_channel', old('slack_channel', $setting->slack_channel), array('class' => 'form-control','disabled'=>'disabled','placeholder' => '#IT-Ops')) }} -

{{ trans('general.feature_disabled') }}

- @else - {{ Form::text('slack_channel', old('slack_channel', $setting->slack_channel), array('class' => 'form-control','placeholder' => '#IT-Ops')) }} - @endif - {!! $errors->first('slack_channel', '') !!} -
-
- - -
-
- {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} -
-
- @if (config('app.lock_passwords')===true) - {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }} -

{{ trans('general.feature_disabled') }}

- - @else - {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','placeholder' => 'Snipe-Bot')) }} - @endif - {!! $errors->first('slack_botname', '') !!} -
-
- +
diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php index 2b3cdbc19e..bdb03d3147 100755 --- a/resources/views/hardware/checkout.blade.php +++ b/resources/views/hardware/checkout.blade.php @@ -36,8 +36,8 @@ @else - This asset's model is invalid! - The asset should be edited to correct this before attempting to check it in or out. + {{ trans('admin/hardware/general.model_invalid')}} + {{ trans(admin/hardware/general.model_invalid_fix')}} @endif

diff --git a/resources/views/hardware/quickscan-checkin.blade.php b/resources/views/hardware/quickscan-checkin.blade.php index b2075c51d0..8884821809 100644 --- a/resources/views/hardware/quickscan-checkin.blade.php +++ b/resources/views/hardware/quickscan-checkin.blade.php @@ -73,7 +73,7 @@
@@ -88,129 +80,129 @@ @stop -@push('js') - +{{-- --}} -@endpush +{{--@endpush--}} From 37f5cfa8ce0844edc65cc4e329d8a70a8fc6f845 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:02:53 -0800 Subject: [PATCH 050/159] Added edit button for fieldsets Signed-off-by: snipe --- resources/views/custom_fields/index.blade.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/views/custom_fields/index.blade.php b/resources/views/custom_fields/index.blade.php index 08c43cdd7b..d2435d7db5 100644 --- a/resources/views/custom_fields/index.blade.php +++ b/resources/views/custom_fields/index.blade.php @@ -69,8 +69,18 @@ @endforeach + + + + @can('update', $fieldset) + + + {{ trans('button.edit') }} + + @endcan + @can('delete', $fieldset) - {{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete']) }} + {{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete','style' => 'display:inline-block']) }} @if($fieldset->models->count() > 0) @else @@ -78,6 +88,7 @@ @endif {{ Form::close() }} @endcan + @endforeach From a16604285c5d8460f559af3c5eadbffa433c06cd Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:03:07 -0800 Subject: [PATCH 051/159] Normalize the fieldset form Signed-off-by: snipe --- .../custom_fields/fieldsets/edit.blade.php | 58 ++++--------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/resources/views/custom_fields/fieldsets/edit.blade.php b/resources/views/custom_fields/fieldsets/edit.blade.php index 04885891ec..a43769255d 100644 --- a/resources/views/custom_fields/fieldsets/edit.blade.php +++ b/resources/views/custom_fields/fieldsets/edit.blade.php @@ -1,49 +1,13 @@ -@extends('layouts.default') +@extends('layouts/edit-form', [ + 'createText' => trans('admin/custom_fields/general.create_fieldset') , + 'updateText' => trans('admin/custom_fields/general.update_fieldset'), + 'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'), +]) + +@section('inputFields') + + @include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) + + -{{-- Page title --}} -@section('title') - {{ trans('admin/custom_fields/general.create_fieldset') }} -@parent -@stop - -@section('header_right') - - {{ trans('general.back') }} -@stop - - -{{-- Page content --}} -@section('content') -
-
- - {{ Form::open(['route' => 'fieldsets.store', 'class'=>'form-horizontal']) }} - -
-
- - -
- -
- - {!! $errors->first('name', '') !!} -
-
- -
- - -
- {{ Form::close() }} -
-
-

{{ trans('admin/custom_fields/general.about_fieldsets_title') }}

-

{{ trans('admin/custom_fields/general.about_fieldsets_text') }}

-
-
@stop From 583a0412fedba46f36598c5ddc65eb461d55ccc8 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:03:23 -0800 Subject: [PATCH 052/159] Added edit fieldsets translations Signed-off-by: snipe --- .../Controllers/CustomFieldsetsController.php | 61 +++++++++++++------ .../lang/en/admin/custom_fields/general.php | 3 + 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/CustomFieldsetsController.php b/app/Http/Controllers/CustomFieldsetsController.php index c7c00a7bd2..bee0f38e27 100644 --- a/app/Http/Controllers/CustomFieldsetsController.php +++ b/app/Http/Controllers/CustomFieldsetsController.php @@ -75,9 +75,9 @@ class CustomFieldsetsController extends Controller */ public function create() { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); - return view('custom_fields.fieldsets.edit'); + return view('custom_fields.fieldsets.edit')->with('item', new CustomFieldset()); } /** @@ -91,7 +91,7 @@ class CustomFieldsetsController extends Controller */ public function store(Request $request) { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); $cfset = new CustomFieldset([ 'name' => e($request->get('name')), @@ -110,31 +110,52 @@ class CustomFieldsetsController extends Controller } /** - * What the actual fuck, Brady? + * Presents edit form for fieldset * - * @todo Uhh, build this? - * @author [Brady Wetherington] [] + * @author [A. Gianotto] [] * @param int $id - * @since [v1.8] - * @return Fuckall + * @since [v6.0.14] + * @return Redirect + * @throws \Illuminate\Auth\Access\AuthorizationException */ public function edit($id) { - // + $this->authorize('create', CustomField::class); + + if ($fieldset = CustomFieldset::find($id)) { + return view('custom_fields.fieldsets.edit')->with('item', $fieldset); + } + + return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id])); + } /** - * GET IN THE SEA BRADY. + * Saves updated fieldset data * - * @todo Uhh, build this too? - * @author [Brady Wetherington] [] + * @author [A. Gianotto] [] * @param int $id - * @since [v1.8] - * @return Fuckall + * @since [v6.0.14] + * @return Redirect + * @throws \Illuminate\Auth\Access\AuthorizationException */ - public function update($id) + public function update(Request $request, $id) { - // + $this->authorize('create', CustomField::class); + + if ($fieldset = CustomFieldset::find($id)) { + + $fieldset->name = $request->input('name'); + + if ($fieldset->save()) { + return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/general.fieldset_updated')); + } + + return redirect()->back()->withInput()->withErrors($fieldset->getErrors()); + + } + + return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id])); } /** @@ -148,7 +169,7 @@ class CustomFieldsetsController extends Controller */ public function destroy($id) { - $fieldset = CustomFieldset::find($id); + $fieldset = CustomField::find($id); $this->authorize('delete', $fieldset); @@ -175,7 +196,7 @@ class CustomFieldsetsController extends Controller */ public function associate(Request $request, $id) { - $set = CustomFieldset::find($id); + $set = CustomField::find($id); $this->authorize('update', $set); @@ -202,7 +223,7 @@ class CustomFieldsetsController extends Controller */ public function makeFieldRequired($fieldset_id, $field_id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $field = CustomField::findOrFail($field_id); $fieldset = CustomFieldset::findOrFail($fieldset_id); $fields[$field->id] = ['required' => 1]; @@ -220,7 +241,7 @@ class CustomFieldsetsController extends Controller */ public function makeFieldOptional($fieldset_id, $field_id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $field = CustomField::findOrFail($field_id); $fieldset = CustomFieldset::findOrFail($fieldset_id); $fields[$field->id] = ['required' => 0]; diff --git a/resources/lang/en/admin/custom_fields/general.php b/resources/lang/en/admin/custom_fields/general.php index 92bf240a76..9dae380aa5 100644 --- a/resources/lang/en/admin/custom_fields/general.php +++ b/resources/lang/en/admin/custom_fields/general.php @@ -27,6 +27,9 @@ return [ 'used_by_models' => 'Used By Models', 'order' => 'Order', 'create_fieldset' => 'New Fieldset', + 'update_fieldset' => 'Update Fieldset', + 'fieldset_does_not_exist' => 'Fieldset :id does not exist', + 'fieldset_updated' => 'Fieldset updated', 'create_fieldset_title' => 'Create a new fieldset', 'create_field' => 'New Custom Field', 'create_field_title' => 'Create a new custom field', From 22b0b9b090b0fc85fa1209cd6fa3a978666383d4 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:05:41 -0800 Subject: [PATCH 053/159] Fixed gates on fieldsets Signed-off-by: snipe --- .../Controllers/Api/CustomFieldsetsController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Api/CustomFieldsetsController.php b/app/Http/Controllers/Api/CustomFieldsetsController.php index 18da1b67c2..27da7733cd 100644 --- a/app/Http/Controllers/Api/CustomFieldsetsController.php +++ b/app/Http/Controllers/Api/CustomFieldsetsController.php @@ -33,7 +33,7 @@ class CustomFieldsetsController extends Controller */ public function index() { - $this->authorize('index', CustomFieldset::class); + $this->authorize('index', CustomField::class); $fieldsets = CustomFieldset::withCount('fields as fields_count', 'models as models_count')->get(); return (new CustomFieldsetsTransformer)->transformCustomFieldsets($fieldsets, $fieldsets->count()); @@ -49,7 +49,7 @@ class CustomFieldsetsController extends Controller */ public function show($id) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); if ($fieldset = CustomFieldset::find($id)) { return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset); } @@ -68,7 +68,7 @@ class CustomFieldsetsController extends Controller */ public function update(Request $request, $id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $fieldset = CustomFieldset::findOrFail($id); $fieldset->fill($request->all()); @@ -89,7 +89,7 @@ class CustomFieldsetsController extends Controller */ public function store(Request $request) { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); $fieldset = new CustomFieldset; $fieldset->fill($request->all()); @@ -109,7 +109,7 @@ class CustomFieldsetsController extends Controller */ public function destroy($id) { - $this->authorize('delete', CustomFieldset::class); + $this->authorize('delete', CustomField::class); $fieldset = CustomFieldset::findOrFail($id); $modelsCount = $fieldset->models->count(); @@ -136,7 +136,7 @@ class CustomFieldsetsController extends Controller */ public function fields($id) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); $set = CustomFieldset::findOrFail($id); $fields = $set->fields; @@ -153,7 +153,7 @@ class CustomFieldsetsController extends Controller */ public function fieldsWithDefaultValues($fieldsetId, $modelId) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); $set = CustomFieldset::findOrFail($fieldsetId); From c2854f1bcb79a9f0fbe8342a4993e9c375b16f57 Mon Sep 17 00:00:00 2001 From: Ben Periton <104396+benperiton@users.noreply.github.com> Date: Tue, 18 Oct 2022 08:00:36 +0100 Subject: [PATCH 054/159] Update database.php Although Postgres is not officially supported, it does seem to work ok, but to help a little bit with the Docker image, this is non-breaking change but allows the env file to specify the pgsql connection port --- config/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/database.php b/config/database.php index 9d94454db2..36440b2127 100755 --- a/config/database.php +++ b/config/database.php @@ -102,6 +102,7 @@ return [ 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), From ccc7b78f623678ada9ef37a5ec34c45f76521b3c Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 30 Jan 2023 15:11:41 -0600 Subject: [PATCH 055/159] Store the acceptance dates with format YYY-mm-dd --- app/Http/Controllers/Account/AcceptanceController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php index 59c8f88430..726e164ba8 100644 --- a/app/Http/Controllers/Account/AcceptanceController.php +++ b/app/Http/Controllers/Account/AcceptanceController.php @@ -222,8 +222,8 @@ class AcceptanceController extends Controller 'item_model' => $display_model, 'item_serial' => $item->serial, 'eula' => $item->getEula(), - 'check_out_date' => Carbon::parse($acceptance->created_at)->format($branding_settings->date_display_format), - 'accepted_date' => Carbon::parse($acceptance->accepted_at)->format($branding_settings->date_display_format), + 'check_out_date' => Carbon::parse($acceptance->created_at)->format('Y-m-d'), + 'accepted_date' => Carbon::parse($acceptance->accepted_at)->format('Y-m-d'), 'assigned_to' => $assigned_to, 'company_name' => $branding_settings->site_name, 'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null, @@ -273,7 +273,7 @@ class AcceptanceController extends Controller 'item_tag' => $item->asset_tag, 'item_model' => $display_model, 'item_serial' => $item->serial, - 'declined_date' => Carbon::parse($acceptance->accepted_at)->format($branding_settings->date_display_format), + 'declined_date' => Carbon::parse($acceptance->declined_at)->format('Y-m-d'), 'assigned_to' => $assigned_to, 'company_name' => $branding_settings->site_name, 'date_settings' => $branding_settings->date_display_format, From 214a1af61a804ccda8f490e7fa53cf3efadceeee Mon Sep 17 00:00:00 2001 From: akemidx Date: Mon, 30 Jan 2023 16:54:23 -0500 Subject: [PATCH 056/159] apostrophe updates --- resources/views/hardware/checkin.blade.php | 2 +- resources/views/hardware/checkout.blade.php | 2 +- resources/views/hardware/quickscan-checkin.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index 7f9087ae3d..f7fe067c8a 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -47,7 +47,7 @@ @else {{ trans('admin/hardware/general.model_invalid')}} - {{ trans(admin/hardware/general.model_invalid_fix')}} + {{ trans('admin/hardware/general.model_invalid_fix')}} @endif

diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php index bdb03d3147..31dff70eaa 100755 --- a/resources/views/hardware/checkout.blade.php +++ b/resources/views/hardware/checkout.blade.php @@ -37,7 +37,7 @@ @else {{ trans('admin/hardware/general.model_invalid')}} - {{ trans(admin/hardware/general.model_invalid_fix')}} + {{ trans('admin/hardware/general.model_invalid_fix')}} @endif

diff --git a/resources/views/hardware/quickscan-checkin.blade.php b/resources/views/hardware/quickscan-checkin.blade.php index 8884821809..677e0c0f15 100644 --- a/resources/views/hardware/quickscan-checkin.blade.php +++ b/resources/views/hardware/quickscan-checkin.blade.php @@ -86,7 +86,7 @@ - {{ trans(general.processing') }}... + {{ trans('general.processing') }}... From fc044528b89249efc4852fb8ec992bfa702b7f1c Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 30 Jan 2023 16:10:02 -0800 Subject: [PATCH 057/159] validation is working, success message appears, database is not updating --- app/Http/Livewire/SlackSettingsForm.php | 11 +- app/Models/Setting.php | 3 + .../livewire/slack-settings-form.blade.php | 138 ++++++++------ resources/views/settings/slack.blade.php | 175 +----------------- 4 files changed, 95 insertions(+), 232 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 63b9383a93..ddc38f36b3 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -10,6 +10,7 @@ class SlackSettingsForm extends Component public $slack_endpoint; public $slack_channel; public $slack_botname; + public $successMessage; public Setting $setting; @@ -41,13 +42,17 @@ class SlackSettingsForm extends Component public function submit() { - dd("we here now"); - - $this->validate(); + $this->validate([ + 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', + 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', + 'slack_botname' => 'string|nullable', + ]); $this->setting->slack_endpoint = $this->slack_endpoint; $this->setting->slack_channel = $this->slack_channel; $this->setting->slack_botname = $this->slack_botname; + $this->successMessage= trans('admin/settings/message.update.success'); + } } diff --git a/app/Models/Setting.php b/app/Models/Setting.php index f2a4184178..8289260647 100755 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -83,6 +83,9 @@ class Setting extends Model 'email_domain', 'email_format', 'username_format', + 'slack_endpoint', + 'slack_channel', + 'slack_botname', ]; /** diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index a42a99fd7f..5d41ff2a6f 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,65 +1,85 @@
-
-
-
- {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} -
-
- @if (config('app.lock_passwords')===true) - {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} -

{{ trans('general.feature_disabled') }}

- - @else - - {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} - @endif - {!! $errors->first('slack_endpoint', '') !!} -
-
+
+
+
+
+

+ {{ trans('admin/settings/general.slack') }} +

+
+
+
+ {{$successMessage}} + + {{csrf_field()}} +
+
+ {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} +
+
+ @if (config('app.lock_passwords')===true) + {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} +

{{ trans('general.feature_disabled') }}

+ + @else + + {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} + @endif + {!! $errors->first('slack_endpoint', '') !!} +
+
- -
-
- {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} -
-
- @if (config('app.lock_passwords')===true) - -

{{ trans('general.feature_disabled') }}

+ +
+
+ {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} +
+
+ @if (config('app.lock_passwords')===true) + +

{{ trans('general.feature_disabled') }}

- @else - - @endif - {!! $errors->first('slack_channel', '') !!} -
-
- - -
-
- {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} -
-
- @if (config('app.lock_passwords')===true) - {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }} - - -

{{ trans('general.feature_disabled') }}

- - @else - - @endif - {!! $errors->first('slack_botname', '') !!} -
-
- -
- + +
+
+ {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} +
+
+ @if (config('app.lock_passwords')===true) + {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }} + +

{{ trans('general.feature_disabled') }}

+ + @else + + @endif + {!! $errors->first('slack_botname', '') !!} +
+
+ + + +
+
+ +
+
+
+
diff --git a/resources/views/settings/slack.blade.php b/resources/views/settings/slack.blade.php index 67a3550536..9e0286c61b 100644 --- a/resources/views/settings/slack.blade.php +++ b/resources/views/settings/slack.blade.php @@ -20,189 +20,24 @@ } - - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - {{csrf_field()}} - -
-
-
-
-

- {{ trans('admin/settings/general.slack') }} -

-
-
+

{!! trans('admin/settings/general.slack_integration_help',array('slack_link' => 'https://my.slack.com/services/new/incoming-webhook')) !!} - @if (($setting->slack_channel=='') && ($setting->slack_endpoint=='')) - {{ trans('admin/settings/general.slack_integration_help_button') }} - @endif -

+{{-- @if (($setting->slack_channel=='') && ($setting->slack_endpoint==''))--}} +{{-- {{ trans('admin/settings/general.slack_integration_help_button') }}--}} +{{-- @endif--}} +{{--

--}} -
@livewire('slack-settings-form') - -
-
- -
-
-
- - {{Form::close()}} - -@stop - -{{--@push('js')--}} -{{-- --}} - -{{--@endpush--}} From a7a578bf51462d52ef5fdf091ad3c114e3f8ba51 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Tue, 31 Jan 2023 00:13:44 -0600 Subject: [PATCH 058/159] Added head only logo to be used as default in apple-touch-icon --- public/img/snipe-logo-bug.png | Bin 0 -> 22482 bytes resources/views/layouts/default.blade.php | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 public/img/snipe-logo-bug.png diff --git a/public/img/snipe-logo-bug.png b/public/img/snipe-logo-bug.png new file mode 100644 index 0000000000000000000000000000000000000000..423a5b74906c4a1f67dab665a59a6731f0dbaa98 GIT binary patch literal 22482 zcmV*zKs>*RP)H{cw zH-Z76V6&ipv!U)TchtcW2+lsP_+<{^%8EQ%`R*@K-3_ zBFI98GDHaoIf0*S*mLLDMW{2ZU@fTkpm-I~EFvhS5D`%P2$9Vfy55&U`lD5tO+9y2 zgS<+iJ}Sr+2w{{05l{+{6TpuyXq_wXsz9U*_&b61AoYkc08rS<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p!}EE@3-by59HQyLp2c5R*O0Mcy^ISBknm48Zf zb&p(%u~~|KtAKGR-QO1zXa%+dUj{x2np8`j4b7((dGX<6)UB`NlYg+DP{8SDNEiFtI(iz65rkPJ?I5RrN$usAeNTrybonN^4NvJWuMOvft+DK)6U zoW|ff?*|V6j;@0G?pgV4dnhPw)m>7_VJ#lMpsM>tS&Q$}bC#fYVpuJ}z*2sc_e<(576u12sMpwLZ>ez1CA~VPB2}ck03x%hyd>z0 z2rr}38}Ityfa1`H9xy@5^!Ju4k^m}2HKEWTBG;h02a)Zl)+)q+kY#0i?A*1L#n5wX zdOsW4>^n>3H@R5}R=AIEPj(iH76oDRI@5FkMaueOMzZsNYRNzSI-9y6o-E2 z0J9ur`gN@&6?beF>BXgu8$* z0&PI$dt{@?aw%c4SgA^dI0Wund9x^k2>*ua(;z2RNZWyCzf<&)28>DR{=Rz9eJFQ} zNDpYju~xkJScwTy_q72x0e1tt zaKltRrPy082si?lA^*+@0OnQoNfCJfc>BYqi(D*y>;MCh?(YqWWog|6{28zVbS;Rx zwpPmO2?`-oA+`Zi0G$xzCE$Kl-b!?RG=SpJ#}Y6mW%~OPz)pqF2wa2ZZLTf$0GHNR z98x%g>T?3mD)Q7v4JZzM>;dCYroT4^vQ}Z8Sfc7$tR;#D*ZT1p(x6CA;053r(1XB0 hytAkDao!&h`hQiyu`zZVw1EHs002ovPDHLkV1kB*5#ay; literal 0 HcmV?d00001 diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index daf4275481..ceabe13553 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -15,8 +15,8 @@ - - + + From cddae4869fcce2e4d2de3b313c5e929d4efac5ae Mon Sep 17 00:00:00 2001 From: lukasfehling <6AQmxBp2VWLzo3.LXH*ApJbbje8GYaqq> Date: Tue, 31 Jan 2023 18:27:25 +0100 Subject: [PATCH 059/159] fixed the endpoint for user notification with all their assigned assets --- app/Http/Controllers/Api/UsersController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index cca829c23f..9a9135a380 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -542,9 +542,10 @@ class UsersController extends Controller if (empty($user->email)) { return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.inventorynotification.error'))); } + + $user->notify((new CurrentInventory($user))); - return response()->Helper::formatStandardApiResponse('success', null, trans('admin/users/message.inventorynotification.success')); - + return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/users/message.inventorynotification.success'))); } /** From 1e0c58c3cf77beb07c2e9e6624bf233dcd0466ab Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 31 Jan 2023 11:32:05 -0800 Subject: [PATCH 060/159] saves data correctly now --- app/Http/Livewire/SlackSettingsForm.php | 5 +- .../livewire/slack-settings-form.blade.php | 141 ++++++++---------- resources/views/settings/slack.blade.php | 28 +++- 3 files changed, 90 insertions(+), 84 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index ddc38f36b3..2cb153734c 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -52,7 +52,10 @@ class SlackSettingsForm extends Component $this->setting->slack_channel = $this->slack_channel; $this->setting->slack_botname = $this->slack_botname; - $this->successMessage= trans('admin/settings/message.update.success'); + $this->setting->save(); + + session()->flash('message',trans('admin/settings/message.update.success')); + } } diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index 5d41ff2a6f..b01ffa867f 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,85 +1,76 @@ -
-
-
-
-
-

- {{ trans('admin/settings/general.slack') }} -

-
-
-
- {{$successMessage}} -
- {{csrf_field()}} -
-
- {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} -
-
- @if (config('app.lock_passwords')===true) - {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} -

{{ trans('general.feature_disabled') }}

- - @else - - {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} - @endif - {!! $errors->first('slack_endpoint', '') !!} -
-
- -
-
- {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} -
-
- @if (config('app.lock_passwords')===true) - -

{{ trans('general.feature_disabled') }}

- @else - - @endif - {!! $errors->first('slack_channel', '') !!} -
+
+ @if (session()->has('message')) +
+ {{session('message')}} +
+ @endif + + {{csrf_field()}} + +
+
+ {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }}
- - -
-
- {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} -
-
- @if (config('app.lock_passwords')===true) - {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }} - -

{{ trans('general.feature_disabled') }}

- - @else - - @endif - {!! $errors->first('slack_botname', '') !!} -
+
+ @if (config('app.lock_passwords')===true) +{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} +

{{ trans('general.feature_disabled') }}

+
+ @else +
+{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} + @endif + {!! $errors->first('slack_endpoint', '') !!}
- +
+ + +
+
+ {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} +
+
+ @if (config('app.lock_passwords')===true) +{{-- {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }}--}} +
+

{{ trans('general.feature_disabled') }}

+ + @else +
+ @endif + {!! $errors->first('slack_botname', '') !!} +
+
+ +
-
-
+
-
-
-
-
diff --git a/resources/views/settings/slack.blade.php b/resources/views/settings/slack.blade.php index 9e0286c61b..25480a1c1e 100644 --- a/resources/views/settings/slack.blade.php +++ b/resources/views/settings/slack.blade.php @@ -19,25 +19,37 @@ padding-right: 40px; } + {{csrf_field()}} - - +
+
+
+
+

+ {{ trans('admin/settings/general.slack') }} +

+
+

{!! trans('admin/settings/general.slack_integration_help',array('slack_link' => 'https://my.slack.com/services/new/incoming-webhook')) !!} +

-{{-- @if (($setting->slack_channel=='') && ($setting->slack_endpoint==''))--}} -{{-- {{ trans('admin/settings/general.slack_integration_help_button') }}--}} -{{-- @endif--}} -{{--

--}} + @livewire('slack-settings-form') + + + +
+
+ + +@stop - @livewire('slack-settings-form') - From a4173e38819a717e702a487d93112ce6c1e753e3 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 31 Jan 2023 16:49:41 -0800 Subject: [PATCH 061/159] Permit not-delegated+dont-expire-password+normal-accounts to login --- app/Console/Commands/LdapSync.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index c6f8dd379a..ea99e74d1f 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -303,17 +303,18 @@ class LdapSync extends Command $user->activated = 0; } */ $enabled_accounts = [ - '512', // 0x200 NORMAL_ACCOUNT - '544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD - '66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD - '66080', // 0x10220 NORMAL_ACCOUNT, PASSWD_NOTREQD, DONT_EXPIRE_PASSWORD - '262656', // 0x40200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED - '262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED - '328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD - '328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD - '4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH + '512', // 0x200 NORMAL_ACCOUNT + '544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD + '66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD + '66080', // 0x10220 NORMAL_ACCOUNT, PASSWD_NOTREQD, DONT_EXPIRE_PASSWORD + '262656', // 0x40200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED + '262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED + '328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD + '328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD + '4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH '4260352', // 0x410200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, DONT_REQ_PREAUTH '1049088', // 0x100200 NORMAL_ACCOUNT, NOT_DELEGATED + '1114624', // 0x110200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, NOT_DELEGATED, ]; $user->activated = (in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts)) ? 1 : 0; From 02ca5248b10670728ef7f5874adea0c8c83b59cc Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 31 Jan 2023 17:44:09 -0800 Subject: [PATCH 062/159] Don't append username to the user's name if it's already there --- resources/views/partials/bootstrap-table.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 5a6e9dd464..d3a0fddc14 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -327,8 +327,8 @@ item_icon = ''; } - // display the username if it's checked out to a user - if (value.username) { + // display the username if it's checked out to a user, but don't do it if the username's there already + if (value.username && !value.name.match('\\(') && !value.name.match('\\)')) { value.name = value.name + ' (' + value.username + ')'; } From de1141491aa7441e7153f43e3cb73f0de18a9895 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 31 Jan 2023 19:41:42 -0800 Subject: [PATCH 063/159] Replaced help text Signed-off-by: snipe --- .../views/custom_fields/fieldsets/edit.blade.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/views/custom_fields/fieldsets/edit.blade.php b/resources/views/custom_fields/fieldsets/edit.blade.php index a43769255d..7a35ca146f 100644 --- a/resources/views/custom_fields/fieldsets/edit.blade.php +++ b/resources/views/custom_fields/fieldsets/edit.blade.php @@ -1,13 +1,17 @@ @extends('layouts/edit-form', [ 'createText' => trans('admin/custom_fields/general.create_fieldset') , 'updateText' => trans('admin/custom_fields/general.update_fieldset'), + 'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'), + 'helpPosition' => 'right', 'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'), ]) -@section('inputFields') - - @include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) - - - +@section('content') + @parent @stop + +@section('inputFields') +@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) +@stop + + From 3580bdae86cfcecd0a257d95be861fb3f709af11 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 1 Feb 2023 11:44:35 -0800 Subject: [PATCH 064/159] Use object accessor instead of array accessor --- app/Models/CheckoutAcceptance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php index d68ac7ab7c..4cdc5b073b 100644 --- a/app/Models/CheckoutAcceptance.php +++ b/app/Models/CheckoutAcceptance.php @@ -21,7 +21,7 @@ class CheckoutAcceptance extends Model { // At this point the endpoint is the same for everything. // In the future this may want to be adapted for individual notifications. - return Setting::getSettings()['alert_email']; + return Setting::getSettings()->alert_email; } /** From a45ce468cc8472f98d81fb78983830b064465d52 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 1 Feb 2023 11:44:56 -0800 Subject: [PATCH 065/159] Update return type for routing mail notifications --- app/Models/CheckoutAcceptance.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php index 4cdc5b073b..45fc6ec088 100644 --- a/app/Models/CheckoutAcceptance.php +++ b/app/Models/CheckoutAcceptance.php @@ -16,8 +16,12 @@ class CheckoutAcceptance extends Model 'declined_at' => 'datetime', ]; - // Get the mail recipient from the config - public function routeNotificationForMail(): string + /** + * Get the mail recipient from the config + * + * @return mixed|string|null + */ + public function routeNotificationForMail() { // At this point the endpoint is the same for everything. // In the future this may want to be adapted for individual notifications. From f95a904d90f0523ff70ebb8076fc492152c5f64f Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 1 Feb 2023 12:08:13 -0800 Subject: [PATCH 066/159] adds integration button, working on its functionality --- .../Controllers/Api/SettingsController.php | 22 +++-------- app/Http/Controllers/SettingsController.php | 8 ++-- app/Http/Livewire/SlackSettingsForm.php | 19 +++------- app/Http/Requests/SlackSettingsRequest.php | 1 - .../livewire/slack-settings-form.blade.php | 37 ++++++++++++++++--- resources/views/settings/slack.blade.php | 5 --- 6 files changed, 47 insertions(+), 45 deletions(-) diff --git a/app/Http/Controllers/Api/SettingsController.php b/app/Http/Controllers/Api/SettingsController.php index 62380b2212..26d380353f 100644 --- a/app/Http/Controllers/Api/SettingsController.php +++ b/app/Http/Controllers/Api/SettingsController.php @@ -143,21 +143,11 @@ class SettingsController extends Controller } - public function slacktest(SlackSettingsRequest $request) + public function slacktest($slack_endpoint,$slack_channel,$slack_botname) { - - $validator = Validator::make($request->all(), [ - 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', - 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', - ]); - - if ($validator->fails()) { - return response()->json(['message' => 'Validation failed', 'errors' => $validator->errors()], 422); - } - // If validation passes, continue to the curl request $slack = new Client([ - 'base_url' => e($request->input('slack_endpoint')), + 'base_url' => e($slack_endpoint), 'defaults' => [ 'exceptions' => false, ], @@ -165,18 +155,18 @@ class SettingsController extends Controller $payload = json_encode( [ - 'channel' => e($request->input('slack_channel')), + 'channel' => e($slack_channel), 'text' => trans('general.slack_test_msg'), - 'username' => e($request->input('slack_botname')), + 'username' => e($slack_botname), 'icon_emoji' => ':heart:', ]); try { - $slack->post($request->input('slack_endpoint'), ['body' => $payload]); + $slack->post($slack_endpoint, ['body' => $payload]); return response()->json(['message' => 'Success'], 200); } catch (\Exception $e) { - return response()->json(['message' => 'Please check the channel name and webhook endpoint URL ('.e($request->input('slack_endpoint')).'). Slack responded with: '.$e->getMessage()], 400); + return response()->json(['message' => 'Please check the channel name and webhook endpoint URL ('.e($slack_endpoint).'). Slack responded with: '.$e->getMessage()], 400); } //} diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 9a7c2cc7d5..6daaabdc9f 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -688,15 +688,15 @@ class SettingsController extends Controller * * @return View */ - public function postSlack(SlackSettingsRequest $request) + public function postSlack($slack_endpoint,$slack_channel,$slack_botname) { if (is_null($setting = Setting::getSettings())) { return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error')); } - $setting->slack_endpoint = $request->input('slack_endpoint'); - $setting->slack_channel = $request->input('slack_channel'); - $setting->slack_botname = $request->input('slack_botname'); + $setting->slack_endpoint = $slack_endpoint; + $setting->slack_channel = $slack_channel; + $setting->slack_botname = $slack_botname; if ($setting->save()) { return redirect()->route('settings.index') diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 2cb153734c..fbc54a0517 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -4,28 +4,16 @@ namespace App\Http\Livewire; use Livewire\Component; use App\Models\Setting; +use App\Http\Controllers\Api\SettingsController; class SlackSettingsForm extends Component { public $slack_endpoint; public $slack_channel; public $slack_botname; - public $successMessage; public Setting $setting; - protected $rules = [ - 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', - 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', - 'slack_botname' => 'string|nullable', - ]; - protected $messages = [ - 'slack_endpoint.required_with' => 'Slack endpoint is required', - 'slack_endpoint.starts_with' => 'Slack endpoint must start with https://hooks.slack.com', - - - ]; - public function mount(){ $this->setting = Setting::getSettings(); @@ -40,6 +28,11 @@ class SlackSettingsForm extends Component return view('livewire.slack-settings-form'); } + public function testSlack($slack_endpoint, $slack_channel, $slack_botname){ + SettingsController::testSlack($slack_endpoint,$slack_channel,$slack_botname); + + + } public function submit() { $this->validate([ diff --git a/app/Http/Requests/SlackSettingsRequest.php b/app/Http/Requests/SlackSettingsRequest.php index 1f44215198..e8f7d2f0ea 100644 --- a/app/Http/Requests/SlackSettingsRequest.php +++ b/app/Http/Requests/SlackSettingsRequest.php @@ -25,7 +25,6 @@ class SlackSettingsRequest extends Request 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:"https://hooks.slack.com"|nullable', 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', 'slack_botname' => 'string|nullable', - ]; } diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index b01ffa867f..6562f41b33 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -8,6 +8,7 @@ @endif
{{csrf_field()}} +
@@ -17,9 +18,9 @@ @if (config('app.lock_passwords')===true) {{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}}

{{ trans('general.feature_disabled') }}

-
+
@else -
+
{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}} @endif {!! $errors->first('slack_endpoint', '') !!} @@ -33,11 +34,11 @@
@if (config('app.lock_passwords')===true) -
+

{{ trans('general.feature_disabled') }}

@else -
+
@endif {!! $errors->first('slack_channel', '') !!}
@@ -51,16 +52,40 @@
@if (config('app.lock_passwords')===true) {{-- {{ Form::text('slack_botname', old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-Bot')) }}--}} -
+

{{ trans('general.feature_disabled') }}

@else -
+
@endif {!! $errors->first('slack_botname', '') !!}
+ + @if($slack_endpoint != null && $slack_channel != null && $slack_botname != null) +
+
+ {{ Form::label('test_slack', 'Test Slack') }} +
+
+ +
+ @if($response == 'success') + message here + @endif + @if($response == 'error') + message here + @endif +
+
+ @endif +{{--
--}} +{{-- --}} +{{-- --}} +{{-- --}} +{{--
--}} +
-
+
- +
-
-
- +
+
+
diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index f7ec2796b6..a643ee2fe2 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -11,8 +11,8 @@ @section('inputFields') @include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name'), 'required' => 'true']) -@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id', 'required' => 'true']) @include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'asset']) +@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id']) @include ('partials.forms.edit.model_number') @include ('partials.forms.edit.depreciation') From 32ed70259e26a7f00b0ebccf35ccdc15b432be10 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 9 Feb 2023 15:39:10 -0500 Subject: [PATCH 122/159] sweedish chef fixes up your typos --- resources/views/modals/model.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/modals/model.blade.php b/resources/views/modals/model.blade.php index 519767f304..360d14ce32 100644 --- a/resources/views/modals/model.blade.php +++ b/resources/views/modals/model.blade.php @@ -26,7 +26,7 @@
- +
From 5714824aa77e6a2955f7b5882c24148634960a71 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 9 Feb 2023 17:24:34 -0500 Subject: [PATCH 123/159] translations for the layout setup --- resources/lang/en/general.php | 6 ++++++ resources/views/layouts/default.blade.php | 9 +++++---- resources/views/layouts/setup.blade.php | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index e071124a05..cc7ee7fa1c 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -397,6 +397,12 @@ return [ 'placeholder_kit' => 'Select a kit', 'file_not_found' => 'File not found', 'preview_not_available' => '(no preview)', + 'setup' => 'Setup', + 'pre_flight' => 'Pre-Flight', + 'skip_to_main_content' => 'Skip to main content', + 'toggle_navigation' => 'Toggle navigation', + 'alerts' => 'Alerts', + 'tasks_view_all' => 'View all tasks', diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index ceabe13553..2bb9bc8cf9 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -88,7 +88,7 @@ @endif -
Skip to main content + {{ trans('general.skip_to_main_content') }}
@@ -100,7 +100,7 @@