Skip to content

A free open source IT asset/license management system

Merge branch 'develop' into feature/sc-15014/asset-acceptance-and-signed-eula-as-pdf

Godfrey Martinezfe6a6740dbae
diff --cc app/Http/Controllers/ActionlogController.php
index c7d204874f,dcd062ce4e..c0c8a997d7
--- a/app/Http/Controllers/ActionlogController.php
+++ b/app/Http/Controllers/ActionlogController.php
@@@ -13,14 -16,14 +17,20 @@@ class ActionlogController extends Contr
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/signatures/'.$filename;
$filetype = Helper::checkUploadIsImage($file);
- $contents = file_get_contents($file);
- return Response::make($contents)->header('Content-Type', $filetype);
+ $contents = file_get_contents($file, false, stream_context_create(['http' => ['ignore_errors' => true]]));
+ if ($contents === false) {
+ \Log::warn('File '.$file.' not found');
+ return false;
+ } else {
+ return Response::make($contents)->header('Content-Type', $filetype);
+ }
+
}
+ public function getStoredEula($filename){
+ $this->authorize('view', \App\Models\Asset::class);
+ $file = config('app.private_uploads').'/eula-pdfs/'.$filename;
+
+ return Response::download($file);
+ }
}
diff --cc app/Http/Transformers/ActionlogsTransformer.php
index 648ab99585,a82b70fee0..fb2e291fd1
--- a/app/Http/Transformers/ActionlogsTransformer.php
+++ b/app/Http/Transformers/ActionlogsTransformer.php
@@@ -112,8 -96,9 +96,9 @@@ class ActionlogsTransforme
'signature_file' => ($actionlog->accept_signature) ? route('log.signature.view', ['filename' => $actionlog->accept_signature ]) : null,
'log_meta' => ((isset($clean_meta)) && (is_array($clean_meta))) ? $clean_meta: null,
'action_date' => ($actionlog->action_date) ? Helper::getFormattedDateObject($actionlog->action_date, 'datetime'): Helper::getFormattedDateObject($actionlog->created_at, 'datetime'),
-
+ 'stored_eula_file' => ($actionlog->stored_eula_file) ? route('log.storedeula.download', ['filename' => $actionlog->stored_eula_file]) : null,
];
+ //\Log::info("Clean Meta is: ".print_r($clean_meta,true));
return $array;
}
diff --cc composer.lock
index bbc043aaed,322113f0b0..72e1c19bc6
--- a/composer.lock
+++ b/composer.lock
@@@ -405,84 -406,8 +406,84 @@@
"type": "github"
}
],
- "time": "2021-12-14T14:45:18+00:00"
+ "time": "2022-02-09T07:52:32+00:00"
},
+ {
+ "name": "barryvdh/laravel-dompdf",
+ "version": "v1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/barryvdh/laravel-dompdf.git",
+ "reference": "e3f429e97087b2ef19b83e5ed313f080f2477685"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/e3f429e97087b2ef19b83e5ed313f080f2477685",
+ "reference": "e3f429e97087b2ef19b83e5ed313f080f2477685",
+ "shasum": ""
+ },
+ "require": {
+ "dompdf/dompdf": "^1",
+ "illuminate/support": "^6|^7|^8|^9",
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "nunomaduro/larastan": "^1|^2",
+ "orchestra/testbench": "^4|^5|^6|^7",
+ "phpro/grumphp": "^1",
+ "squizlabs/php_codesniffer": "^3.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ },
+ "laravel": {
+ "providers": [
+ "Barryvdh\\DomPDF\\ServiceProvider"
+ ],
+ "aliases": {
+ "PDF": "Barryvdh\\DomPDF\\Facade\\Pdf"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Barryvdh\\DomPDF\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "A DOMPDF Wrapper for Laravel",
+ "keywords": [
+ "dompdf",
+ "laravel",
+ "pdf"
+ ],
+ "support": {
+ "issues": "https://github.com/barryvdh/laravel-dompdf/issues",
+ "source": "https://github.com/barryvdh/laravel-dompdf/tree/v1.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://fruitcake.nl",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/barryvdh",
+ "type": "github"
+ }
+ ],
+ "time": "2022-01-29T08:02:59+00:00"
+ },
{
"name": "brick/math",
"version": "0.9.3",
@@@ -1823,76 -1672,9 +1748,76 @@@
"abandoned": "roave/better-reflection",
"time": "2020-10-27T21:46:55+00:00"
},
+ {
+ "name": "dompdf/dompdf",
+ "version": "v1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dompdf/dompdf.git",
+ "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dompdf/dompdf/zipball/60b704331479a69e9bcdb3496da2315b5c4f94fd",
+ "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-mbstring": "*",
+ "phenx/php-font-lib": "^0.5.4",
+ "phenx/php-svg-lib": "^0.3.3 || ^0.4.0",
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.3",
+ "phpunit/phpunit": "^7.5 || ^8 || ^9",
+ "squizlabs/php_codesniffer": "^3.5"
+ },
+ "suggest": {
+ "ext-gd": "Needed to process images",
+ "ext-gmagick": "Improves image processing performance",
+ "ext-imagick": "Improves image processing performance",
+ "ext-zlib": "Needed for pdf stream compression"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Dompdf\\": "src/"
+ },
+ "classmap": [
+ "lib/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Ménager",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Brian Sweeney",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Gabriel Bull",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
+ "homepage": "https://github.com/dompdf/dompdf",
+ "support": {
+ "issues": "https://github.com/dompdf/dompdf/issues",
+ "source": "https://github.com/dompdf/dompdf/tree/v1.2.0"
+ },
+ "time": "2022-02-07T13:02:10+00:00"
+ },
{
"name": "dragonmantank/cron-expression",
- "version": "v3.1.0",
+ "version": "v3.3.1",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
@@@ -7831,63 -7602,10 +7835,63 @@@
],
"support": {
"issues": "https://github.com/rollbar/rollbar-php-laravel/issues",
- "source": "https://github.com/rollbar/rollbar-php-laravel/tree/v7.0.0"
+ "source": "https://github.com/rollbar/rollbar-php-laravel/tree/v7.1.0"
},
- "time": "2020-09-10T17:20:14+00:00"
+ "time": "2022-02-21T21:48:29+00:00"
},
+ {
+ "name": "sabberworm/php-css-parser",
+ "version": "8.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
+ "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
+ "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
+ "shasum": ""
+ },
+ "require": {
+ "ext-iconv": "*",
+ "php": ">=5.6.20"
+ },
+ "require-dev": {
+ "codacy/coverage": "^1.4",
+ "phpunit/phpunit": "^4.8.36"
+ },
+ "suggest": {
+ "ext-mbstring": "for parsing UTF-8 CSS"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Sabberworm\\CSS\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Raphael Schweikert"
+ }
+ ],
+ "description": "Parser for CSS Files written in PHP",
+ "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
+ "keywords": [
+ "css",
+ "parser",
+ "stylesheet"
+ ],
+ "support": {
+ "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
+ "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
+ },
+ "time": "2021-12-11T13:40:54+00:00"
+ },
{
"name": "sebastian/comparator",
"version": "4.0.6",