From d9b68716c8e2b29597aa64aab8b8a0bcc1acefaf Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Sun, 28 Jul 2019 13:21:36 +0100 Subject: [PATCH 1/2] Force composer to always discard any local changes to packages - this gets around a checksumming issue in the AWS SDK upgrade. --- composer.json | 3 ++- public/update.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 1255b7c..f0988ea 100644 --- a/composer.json +++ b/composer.json @@ -55,6 +55,7 @@ ] }, "config": { - "preferred-install": "dist" + "preferred-install": "dist", + "discard-changes": true } } diff --git a/public/update.php b/public/update.php index bf56d01..afcbd4c 100644 --- a/public/update.php +++ b/public/update.php @@ -237,7 +237,7 @@ php artisan view:clear private function runComposer() { ob_start(); - system('php composer.phar install', $rc); + system('php composer.phar --no-interaction install', $rc); $result = ob_get_clean(); echo nl2br($result); if ($rc != 0) From b1410614061703d1e580b481a65d4b8db858d358 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Wed, 31 Jul 2019 08:56:30 +0100 Subject: [PATCH 2/2] Fixes #131: quick upload feature creates a new album with inherited permissions, and also rebuilds the permissions cache. Added an alert to the quick upload to advise of the permissions change. --- app/Http/Controllers/Admin/DefaultController.php | 7 +++++-- resources/lang/en/global.php | 1 + .../views/themes/base/partials/quick_upload.blade.php | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/DefaultController.php b/app/Http/Controllers/Admin/DefaultController.php index 33f2e01..ce80e5b 100644 --- a/app/Http/Controllers/Admin/DefaultController.php +++ b/app/Http/Controllers/Admin/DefaultController.php @@ -204,16 +204,19 @@ class DefaultController extends Controller return redirect($returnUrl); } - $albumViews = UserConfig::allowedAlbumViews(); - $album = new Album(); $album->storage_id = Storage::where('is_default', true)->first()->id; $album->user_id = Auth::user()->id; $album->default_view = UserConfig::get('default_album_view'); $album->name = $albumName; $album->description = ''; + $album->is_permissions_inherited = true; $album->save(); + // Rebuild the permissions cache + $helper = new PermissionsHelper(); + $helper->rebuildCache(); + $request->request->set('album_id', $album->id); } diff --git a/resources/lang/en/global.php b/resources/lang/en/global.php index 20b9fca..0f83c7b 100644 --- a/resources/lang/en/global.php +++ b/resources/lang/en/global.php @@ -14,6 +14,7 @@ return [ 'post_max_exceeded' => 'Your upload exceeded the maximum size the web server is configured to allow. Please check the value of the "post_max_size" parameter in php.ini.', 'powered_by' => 'Powered by :link_startBlue Twilight:link_end - the self-hosted PHP photo gallery software.', 'quick_upload' => [ + 'inherit_by_default' => 'A new album will inherit your gallery\'s default permissions. You can change this afterwards on the album\'s Permissions tab.', 'intro' => 'Use the quick upload feature to quickly add a new photo to an album.', 'or' => '- or -', 'title' => 'Quick Upload' diff --git a/resources/views/themes/base/partials/quick_upload.blade.php b/resources/views/themes/base/partials/quick_upload.blade.php index 8253460..ec3c8b7 100644 --- a/resources/views/themes/base/partials/quick_upload.blade.php +++ b/resources/views/themes/base/partials/quick_upload.blade.php @@ -31,6 +31,10 @@ + +
+ @lang('global.quick_upload.inherit_by_default') +