diff --git a/app/Console/Commands/initDrive.php b/app/Console/Commands/initDrive.php
new file mode 100644
index 00000000..be6a16ef
--- /dev/null
+++ b/app/Console/Commands/initDrive.php
@@ -0,0 +1,58 @@
+createDir('Systeme');
+ \Storage::cloud()->createDir('Systeme/Fichier');
+ \Storage::cloud()->createDir('Systeme/Fichier/PlanDeCours');
+ \Storage::cloud()->createDir('Systeme/Fichier/MessageDeLaSemaine');
+ \Storage::cloud()->createDir('Prive');
+ \Storage::cloud()->createDir('Prive/Cadet');
+ \Storage::cloud()->createDir('Prive/ETAMAS');
+ \Storage::cloud()->createDir('Prive/Officier');
+ \Storage::cloud()->createDir('Prive/Staff');
+ \Storage::cloud()->createDir('Prive/Staff/Guide');
+ \Storage::cloud()->createDir('Prive/Staff/Instruction');
+ \Storage::cloud()->createDir('Publique');
+ \Storage::cloud()->createDir('Publique/Fichier');
+ \Storage::cloud()->createDir('Publique/Image');
+
+ return "Drive is initialized";
+ }
+}
diff --git a/app/Http/Controllers/FilesController.php b/app/Http/Controllers/FilesController.php
index af391b5f..ef4b5c7c 100644
--- a/app/Http/Controllers/FilesController.php
+++ b/app/Http/Controllers/FilesController.php
@@ -41,12 +41,21 @@ class FilesController extends Controller
/**
* Display the specified resource.
*
- * @param int $id
- * @return \Illuminate\Http\Response
+ * @param string $id
+ * @return void
*/
- public function show($id)
+ public function show($path)
{
- //
+ $file_rules = \DB::table('acl_rules')->where('path','=',$path)->get()->all();
+ if ($file_rules != []) {
+ dd($file_rules);
+ }
+ dd(dirname($path));
+ $path_rules = \DB::table('acl_rules')->where('path','=',dirname($path))->get()->all();
+ if ($path_rules != []) {
+
+ }
+ return abort(404);
}
/**
diff --git a/app/Services/DBACLRepository.php b/app/Services/DBACLRepository.php
new file mode 100644
index 00000000..4769efca
--- /dev/null
+++ b/app/Services/DBACLRepository.php
@@ -0,0 +1,72 @@
+rank_id;
+ }
+
+ public function getUserJobs()
+ {
+ return \Auth::user()->job_id;
+ }
+
+ /**
+ * Get ACL rules list for user
+ *
+ * @return array
+ */
+ public function getRules(): array
+ {
+ $rules = \DB::table('acl_rules')
+ ->where('user_id', $this->getUserID())
+ ->get(['disk', 'path', 'access'])
+ ->map(function ($item) {
+ return get_object_vars($item);
+ })
+ ->all();
+ $rank_rules = \DB::table('acl_rules')
+ ->where('rank_id', $this->getUserRank())
+ ->get(['disk', 'path', 'access'])
+ ->map(function ($item) {
+ return get_object_vars($item);
+ })
+ ->all();
+ $job_rules = \DB::table('acl_rules')
+ ->where('job_id', $this->getUserJobs())
+ ->get(['disk', 'path', 'access'])
+ ->map(function ($item) {
+ return get_object_vars($item);
+ })
+ ->all();
+ $all_rules = \DB::table('acl_rules')
+ ->where('user_id', '=','*')
+ ->get(['disk', 'path', 'access'])
+ ->map(function ($item) {
+ return get_object_vars($item);
+ })
+ ->all();
+ $rules = array_merge($rules,$rank_rules,$job_rules,$all_rules);
+ return $rules;
+ }
+}
diff --git a/composer.json b/composer.json
index f4768c77..cd1454a6 100644
--- a/composer.json
+++ b/composer.json
@@ -6,6 +6,7 @@
"type": "project",
"require": {
"php": "^7.4",
+ "alexusmai/laravel-file-manager": "^2.5",
"barryvdh/laravel-dompdf": "^0.8.4",
"barryvdh/laravel-ide-helper": "2.7.0",
"davejamesmiller/laravel-breadcrumbs": "5.3.2",
@@ -18,7 +19,7 @@
"laravel/telescope": "^3.5",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
- "nao-pon/flysystem-google-drive": "^1.1",
+ "league/flysystem-aws-s3-v3": "^1.0",
"nexmo/client": "^2.0",
"pragmarx/version": "^1.2",
"pusher/pusher-php-server": "~4.0"
diff --git a/composer.lock b/composer.lock
index a22989bc..5ef15919 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,149 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1039ad9d19c53cf0ed27db80f8923088",
+ "content-hash": "4e4d47094f39b610230a839985ba375a",
"packages": [
+ {
+ "name": "alexusmai/laravel-file-manager",
+ "version": "v2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/alexusmai/laravel-file-manager.git",
+ "reference": "f5c948d02cd2b97653d6c767b4ac736a771ab588"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/alexusmai/laravel-file-manager/zipball/f5c948d02cd2b97653d6c767b4ac736a771ab588",
+ "reference": "f5c948d02cd2b97653d6c767b4ac736a771ab588",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "ext-zip": "*",
+ "intervention/image": "^2.4",
+ "intervention/imagecache": "^2.3",
+ "laravel/framework": "^5.5|^6.0|^7.0",
+ "league/flysystem": "^1.0",
+ "php": ">=7.1.0"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Alexusmai\\LaravelFileManager\\FileManagerServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Alexusmai\\LaravelFileManager\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Aleksandr Manekin",
+ "email": "alexusmai@gmail.com",
+ "role": "Developer"
+ }
+ ],
+ "description": "File manager for Laravel",
+ "homepage": "https://github.com/alexusami/laravel-file-manager",
+ "keywords": [
+ "file",
+ "laravel 5",
+ "manager"
+ ],
+ "time": "2020-06-30T07:50:58+00:00"
+ },
+ {
+ "name": "aws/aws-sdk-php",
+ "version": "3.147.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/aws/aws-sdk-php.git",
+ "reference": "b259aad35203d262c02be9b6353597fd62484374"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b259aad35203d262c02be9b6353597fd62484374",
+ "reference": "b259aad35203d262c02be9b6353597fd62484374",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-simplexml": "*",
+ "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
+ "guzzlehttp/promises": "^1.0",
+ "guzzlehttp/psr7": "^1.4.1",
+ "mtdowling/jmespath.php": "^2.5",
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "andrewsville/php-token-reflection": "^1.4",
+ "aws/aws-php-sns-message-validator": "~1.0",
+ "behat/behat": "~3.0",
+ "doctrine/cache": "~1.4",
+ "ext-dom": "*",
+ "ext-openssl": "*",
+ "ext-pcntl": "*",
+ "ext-sockets": "*",
+ "nette/neon": "^2.3",
+ "paragonie/random_compat": ">= 2",
+ "phpunit/phpunit": "^4.8.35|^5.4.3",
+ "psr/cache": "^1.0",
+ "psr/simple-cache": "^1.0",
+ "sebastian/comparator": "^1.2.3"
+ },
+ "suggest": {
+ "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
+ "doctrine/cache": "To use the DoctrineCacheAdapter",
+ "ext-curl": "To send requests using cURL",
+ "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
+ "ext-sockets": "To use client-side monitoring"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Aws\\": "src/"
+ },
+ "files": [
+ "src/functions.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Amazon Web Services",
+ "homepage": "http://aws.amazon.com"
+ }
+ ],
+ "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
+ "homepage": "http://aws.amazon.com/sdkforphp",
+ "keywords": [
+ "amazon",
+ "aws",
+ "cloud",
+ "dynamodb",
+ "ec2",
+ "glacier",
+ "s3",
+ "sdk"
+ ],
+ "time": "2020-07-31T18:32:20+00:00"
+ },
{
"name": "barryvdh/laravel-dompdf",
"version": "v0.8.6",
@@ -1588,206 +1729,6 @@
],
"time": "2020-06-14T09:00:00+00:00"
},
- {
- "name": "firebase/php-jwt",
- "version": "v5.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/firebase/php-jwt.git",
- "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb",
- "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": ">=4.8 <=9"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Firebase\\JWT\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Neuman Vong",
- "email": "neuman+pear@twilio.com",
- "role": "Developer"
- },
- {
- "name": "Anant Narayanan",
- "email": "anant@php.net",
- "role": "Developer"
- }
- ],
- "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
- "homepage": "https://github.com/firebase/php-jwt",
- "keywords": [
- "jwt",
- "php"
- ],
- "time": "2020-03-25T18:49:23+00:00"
- },
- {
- "name": "google/apiclient",
- "version": "v2.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/googleapis/google-api-php-client.git",
- "reference": "9ab9cc07f66e2c7274ea2753f102ae24d1271410"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/9ab9cc07f66e2c7274ea2753f102ae24d1271410",
- "reference": "9ab9cc07f66e2c7274ea2753f102ae24d1271410",
- "shasum": ""
- },
- "require": {
- "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0",
- "google/apiclient-services": "~0.13",
- "google/auth": "^1.9",
- "guzzlehttp/guzzle": "~5.3.1||~6.0",
- "guzzlehttp/psr7": "^1.2",
- "monolog/monolog": "^1.17|^2.0",
- "php": ">=5.4",
- "phpseclib/phpseclib": "~0.3.10||~2.0"
- },
- "require-dev": {
- "cache/filesystem-adapter": "^0.3.2",
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
- "phpcompatibility/php-compatibility": "^9.2",
- "phpunit/phpunit": "^4.8|^5.0",
- "squizlabs/php_codesniffer": "~2.3",
- "symfony/css-selector": "~2.1",
- "symfony/dom-crawler": "~2.1"
- },
- "suggest": {
- "cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Google_": "src/"
- },
- "classmap": [
- "src/Google/Service/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "description": "Client library for Google APIs",
- "homepage": "http://developers.google.com/api-client-library/php",
- "keywords": [
- "google"
- ],
- "time": "2020-05-26T22:29:38+00:00"
- },
- {
- "name": "google/apiclient-services",
- "version": "v0.139",
- "source": {
- "type": "git",
- "url": "https://github.com/googleapis/google-api-php-client-services.git",
- "reference": "84e99f792cae7bd92b8b54c75b0ad3502d628db6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/84e99f792cae7bd92b8b54c75b0ad3502d628db6",
- "reference": "84e99f792cae7bd92b8b54c75b0ad3502d628db6",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8|^5"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Google_Service_": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "description": "Client library for Google APIs",
- "homepage": "http://developers.google.com/api-client-library/php",
- "keywords": [
- "google"
- ],
- "time": "2020-06-08T00:24:31+00:00"
- },
- {
- "name": "google/auth",
- "version": "v1.9.0",
- "source": {
- "type": "git",
- "url": "https://github.com/googleapis/google-auth-library-php.git",
- "reference": "af4abf63988b8c74f589bee1e69ba310d3e43c6c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/af4abf63988b8c74f589bee1e69ba310d3e43c6c",
- "reference": "af4abf63988b8c74f589bee1e69ba310d3e43c6c",
- "shasum": ""
- },
- "require": {
- "firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0",
- "guzzlehttp/guzzle": "~5.3.1|~6.0",
- "guzzlehttp/psr7": "^1.2",
- "php": ">=5.4",
- "psr/cache": "^1.0",
- "psr/http-message": "^1.0"
- },
- "require-dev": {
- "guzzlehttp/promises": "0.1.1|^1.3",
- "kelvinmo/simplejwt": "^0.2.5",
- "phpseclib/phpseclib": "^2",
- "phpunit/phpunit": "^4.8.36|^5.7",
- "sebastian/comparator": ">=1.2.3",
- "squizlabs/php_codesniffer": "^3.5"
- },
- "suggest": {
- "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Google\\Auth\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "description": "Google Auth Library for PHP",
- "homepage": "http://github.com/google/google-auth-library-php",
- "keywords": [
- "Authentication",
- "google",
- "oauth2"
- ],
- "time": "2020-05-18T17:02:59+00:00"
- },
{
"name": "guzzlehttp/guzzle",
"version": "6.5.5",
@@ -1977,6 +1918,189 @@
],
"time": "2019-07-01T23:21:34+00:00"
},
+ {
+ "name": "intervention/image",
+ "version": "2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Intervention/image.git",
+ "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
+ "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-fileinfo": "*",
+ "guzzlehttp/psr7": "~1.1",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "~0.9.2",
+ "phpunit/phpunit": "^4.8 || ^5.7"
+ },
+ "suggest": {
+ "ext-gd": "to use GD library based image processing.",
+ "ext-imagick": "to use Imagick based image processing.",
+ "intervention/imagecache": "Caching extension for the Intervention Image library"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ },
+ "laravel": {
+ "providers": [
+ "Intervention\\Image\\ImageServiceProvider"
+ ],
+ "aliases": {
+ "Image": "Intervention\\Image\\Facades\\Image"
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Intervention\\Image\\": "src/Intervention/Image"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Oliver Vogel",
+ "email": "oliver@olivervogel.com",
+ "homepage": "http://olivervogel.com/"
+ }
+ ],
+ "description": "Image handling and manipulation library with support for Laravel integration",
+ "homepage": "http://image.intervention.io/",
+ "keywords": [
+ "gd",
+ "image",
+ "imagick",
+ "laravel",
+ "thumbnail",
+ "watermark"
+ ],
+ "time": "2019-11-02T09:15:47+00:00"
+ },
+ {
+ "name": "intervention/imagecache",
+ "version": "2.4.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Intervention/imagecache.git",
+ "reference": "d3dadc8052702805ba2b8ffb11e0b05c1f5d2873"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Intervention/imagecache/zipball/d3dadc8052702805ba2b8ffb11e0b05c1f5d2873",
+ "reference": "d3dadc8052702805ba2b8ffb11e0b05c1f5d2873",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/cache": "~4|~5|~6|~7",
+ "illuminate/filesystem": "~4|~5|~6|~7",
+ "intervention/image": "dev-master|~2,>=2.2.0",
+ "jeremeamia/superclosure": "~1|~2",
+ "nesbot/carbon": "^1.26.3 || ^2.0",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "~0.9.2",
+ "phpunit/phpunit": "3.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Intervention\\Image\\": "src/Intervention/Image"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Oliver Vogel",
+ "email": "oliver@olivervogel.net",
+ "homepage": "http://olivervogel.net/"
+ }
+ ],
+ "description": "Caching extension for the Intervention Image Class",
+ "homepage": "http://image.intervention.io",
+ "keywords": [
+ "cache",
+ "gd",
+ "image",
+ "imagick",
+ "laravel"
+ ],
+ "time": "2020-07-05T18:27:20+00:00"
+ },
+ {
+ "name": "jeremeamia/superclosure",
+ "version": "2.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/jeremeamia/super_closure.git",
+ "reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
+ "reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^1.2|^2.0|^3.0|^4.0",
+ "php": ">=5.4",
+ "symfony/polyfill-php56": "^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0|^5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "SuperClosure\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jeremy Lindblom",
+ "email": "jeremeamia@gmail.com",
+ "homepage": "https://github.com/jeremeamia",
+ "role": "Developer"
+ }
+ ],
+ "description": "Serialize Closure objects, including their context and binding",
+ "homepage": "https://github.com/jeremeamia/super_closure",
+ "keywords": [
+ "closure",
+ "function",
+ "lambda",
+ "parser",
+ "serializable",
+ "serialize",
+ "tokenizer"
+ ],
+ "abandoned": "opis/closure",
+ "time": "2018-03-21T22:21:57+00:00"
+ },
{
"name": "justinrainbow/json-schema",
"version": "5.2.10",
@@ -2659,16 +2783,16 @@
},
{
"name": "league/flysystem",
- "version": "1.0.69",
+ "version": "1.0.70",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
- "reference": "7106f78428a344bc4f643c233a94e48795f10967"
+ "reference": "585824702f534f8d3cf7fab7225e8466cc4b7493"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7106f78428a344bc4f643c233a94e48795f10967",
- "reference": "7106f78428a344bc4f643c233a94e48795f10967",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/585824702f534f8d3cf7fab7225e8466cc4b7493",
+ "reference": "585824702f534f8d3cf7fab7225e8466cc4b7493",
"shasum": ""
},
"require": {
@@ -2679,7 +2803,7 @@
"league/flysystem-sftp": "<1.0.6"
},
"require-dev": {
- "phpspec/phpspec": "^3.4",
+ "phpspec/phpspec": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"phpunit/phpunit": "^5.7.26"
},
"suggest": {
@@ -2745,40 +2869,40 @@
"type": "other"
}
],
- "time": "2020-05-18T15:13:39+00:00"
+ "time": "2020-07-26T07:20:36+00:00"
},
{
- "name": "league/flysystem-cached-adapter",
- "version": "1.0.9",
+ "name": "league/flysystem-aws-s3-v3",
+ "version": "1.0.25",
"source": {
"type": "git",
- "url": "https://github.com/thephpleague/flysystem-cached-adapter.git",
- "reference": "08ef74e9be88100807a3b92cc9048a312bf01d6f"
+ "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
+ "reference": "d409b97a50bf85fbde30cbc9fc10237475e696ea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/08ef74e9be88100807a3b92cc9048a312bf01d6f",
- "reference": "08ef74e9be88100807a3b92cc9048a312bf01d6f",
+ "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/d409b97a50bf85fbde30cbc9fc10237475e696ea",
+ "reference": "d409b97a50bf85fbde30cbc9fc10237475e696ea",
"shasum": ""
},
"require": {
- "league/flysystem": "~1.0",
- "psr/cache": "^1.0.0"
+ "aws/aws-sdk-php": "^3.0.0",
+ "league/flysystem": "^1.0.40",
+ "php": ">=5.5.0"
},
"require-dev": {
- "mockery/mockery": "~0.9",
- "phpspec/phpspec": "^3.4",
- "phpunit/phpunit": "^5.7",
- "predis/predis": "~1.0",
- "tedivm/stash": "~0.12"
- },
- "suggest": {
- "ext-phpredis": "Pure C implemented extension for PHP"
+ "henrikbjorn/phpspec-code-coverage": "~1.0.1",
+ "phpspec/phpspec": "^2.0.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"psr-4": {
- "League\\Flysystem\\Cached\\": "src/"
+ "League\\Flysystem\\AwsS3v3\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2787,25 +2911,25 @@
],
"authors": [
{
- "name": "frankdejonge",
+ "name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
- "description": "An adapter decorator to enable meta-data caching.",
- "time": "2018-07-09T20:51:04+00:00"
+ "description": "Flysystem adapter for the AWS S3 SDK v3.x",
+ "time": "2020-06-02T18:41:58+00:00"
},
{
"name": "monolog/monolog",
- "version": "2.1.0",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "38914429aac460e8e4616c8cb486ecb40ec90bb1"
+ "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/38914429aac460e8e4616c8cb486ecb40ec90bb1",
- "reference": "38914429aac460e8e4616c8cb486ecb40ec90bb1",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5",
+ "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5",
"shasum": ""
},
"require": {
@@ -2883,7 +3007,7 @@
"type": "tidelift"
}
],
- "time": "2020-05-22T08:12:19+00:00"
+ "time": "2020-07-23T08:41:23+00:00"
},
{
"name": "moontoast/math",
@@ -2937,81 +3061,43 @@
"time": "2020-01-05T04:49:34+00:00"
},
{
- "name": "nao-pon/flysystem-cached-extra",
- "version": "1.0.3",
+ "name": "mtdowling/jmespath.php",
+ "version": "2.6.0",
"source": {
"type": "git",
- "url": "https://github.com/nao-pon/flysystem-cached-extra.git",
- "reference": "189abdafa0a86d92781e148ee8740ef80f4c5859"
+ "url": "https://github.com/jmespath/jmespath.php.git",
+ "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nao-pon/flysystem-cached-extra/zipball/189abdafa0a86d92781e148ee8740ef80f4c5859",
- "reference": "189abdafa0a86d92781e148ee8740ef80f4c5859",
+ "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
+ "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
"shasum": ""
},
"require": {
- "league/flysystem-cached-adapter": "~1.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Hypweb\\Flysystem\\Cached\\Extra\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Naoki Sawada",
- "email": "hypweb@gmail.com"
- }
- ],
- "description": "Extra traits for Flysystem cached adapter",
- "time": "2018-02-16T01:44:38+00:00"
- },
- {
- "name": "nao-pon/flysystem-google-drive",
- "version": "1.1.12",
- "source": {
- "type": "git",
- "url": "https://github.com/nao-pon/flysystem-google-drive.git",
- "reference": "f55cd5edc52f767bb612c615189e2b52e459721d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/nao-pon/flysystem-google-drive/zipball/f55cd5edc52f767bb612c615189e2b52e459721d",
- "reference": "f55cd5edc52f767bb612c615189e2b52e459721d",
- "shasum": ""
- },
- "require": {
- "google/apiclient": "^2.0",
- "league/flysystem": "~1.0",
- "nao-pon/flysystem-cached-extra": "~1.0",
- "php": ">=5.4.0"
+ "php": "^5.4 || ^7.0 || ^8.0",
+ "symfony/polyfill-mbstring": "^1.17"
},
"require-dev": {
- "mockery/mockery": "0.9.*",
- "phpunit/phpunit": "~4.0"
+ "composer/xdebug-handler": "^1.4",
+ "phpunit/phpunit": "^4.8.36 || ^7.5.15"
},
+ "bin": [
+ "bin/jp.php"
+ ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-api_v2": "1.0.x-dev",
- "dev-master": "1.1.x-dev"
+ "dev-master": "2.6-dev"
}
},
"autoload": {
"psr-4": {
- "Hypweb\\Flysystem\\GoogleDrive\\": "src/"
- }
+ "JmesPath\\": "src/"
+ },
+ "files": [
+ "src/JmesPath.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3019,12 +3105,17 @@
],
"authors": [
{
- "name": "Naoki Sawada",
- "email": "hypweb@gmail.com"
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
}
],
- "description": "Flysystem adapter for Google Drive",
- "time": "2020-03-05T02:25:41+00:00"
+ "description": "Declaratively specify how to extract elements from a JSON document",
+ "keywords": [
+ "json",
+ "jsonpath"
+ ],
+ "time": "2020-07-31T21:01:56+00:00"
},
{
"name": "nesbot/carbon",
@@ -3956,16 +4047,16 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "2.0.27",
+ "version": "2.0.28",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc"
+ "reference": "d1ca58cf33cb21046d702ae3a7b14fdacd9f3260"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
- "reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d1ca58cf33cb21046d702ae3a7b14fdacd9f3260",
+ "reference": "d1ca58cf33cb21046d702ae3a7b14fdacd9f3260",
"shasum": ""
},
"require": {
@@ -4058,7 +4149,7 @@
"type": "tidelift"
}
],
- "time": "2020-04-04T23:17:33+00:00"
+ "time": "2020-07-08T09:08:33+00:00"
},
{
"name": "pragmarx/version",
@@ -4184,52 +4275,6 @@
],
"time": "2020-05-21T19:46:28+00:00"
},
- {
- "name": "psr/cache",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/cache.git",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Cache\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for caching libraries",
- "keywords": [
- "cache",
- "psr",
- "psr-6"
- ],
- "time": "2016-08-06T20:24:11+00:00"
- },
{
"name": "psr/container",
"version": "1.0.0",
@@ -6456,6 +6501,80 @@
],
"time": "2020-05-12T16:47:27+00:00"
},
+ {
+ "name": "symfony/polyfill-php56",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php56.git",
+ "reference": "13df84e91cd168f247c2f2ec82cc0fa24901c011"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/13df84e91cd168f247c2f2ec82cc0fa24901c011",
+ "reference": "13df84e91cd168f247c2f2ec82cc0fa24901c011",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/polyfill-util": "~1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php56\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
+ },
{
"name": "symfony/polyfill-php72",
"version": "v1.17.0",
@@ -6673,6 +6792,76 @@
],
"time": "2020-05-12T16:47:27+00:00"
},
+ {
+ "name": "symfony/polyfill-util",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-util.git",
+ "reference": "46b910c71e9828f8ec2aa7a0314de1130d9b295a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/46b910c71e9828f8ec2aa7a0314de1130d9b295a",
+ "reference": "46b910c71e9828f8ec2aa7a0314de1130d9b295a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Util\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony utilities for portability of PHP codes",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compat",
+ "compatibility",
+ "polyfill",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
+ },
{
"name": "symfony/process",
"version": "v5.1.2",
diff --git a/config/app.php b/config/app.php
index 935a268a..54986a11 100644
--- a/config/app.php
+++ b/config/app.php
@@ -63,7 +63,7 @@ return [
|
*/
- 'version' => "3.2.5.",
+ 'version' => "3.2.6.",
/*
|--------------------------------------------------------------------------
diff --git a/config/file-manager.php b/config/file-manager.php
new file mode 100644
index 00000000..846810c9
--- /dev/null
+++ b/config/file-manager.php
@@ -0,0 +1,168 @@
+ DefaultConfigRepository::class,
+
+ /**
+ * ACL rules repository
+ *
+ * Default - ConfigACLRepository (see rules in - aclRules)
+ */
+ 'aclRepository' => \App\Services\DBACLRepository::class,
+
+ //********* Default configuration for DefaultConfigRepository **************
+
+ /**
+ * LFM Route prefix
+ * !!! WARNING - if you change it, you should compile frontend with new prefix(baseUrl) !!!
+ */
+ 'routePrefix' => 'file-manager',
+
+ /**
+ * List of disk names that you want to use
+ * (from config/filesystems)
+ */
+ 'diskList' => ['storage'],
+
+ /**
+ * Default disk for left manager
+ *
+ * null - auto select the first disk in the disk list
+ */
+ 'leftDisk' => null,
+
+ /**
+ * Default disk for right manager
+ *
+ * null - auto select the first disk in the disk list
+ */
+ 'rightDisk' => null,
+
+ /**
+ * Default path for left manager
+ *
+ * null - root directory
+ */
+ 'leftPath' => null,
+
+ /**
+ * Default path for right manager
+ *
+ * null - root directory
+ */
+ 'rightPath' => null,
+
+ /**
+ * Image cache ( Intervention Image Cache )
+ *
+ * set null, 0 - if you don't need cache (default)
+ * if you want use cache - set the number of minutes for which the value should be cached
+ */
+ 'cache' => null,
+
+ /**
+ * File manager modules configuration
+ *
+ * 1 - only one file manager window
+ * 2 - one file manager window with directories tree module
+ * 3 - two file manager windows
+ */
+ 'windowsConfig' => 2,
+
+ /**
+ * File upload - Max file size in KB
+ *
+ * null - no restrictions
+ */
+ 'maxUploadFileSize' => null,
+
+ /**
+ * File upload - Allow these file types
+ *
+ * [] - no restrictions
+ */
+ 'allowFileTypes' => [],
+
+ /**
+ * Show / Hide system files and folders
+ */
+ 'hiddenFiles' => true,
+
+ /***************************************************************************
+ * Middleware
+ *
+ * Add your middleware name to array -> ['web', 'auth', 'admin']
+ * !!!! RESTRICT ACCESS FOR NON ADMIN USERS !!!!
+ */
+ 'middleware' => ['web','auth'],
+
+ /***************************************************************************
+ * ACL mechanism ON/OFF
+ *
+ * default - false(OFF)
+ */
+ 'acl' => true,
+
+ /**
+ * Hide files and folders from file-manager if user doesn't have access
+ *
+ * ACL access level = 0
+ */
+ 'aclHideFromFM' => true,
+
+ /**
+ * ACL strategy
+ *
+ * blacklist - Allow everything(access - 2 - r/w) that is not forbidden by the ACL rules list
+ *
+ * whitelist - Deny anything(access - 0 - deny), that not allowed by the ACL rules list
+ */
+ 'aclStrategy' => 'whitelist',
+
+ /**
+ * ACL Rules cache
+ *
+ * null or value in minutes
+ */
+ 'aclRulesCache' => null,
+
+ //********* Default configuration for DefaultConfigRepository END **********
+
+
+ /***************************************************************************
+ * ACL rules list - used for default ACL repository (ConfigACLRepository)
+ *
+ * 1 it's user ID
+ * null - for not authenticated user
+ *
+ * 'disk' => 'disk-name'
+ *
+ * 'path' => 'folder-name'
+ * 'path' => 'folder1*' - select folder1, folder12, folder1/sub-folder, ...
+ * 'path' => 'folder2/*' - select folder2/sub-folder,... but not select folder2 !!!
+ * 'path' => 'folder-name/file-name.jpg'
+ * 'path' => 'folder-name/*.jpg'
+ *
+ * * - wildcard
+ *
+ * access: 0 - deny, 1 - read, 2 - read/write
+ */
+ 'aclRules' => [
+ null => [
+ //['disk' => 'public', 'path' => '/', 'access' => 2],
+ ],
+ 1 => [
+ //['disk' => 'public', 'path' => 'images/arch*.jpg', 'access' => 2],
+ //['disk' => 'public', 'path' => 'files/*', 'access' => 1],
+ ],
+ ],
+];
diff --git a/config/filesystems.php b/config/filesystems.php
index 87dbb1bd..9c6a1226 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -26,7 +26,7 @@ return [
|
*/
- 'cloud' => env('FILESYSTEM_CLOUD', 'google'),
+ 'cloud' => env('FILESYSTEM_CLOUD', 'storage'),
/*
|--------------------------------------------------------------------------
@@ -48,22 +48,15 @@ return [
'root' => storage_path('app'),
],
- 'public' => [
- 'driver' => 'local',
- 'root' => storage_path('app/public'),
- 'url' => env('APP_URL').'/storage',
- 'visibility' => 'public',
+ 'storage' => [
+ 'driver' => 's3',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION'),
+ 'bucket' => env('AWS_BUCKET'),
+ 'url' => env('AWS_URL'),
+ 'endpoint' => env('AWS_ENDPOINT'),
],
-
- 'google' => [
- 'driver' => 'google',
- 'clientId' => '',
- 'clientSecret' => '',
- 'refreshToken' => '',
- 'folderId' => '',
- // 'teamDriveId' => env('GOOGLE_DRIVE_TEAM_DRIVE_ID'),
- ],
-
],
];
diff --git a/config/version.yml b/config/version.yml
index 65fd21ce..abed2eab 100644
--- a/config/version.yml
+++ b/config/version.yml
@@ -5,7 +5,7 @@ current:
major: 3
minor: 2
patch: 5
- prerelease: 15-g8158f8a8
+ prerelease: 16-gd8e36b84
buildmetadata: ''
commit: 41845
timestamp:
diff --git a/database/migrations/2019_02_06_174631_make_acl_rules_table.php b/database/migrations/2019_02_06_174631_make_acl_rules_table.php
new file mode 100644
index 00000000..83495f31
--- /dev/null
+++ b/database/migrations/2019_02_06_174631_make_acl_rules_table.php
@@ -0,0 +1,37 @@
+increments('id');
+ $table->string('user_id')->nullable();
+ $table->string('rank_id')->nullable();
+ $table->string('job_id')->nullable();
+ $table->string('disk');
+ $table->string('path');
+ $table->tinyInteger('access');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('acl_rules');
+ }
+}
diff --git a/database/seeds/ACLTableSeeder.php b/database/seeds/ACLTableSeeder.php
new file mode 100644
index 00000000..933d95c8
--- /dev/null
+++ b/database/seeds/ACLTableSeeder.php
@@ -0,0 +1,49 @@
+insert([
+ [
+ 'user_id' => '*',
+ 'rank_id' => '0',
+ 'job_id' => '0',
+ 'disk' => 'storage',
+ 'path' => '/',
+ 'access' => '1'
+ ],
+ [
+ 'user_id' => '*',
+ 'rank_id' => '0',
+ 'job_id' => '0',
+ 'disk' => 'storage',
+ 'path' => 'Publique',
+ 'access' => '1'
+ ],
+ [
+ 'user_id' => '*',
+ 'rank_id' => '0',
+ 'job_id' => '0',
+ 'disk' => 'storage',
+ 'path' => 'Publique/*',
+ 'access' => '1'
+ ],
+ [
+ 'user_id' => '0',
+ 'rank_id' => '1',
+ 'job_id' => '0',
+ 'disk' => 'storage',
+ 'path' => '*',
+ 'access' => '1'
+ ],
+ ]);
+ }
+}
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index c9566312..23e2f648 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -18,6 +18,7 @@ class DatabaseSeeder extends Seeder
UsersTableSeeder::class,
ComplementaryActivitiesSeeder::class,
EventTypeSeeder::class,
+ ACLTableSeeder::class,
]);
}
}
diff --git a/resources/views/admin/files/Google Drive/explorer.blade.php b/resources/views/admin/files/Google Drive/explorer.blade.php
deleted file mode 100644
index 9e940dad..00000000
--- a/resources/views/admin/files/Google Drive/explorer.blade.php
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
- #
- Nom
- Dernière modification
-
- @if($permission['p'])
-
-
-
-
- @else
-
- @endif
-
-
-
-
- @foreach($directories as $directory)
- @php
- $read = \App\GoogleDriveFile::getPermForAuthUser($directory['basename'],'r');
- $manage = \App\GoogleDriveFile::getPermForAuthUser($directory['basename'],'p');
- @endphp
-
- @endforeach
- @foreach($files as $file)
-
-
- {{$file['name']}}
- {{strftime('%e %b %Y',$file['timestamp'])}}
-
-
-
-
-
-
-
-
- Type : {{$file['type']}} / {{$file['extension']}}
-
-
- Taille : {{GetSizeName($file['size'])}}
-
-
- Permission : rw
-
-
-
-
-
- @endforeach
- @if(count($directories) == 0 && count($files) == 0)
-
-
- Le dossier est vide
-
-
- @endif
-
-
-Dernière mise à jour {{date('r')}}
-
\ No newline at end of file
diff --git a/resources/views/admin/files/Google Drive/file.blade.php b/resources/views/admin/files/Google Drive/file.blade.php
deleted file mode 100644
index d08fa0f6..00000000
--- a/resources/views/admin/files/Google Drive/file.blade.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/resources/views/admin/files/Google Drive/index.blade.php b/resources/views/admin/files/Google Drive/index.blade.php
deleted file mode 100644
index 12fc506f..00000000
--- a/resources/views/admin/files/Google Drive/index.blade.php
+++ /dev/null
@@ -1,149 +0,0 @@
-@extends('layouts.admin.main')
-
-@section('content')
-
-
-
-
-
-@endsection
-
-@section('breadcrumb')
- Fichier / Google Drive
-@endsection
-
-@section('custom_scripts')
-
-
-
-
-@endsection
diff --git a/resources/views/admin/files/Google Drive/permission.blade.php b/resources/views/admin/files/Google Drive/permission.blade.php
deleted file mode 100644
index e2f1f3ab..00000000
--- a/resources/views/admin/files/Google Drive/permission.blade.php
+++ /dev/null
@@ -1,266 +0,0 @@
-@extends('layouts.admin.main')
-
-@section('content')
-
-
-
-
-
Permission des grades
-
-
-
- Grade
- Lecture
- Écriture
- Gestion
-
-
- add
-
-
-
-
-
-
-
- Utilisateur non authentifié
-
-
- @if(isset($dir->rank_permission[0]))
- @if(strpos($dir->rank_permission[0],'r') !== false)
-
- @else
-
- @endif
- @else
-
- @endif
-
-
- @if(isset($dir->rank_permission[0]))
- @if(strpos($dir->rank_permission[0],'w') !== false)
-
- @else
-
- @endif
- @else
-
- @endif
-
-
- @if(isset($dir->rank_permission[0]))
- @if(strpos($dir->rank_permission[0],'p') !== false)
-
- @else
-
- @endif
- @else
-
- @endif
-
-
-
- edit
-
-
- delete
-
-
-
- @foreach($dir->rank_permission as $key => $rank)
- @if($key != 0)
-
-
- {{\App\Rank::find($key)->name}}
-
-
- @if(strpos($rank,'r') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'w') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'p') !== false)
-
- @else
-
- @endif
-
-
-
- edit
-
-
- delete
-
-
-
- @endif
- @endforeach
-
-
-
Permission des postes
-
-
-
- Poste
- Lecture
- Écriture
- Gestion
-
-
- add
-
-
-
-
-
- @if(count($dir->job_permission) < 1)
-
-
- Aucune permission de poste
-
-
- @endif
- @foreach($dir->job_permission as $key => $rank)
-
-
- {{\App\Job::find($key)->name}}
-
-
- @if(strpos($rank,'r') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'w') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'p') !== false)
-
- @else
-
- @endif
-
-
-
- edit
-
-
- delete
-
-
-
- @endforeach
-
-
-
Permission des utilisateurs
-
-
-
- Utilisateurs
- Lecture
- Écriture
- Gestion
-
-
- add
-
-
-
-
-
- @if(count($dir->user_permission) < 1)
-
-
- Aucune permission d'utilisateur
-
-
- @endif
- @foreach($dir->user_permission as $key => $rank)
-
-
- {{\App\User::find($key)->fullname()}}
-
-
- @if(strpos($rank,'r') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'w') !== false)
-
- @else
-
- @endif
-
-
- @if(strpos($rank,'p') !== false)
-
- @else
-
- @endif
-
-
-
- edit
-
-
- delete
-
-
-
- @endforeach
-
-
-
-
-
- @csrf
- Large modal
-
-
-@endsection
-
-@section('custom_scripts')
-
-
-
-@endsection
diff --git a/resources/views/admin/files/Google Drive/permission/add.blade.php b/resources/views/admin/files/Google Drive/permission/add.blade.php
deleted file mode 100644
index 8241d993..00000000
--- a/resources/views/admin/files/Google Drive/permission/add.blade.php
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
\ No newline at end of file
diff --git a/resources/views/admin/files/Google Drive/permission/edit.blade.php b/resources/views/admin/files/Google Drive/permission/edit.blade.php
deleted file mode 100644
index 0d7f77f7..00000000
--- a/resources/views/admin/files/Google Drive/permission/edit.blade.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
\ No newline at end of file
diff --git a/resources/views/admin/files/index.blade.php b/resources/views/admin/files/index.blade.php
index efc34a56..56c1d26c 100644
--- a/resources/views/admin/files/index.blade.php
+++ b/resources/views/admin/files/index.blade.php
@@ -1,154 +1,17 @@
@extends('layouts.admin.main')
@section('content')
-
-
-
-
-
Les fichiers si dessous sont disponible autant dans l'espace administration que dans l'espace cadet cadre.
-
-
-
- Nom
- Catégorie
-
-
-
-
-
- Plan de cours Vierge
- Plan de cours
- Télécharger
-
-
- Mini Ordre Operation Projet Soirée Journée Vierge
- Ordre d'opération
- Télécharger
-
-
- Mini Ordre Operation Vierge
- Ordre d'opération
- Télécharger
-
-
- Liste des tenues
- Tenues
- Télécharger
-
-
- Cadet commandant
- Énoncé de fonction
- Télécharger
-
-
- Cadet commandant adjoint
- Énoncé de fonction
- Télécharger
-
-
- Chef entrainement
- Énoncé de fonction
- Télécharger
-
-
- Instructeur sénior
- Énoncé de fonction
- Télécharger
-
-
- Instructeur
- Énoncé de fonction
- Télécharger
-
-
- Assistant Instructeur
- Énoncé de fonction
- Télécharger
-
-
- Commandant de section
- Énoncé de fonction
- Télécharger
-
-
- Commandant de la garde
- Énoncé de fonction
- Télécharger
-
-
- Commandant adjoint de section
- Énoncé de fonction
- Télécharger
-
-
- Commandant adjoint de garde
- Énoncé de fonction
- Télécharger
-
-
- Cadet cadre de la logistique
- Énoncé de fonction
- Télécharger
-
-
- Cadet cadre de l'administration
- Énoncé de fonction
- Télécharger
-
-
- Commandant adjoint de section
- Énoncé de fonction
- Télécharger
-
-
- Information NECPC
- Divers
- Télécharger
-
-
- Évaluation pratique sur la coordination d’un ordre d’opération sur le terrain
- Divers
- Télécharger
-
-
- RENCONTRE PRÉILIMINAIRE D’INSTRUCTION
- Divers
- Télécharger
-
-
- Liste nominal des cadets
- Divers
- Télécharger
-
-
-
-
+
-
@endsection
@section('breadcrumb')
-Fichier / Autres
+ Fichier / Explorer
@endsection
@section('custom_scripts')
-
+
@endsection
diff --git a/resources/views/layouts/admin/head.blade.php b/resources/views/layouts/admin/head.blade.php
index f09e5865..3141882d 100644
--- a/resources/views/layouts/admin/head.blade.php
+++ b/resources/views/layouts/admin/head.blade.php
@@ -35,6 +35,7 @@
+
diff --git a/routes/web.php b/routes/web.php
index f6067bfd..376dfb79 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -30,7 +30,8 @@ Route::get('/activity/{id}', 'ComplementaryActivityController@show');
Route::get('/picture/{id}', 'PictureController@show');
Route::get('/pictures', 'PictureController@index');
-Route::get('/file/get', 'GoogleDriveController@getFile')->middleware('fileperm:file,r');
+Route::get('/api/files/{path}', 'FilesController@show')->where('path','.*');
+
/** Setup */
Route::get('/admin/setup', 'AdminController@setup')->middleware('auth')->name('admin.setup');
@@ -188,25 +189,13 @@ Route::middleware(['auth', 'firstlogin'])->name('admin.')->group(function () {
Route::post('/admin/course/{id}/lessonPlan', 'CourseController@updateLessonPlan')->middleware('courseperm:edit');
/** Files */
- Route::post('/file/create', 'GoogleDriveController@createFile')->middleware('fileperm:folder,w');
- Route::post('/file/upload', 'GoogleDriveController@uploadFile')->middleware('fileperm:folder,w');
- Route::post('/folder/create', 'GoogleDriveController@createFolder')->middleware('fileperm:folder,w');
- Route::get('/file/delete', 'GoogleDriveController@deleteFile')->middleware('perm:file_delete')->middleware('fileperm:folder,w');
- Route::get('/folder/delete', 'GoogleDriveController@deleteDir')->middleware('perm:file_delete')->middleware('fileperm:folder,w');
- Route::get('/admin/files', 'FilesController@index')->middleware('perm:file_see')->name('files');
+ Route::get('/admin/files', 'FilesController@index')->name('files');
Route::get('/admin/files/cadet', 'FilesController@cadet')->middleware('perm:file_see')->name('files.cadet')->middleware('fileperm:folder,r');
Route::get('/admin/files/staff', 'FilesController@staff')->middleware('perm:file_see')->name('files.staff')->middleware('fileperm:folder,r');
Route::get('/admin/files/etamas', 'FilesController@etamas')->middleware('perm:file_see')->name('files.etamas')->middleware('fileperm:folder,r');
Route::get('/admin/files/officier', 'FilesController@officier')->middleware('perm:file_see')->name('files.officier')->middleware('fileperm:folder,r');
Route::get('/admin/files/publique', 'FilesController@publique')->middleware('perm:file_see')->name('files.publique')->middleware('fileperm:folder,r');
- Route::get('/admin/drive/{folder?}', 'GoogleDriveController@index')->middleware('fileperm:folder,r', 'perm:drive_see')->name('drive');
- Route::get('/admin/folder/{folder?}', 'GoogleDriveController@index')->middleware('fileperm:folder,r')->name('drive');
- Route::get('/admin/drive/{folder}/permission', 'GoogleDriveController@editPermission')->middleware('fileperm:folder,p')->name('drive.permission');
- Route::patch('/admin/drive/{folder}/permission/{subject}/{id}', 'GoogleDriveController@patchPermission')->middleware('perm:file_see', 'fileperm:folder,p');
- Route::get('/admin/drive/{folder}/deletepermission/{subject}/{id}', 'GoogleDriveController@deletePermission')->middleware('perm:file_see', 'fileperm:folder,p');
- Route::patch('/admin/drive/{folder}/addpermission/{subject}', 'GoogleDriveController@addPermission')->middleware('perm:file_see', 'fileperm:folder,p');
-
/** OCOM */
Route::get('/admin/ocom', 'OCOMController@index')->name('ocom')->middleware('perm:instruction_db_ocom_see');