--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin\Operations\Tools;
+
+use App\Fields\FluidbookID;
+use App\Fluidbook\Compiler\Compiler;
+use App\Fluidbook\Util\SecurePage;
+use App\Models\FluidbookPublication;
+use Cubist\Backpack\Magic\Fields\StandardFile;
+use Cubist\Backpack\Magic\Form;
+use Cubist\Util\Files\Files;
+
+use Cubist\Util\Zip;
+
+trait FluidbookSecurePage
+{
+ use BaseTool;
+
+ public function fluidbooksecurepage()
+ {
+ $form = new Form(backpack_url('tools/dofluidbooksecurepage'));
+ $form->setEnctype('multipart/form-data');
+ $form->setTitle(__('Compliler une page de sécurisation de fluidbook'));
+ $form->setSubmitLabel(__('Compiler'));
+ $form->setSubmitIcon('la-lock');
+ $form->addField('template', StandardFile::class, __('Template'), ['accept' => ['.html']]);
+ $form->addField('fluidbook', FluidbookID::class, __('Fluidbook'), ['hint' => __('Utilise les paramètres de sécurisation de ce fluidbook')]);
+ return view('tools.form', ['form' => $form]);
+ }
+
+
+ public function dofluidbooksecurepage()
+ {
+ /** @var FluidbookPublication $fluidbook */
+ $fluidbook = FluidbookPublication::withoutGlobalScopes()->find(request()->get('fluidbook'));
+ $fluidbook->secureClientSidePassword = '___secure.html';
+ move_uploaded_file(request()->allFiles()['template']->getPathname(), $fluidbook->getAssetDir() . '/___secure.html');
+ Compiler::compile($fluidbook, false, false, true);
+ $final = $fluidbook->getFinalPath();
+
+ // TODO : add other assets by parsing html and finding needed assets (images, logo)
+ $copy = ['secure.html' => 'index.html',
+ 'data/forge.js' => 'data/forge.js',
+ 'data/noaccents.js' => 'data/noaccents.js',
+ 'data/jquery.js' => 'data/jquery.js',
+ ];
+
+ $tmp = Files::tmpdir();
+ Files::mkdir($tmp . '/data');
+ foreach ($copy as $from => $to) {
+ copy($final . '/' . $from, $tmp . '/' . $to);
+ }
+ $tmpzip = Files::tempnam() . '.zip';
+ Zip::archive($tmp, $tmpzip);
+
+ return response()->download($tmpzip, 'secure.zip')->deleteFileAfterSend(true);
+ }
+}
},
{
"name": "composer/semver",
- "version": "3.4.3",
+ "version": "3.4.4",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
+ "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
- "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
+ "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95",
+ "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95",
"shasum": ""
},
"require": {
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.4.3"
+ "source": "https://github.com/composer/semver/tree/3.4.4"
},
"funding": [
{
{
"url": "https://github.com/composer",
"type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/composer/composer",
- "type": "tidelift"
}
],
- "time": "2024-09-19T14:15:21+00:00"
+ "time": "2025-08-20T19:15:30+00:00"
},
{
"name": "creativeorange/gravatar",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_util.git",
- "reference": "2b3f590546da10edc98c719b99f5d802f29098f2"
+ "reference": "5707c953b156499432ada9197f7b4c7c6e6dd9ce"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-d27dbc.tar",
- "reference": "2b3f590546da10edc98c719b99f5d802f29098f2",
- "shasum": "542f6c66ec2f1a1918a0187c03c6dc117f6d8e16"
+ "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-ee0a7c.tar",
+ "reference": "5707c953b156499432ada9197f7b4c7c6e6dd9ce",
+ "shasum": "2c903a3859779eb8274250d090526bb5e96854f3"
},
"require": {
"cubist/net": "dev-master",
}
],
"description": "Utilities class",
- "time": "2025-08-07T16:12:56+00:00"
+ "time": "2025-08-28T08:53:02+00:00"
},
{
"name": "cviebrock/eloquent-sluggable",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/fluidbook_tools.git",
- "reference": "b2e0e8f5313a053510a64f3fbd73101f38b82c0f"
+ "reference": "4b50779b7ffc47e0778ffa4ebeac19ac6e8f19f1"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-bef312.tar",
- "reference": "b2e0e8f5313a053510a64f3fbd73101f38b82c0f",
- "shasum": "fa89fef484bc1dad8ec4b2b0f8b0e3a262df5576"
+ "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-91e247.tar",
+ "reference": "4b50779b7ffc47e0778ffa4ebeac19ac6e8f19f1",
+ "shasum": "cd0919839d475d13509d6671a3cc525045bb76eb"
},
"require": {
"barryvdh/laravel-debugbar": "*",
}
],
"description": "Fluidbook Tools",
- "time": "2025-08-07T14:13:43+00:00"
+ "time": "2025-08-26T15:29:06+00:00"
},
{
"name": "fpdf/fpdf",
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.9.3",
+ "version": "7.10.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
+ "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
- "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
+ "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
- "guzzlehttp/psr7": "^2.7.0",
+ "guzzlehttp/promises": "^2.3",
+ "guzzlehttp/psr7": "^2.8",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.9.3"
+ "source": "https://github.com/guzzle/guzzle/tree/7.10.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2025-03-27T13:37:11+00:00"
+ "time": "2025-08-23T22:36:01+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "2.2.0",
+ "version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
+ "reference": "481557b130ef3790cf82b713667b43030dc9c957"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
- "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957",
+ "reference": "481557b130ef3790cf82b713667b43030dc9c957",
"shasum": ""
},
"require": {
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.39 || ^9.6.20"
+ "phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"type": "library",
"extra": {
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/2.2.0"
+ "source": "https://github.com/guzzle/promises/tree/2.3.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2025-03-27T13:27:01+00:00"
+ "time": "2025-08-22T14:34:08+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "2.7.1",
+ "version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
+ "reference": "21dc724a0583619cd1652f673303492272778051"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
- "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051",
+ "reference": "21dc724a0583619cd1652f673303492272778051",
"shasum": ""
},
"require": {
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
- "phpunit/phpunit": "^8.5.39 || ^9.6.20"
+ "phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.7.1"
+ "source": "https://github.com/guzzle/psr7/tree/2.8.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2025-03-27T12:30:47+00:00"
+ "time": "2025-08-23T21:21:41+00:00"
},
{
"name": "guzzlehttp/uri-template",
- "version": "v1.0.4",
+ "version": "v1.0.5",
"source": {
"type": "git",
"url": "https://github.com/guzzle/uri-template.git",
- "reference": "30e286560c137526eccd4ce21b2de477ab0676d2"
+ "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/uri-template/zipball/30e286560c137526eccd4ce21b2de477ab0676d2",
- "reference": "30e286560c137526eccd4ce21b2de477ab0676d2",
+ "url": "https://api.github.com/repos/guzzle/uri-template/zipball/4f4bbd4e7172148801e76e3decc1e559bdee34e1",
+ "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1",
"shasum": ""
},
"require": {
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15",
+ "phpunit/phpunit": "^8.5.44 || ^9.6.25",
"uri-template/tests": "1.0.0"
},
"type": "library",
],
"support": {
"issues": "https://github.com/guzzle/uri-template/issues",
- "source": "https://github.com/guzzle/uri-template/tree/v1.0.4"
+ "source": "https://github.com/guzzle/uri-template/tree/v1.0.5"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2025-02-03T10:55:03+00:00"
+ "time": "2025-08-22T14:27:06+00:00"
},
{
"name": "hollodotme/fast-cgi-client",
},
{
"name": "phpoption/phpoption",
- "version": "1.9.3",
+ "version": "1.9.4",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
- "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54"
+ "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54",
- "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54",
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d",
+ "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d",
"shasum": ""
},
"require": {
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
+ "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
},
"type": "library",
"extra": {
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
- "source": "https://github.com/schmittjoh/php-option/tree/1.9.3"
+ "source": "https://github.com/schmittjoh/php-option/tree/1.9.4"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2024-07-20T21:41:07+00:00"
+ "time": "2025-08-21T11:53:16+00:00"
},
{
"name": "pnz/json-exception",
},
{
"name": "composer/class-map-generator",
- "version": "1.6.1",
+ "version": "1.6.2",
"source": {
"type": "git",
"url": "https://github.com/composer/class-map-generator.git",
- "reference": "134b705ddb0025d397d8318a75825fe3c9d1da34"
+ "reference": "ba9f089655d4cdd64e762a6044f411ccdaec0076"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/class-map-generator/zipball/134b705ddb0025d397d8318a75825fe3c9d1da34",
- "reference": "134b705ddb0025d397d8318a75825fe3c9d1da34",
+ "url": "https://api.github.com/repos/composer/class-map-generator/zipball/ba9f089655d4cdd64e762a6044f411ccdaec0076",
+ "reference": "ba9f089655d4cdd64e762a6044f411ccdaec0076",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/composer/class-map-generator/issues",
- "source": "https://github.com/composer/class-map-generator/tree/1.6.1"
+ "source": "https://github.com/composer/class-map-generator/tree/1.6.2"
},
"funding": [
{
{
"url": "https://github.com/composer",
"type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/composer/composer",
- "type": "tidelift"
}
],
- "time": "2025-03-24T13:50:44+00:00"
+ "time": "2025-08-20T18:52:43+00:00"
},
{
"name": "doctrine/instantiator",
},
{
"name": "phpunit/phpunit",
- "version": "9.6.24",
+ "version": "9.6.25",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701"
+ "reference": "049c011e01be805202d8eebedef49f769a8ec7b7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea49afa29aeea25ea7bf9de9fdd7cab163cc0701",
- "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/049c011e01be805202d8eebedef49f769a8ec7b7",
+ "reference": "049c011e01be805202d8eebedef49f769a8ec7b7",
"shasum": ""
},
"require": {
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.24"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.25"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2025-08-10T08:32:42+00:00"
+ "time": "2025-08-20T14:38:31+00:00"
},
{
"name": "psy/psysh",
},
{
"name": "spatie/backtrace",
- "version": "1.7.4",
+ "version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/backtrace.git",
- "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe"
+ "reference": "8c0f16a59ae35ec8c62d85c3c17585158f430110"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/backtrace/zipball/cd37a49fce7137359ac30ecc44ef3e16404cccbe",
- "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe",
+ "url": "https://api.github.com/repos/spatie/backtrace/zipball/8c0f16a59ae35ec8c62d85c3c17585158f430110",
+ "reference": "8c0f16a59ae35ec8c62d85c3c17585158f430110",
"shasum": ""
},
"require": {
"spatie"
],
"support": {
- "source": "https://github.com/spatie/backtrace/tree/1.7.4"
+ "issues": "https://github.com/spatie/backtrace/issues",
+ "source": "https://github.com/spatie/backtrace/tree/1.8.1"
},
"funding": [
{
"type": "other"
}
],
- "time": "2025-05-08T15:41:09+00:00"
+ "time": "2025-08-26T08:22:30+00:00"
},
{
"name": "spatie/error-solutions",