Merge remote-tracking branch 'origin/develop'

Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
This commit is contained in:
snipe 2024-05-22 17:50:14 +01:00
commit c20d10d4f2
3 changed files with 23 additions and 19 deletions

View file

@ -105,7 +105,7 @@ RUN \
&& ln -fs "/var/lib/snipeit/keys/ldap_client_tls.cert" "/var/www/html/storage/ldap_client_tls.cert" \ && ln -fs "/var/lib/snipeit/keys/ldap_client_tls.cert" "/var/www/html/storage/ldap_client_tls.cert" \
&& ln -fs "/var/lib/snipeit/keys/ldap_client_tls.key" "/var/www/html/storage/ldap_client_tls.key" \ && ln -fs "/var/lib/snipeit/keys/ldap_client_tls.key" "/var/www/html/storage/ldap_client_tls.key" \
&& chown docker "/var/lib/snipeit/keys/" \ && chown docker "/var/lib/snipeit/keys/" \
&& chown -h docker "/var/www/html/storage/" \ && chown -Rh docker "/var/www/html/storage/" \
&& chmod +x /var/www/html/artisan \ && chmod +x /var/www/html/artisan \
&& echo "Finished setting up application in /var/www/html" && echo "Finished setting up application in /var/www/html"

View file

@ -78,24 +78,28 @@ class UserFilesController extends Controller
*/ */
public function destroy($userId = null, $fileId = null) public function destroy($userId = null, $fileId = null)
{ {
$user = User::find($userId); if ($user = User::find($userId)) {
$destinationPath = config('app.private_uploads').'/users';
$this->authorize('delete', $user);
$rel_path = 'private_uploads/users';
if ($log = Actionlog::find($fileId)) {
$filename = $log->filename;
$log->delete();
if (Storage::exists($rel_path.'/'.$filename)) {
Storage::delete($rel_path.'/'.$filename);
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
}
if (isset($user->id)) {
$this->authorize('update', $user);
$log = Actionlog::find($fileId);
$full_filename = $destinationPath.'/'.$log->filename;
if (file_exists($full_filename)) {
unlink($destinationPath.'/'.$log->filename);
} }
$log->delete();
// The log record doesn't exist somehow
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success')); return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
} }
// Prepare the error message
$error = trans('admin/users/message.user_not_found', ['id' => $userId]); return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', ['id' => $userId]));
// Redirect to the licence management page
return redirect()->route('users.index')->with('error', $error);
} }

View file

@ -1,10 +1,10 @@
<?php <?php
return array ( return array (
'app_version' => 'v6.4.1', 'app_version' => 'v6.4.2',
'full_app_version' => 'v6.4.1 - build 13458-gf2cc9ec1dd', 'full_app_version' => 'v6.4.2 - build 13487-gb489c71fa2',
'build_version' => '13458', 'build_version' => '13487',
'prerelease_version' => '', 'prerelease_version' => '',
'hash_version' => 'gf2cc9ec1dd', 'hash_version' => 'gb489c71fa2',
'full_hash' => 'v6.4.1-68-gf2cc9ec1dd', 'full_hash' => 'v6.4.2-97-gb489c71fa2',
'branch' => 'master', 'branch' => 'master',
); );