Compare commits

...

156 Commits

Author SHA1 Message Date
Peter Papp
26e0535407 - frontend build 2020-12-21 18:22:22 +01:00
Peter Papp
0f8a89bbad Merge remote-tracking branch 'origin/master'
# Conflicts:
#	public/chunks/app-others.js
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/components/FilesView/FileItemList.vue
#	resources/js/components/FilesView/FilePreview.vue
#	resources/js/helpers.js
#	resources/js/store/modules/fileFunctions.js
2020-12-21 18:20:10 +01:00
Peter Papp
2f89f6303a Merge branch 'upload-limit'
# Conflicts:
#	app/Http/Helpers/helpers.php
#	config/vuefilemanager.php
#	public/chunks/app-others.js
#	public/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/components/FilesView/FileItemList.vue
#	resources/js/components/FilesView/FilePreview.vue
#	resources/js/helpers.js
#	resources/js/store/modules/fileFunctions.js
2020-12-21 18:19:37 +01:00
Peter Papp
4b3ca7e34b Merge remote-tracking branch 'origin/bulk-operations'
# Conflicts:
#	app/Http/Helpers/helpers.php
#	public/chunks/app-others.js
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/components/FilesView/FileItemList.vue
#	resources/js/components/FilesView/FilePreview.vue
#	resources/js/helpers.js
#	resources/js/store/modules/fileFunctions.js
2020-12-21 17:17:10 +01:00
Peter Papp
2c0cf43802 - frontend build
- merge upload limit
2020-12-21 17:15:12 +01:00
Peter Papp
d255b01c70 Merge branch 'upload-limit' into bulk-operations
# Conflicts:
#	app/Http/Helpers/helpers.php
#	config/vuefilemanager.php
#	public/chunks/app-others.js
#	public/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/components/FilesView/FileItemList.vue
#	resources/js/components/FilesView/FilePreview.vue
#	resources/js/helpers.js
#	resources/js/store/modules/fileFunctions.js
2020-12-21 17:14:21 +01:00
Peter Papp
6a9edc49c0 Merge remote-tracking branch 'origin/bulk-operations'
# Conflicts:
#	app/Http/Helpers/helpers.php
#	config/vuefilemanager.php
#	public/chunks/app-others.js
#	public/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/components/FilesView/FileItemList.vue
#	resources/js/components/FilesView/FilePreview.vue
#	resources/js/helpers.js
#	resources/js/store/modules/fileFunctions.js
2020-12-21 17:02:49 +01:00
Peter Papp
96faf2de0e - frontend build
- MobileActionButton enhancement
2020-12-21 17:00:41 +01:00
Peter Papp
5a2e6a5e53 - frontend build 2020-12-21 11:46:11 +01:00
Milos Holba
c509eeceb1 merge local with remote changes (Peter) 2020-12-21 11:31:50 +01:00
Milos Holba
299292a817 add actionButtons for mobile multiSelecting, refactoring sortingAndPreview icon 2020-12-21 11:23:18 +01:00
Peter Papp
b11bd0e521 - checkbox restyle in light mode 2020-12-21 11:05:12 +01:00
Peter Papp
8fb859b441 - checkbox restyle in dark mode 2020-12-21 10:57:07 +01:00
Peter Papp
28a5f58b80 - MobileAction buttons animation
- build
2020-12-21 10:47:06 +01:00
Peter Papp
7da4d1f64b - .multiselect-actions as position:fixed
- zipping popup when generate zip for multiple files download
2020-12-21 09:56:03 +01:00
Peter Papp
07086c7550 - turnOff delete in MobileActions.vue 2020-12-20 22:02:08 +01:00
Peter Papp
5246c47c86 - MobileActions.vue refactoring
- added select all / deselect all buttons to mobile multi select mode
2020-12-20 21:57:24 +01:00
Peter Papp
2975d1555d - frontend build 2020-12-20 19:22:35 +01:00
Milos Holba
bd946be0b0 merge local with remote 2020-12-20 16:53:32 +01:00
Milos Holba
e6ff90f6fc solved issues: FullFilePreview menu , MultiSelected move action ; refactoring contextMenu 2020-12-20 16:41:30 +01:00
Peter Papp
08dc813af9 - fixes 2020-12-19 17:04:52 +01:00
Peter Papp
9098634b99 - upload bar x margin fix 2020-12-19 16:31:14 +01:00
Milos Holba
00213824f1 brench merge 2020-12-19 15:18:58 +01:00
Milos Holba
65624326c7 solved issuis from Bulk Review v3,v4 2020-12-19 15:12:56 +01:00
Peter Papp
e92d9344b9 - App popup for creating folder in mobile version
- bug fixes
2020-12-19 13:47:14 +01:00
Peter Papp
55cf58fffd - local zip file 2020-12-19 11:50:48 +01:00
Peter Papp
a3c43af7ba - local zip file 2020-12-19 11:49:00 +01:00
Peter Papp
a10d394abb - download multiple files in public folder
- frontend build
2020-12-19 11:34:32 +01:00
Milos Holba
b16f22b0eb refactoring sorting and preview component 2020-12-17 12:25:08 +01:00
Milos Holba
5bc66d51be add close sortingAndPreview after click anywhere in application 2020-12-16 12:21:55 +01:00
Peter Papp
7b27fa70d8 - download multiple files in private folder
- sorting context menu changes
- download icon active only if files was selected
2020-12-15 18:05:08 +01:00
Peter Papp
372b3aa407 - frontend build 2020-12-14 18:53:06 +01:00
Peter Papp
bda293bc53 Merge remote-tracking branch 'origin/bulk-operations' into bulk-operations
# Conflicts:
#	public/mix-manifest.json
#	resources/js/components/FilesView/ContextMenu.vue
2020-12-13 17:52:24 +01:00
Peter Papp
11873d06ff - zip implementation for users 2020-12-13 17:49:44 +01:00
Milos Holba
89ea50b893 solved issues bulk review part.1 2020-12-13 16:33:28 +01:00
Peter Papp
874b4bb768 - multiple download test 2020-12-12 17:44:24 +01:00
Peter Papp
1e49f52abe - timeout changed in ContextMenu.vue 2020-12-12 10:44:13 +01:00
Peter Papp
94088e76ec - timeout changed in ContextMenu.vue 2020-12-12 10:38:25 +01:00
Peter Papp
c7abcce729 - code review
- frontend build
2020-12-12 10:31:22 +01:00
Milos Holba
e9d2f4bacc delete sorting icon 2020-12-11 18:26:57 +01:00
Milos Holba
7e7965f98e merge with sorting 2020-12-11 18:25:04 +01:00
Milos Holba
d823ae687b refactor getDataByLocation helper, fix moveItem popup from File info panel 2020-12-11 18:18:09 +01:00
Milos Holba
21a36c0965 add translation for preview and sorting, add sorting for moveItem tree and remove for favourites tree 2020-12-10 18:38:48 +01:00
Milos Holba
c3d162b991 add preview&Sorting menu for mobile version, refacoring sorting URI 2020-12-09 18:24:05 +01:00
Milos Holba
7e325c5101 add sorting for every getData and navigator, Favourites need to be fixed 2020-12-08 19:14:53 +01:00
Milos Holba
59ff07fb01 remove clear fileInfoDetail after load data , add clear fileInfoDetail after open another folder 2020-12-07 19:08:45 +01:00
Milos Holba
2ba92ed3b6 add aplhabet icon 2020-12-07 19:00:50 +01:00
Milos Holba
418c072414 optimalize UI for preview and sorting options 2020-12-07 18:57:40 +01:00
Milos Holba
397fe6b7e4 fixed record_upload for guest ,add clear fileInfoDetail after data change 2020-12-07 16:03:48 +01:00
Milos Holba
97d500028a grid and list view working 2020-12-07 14:23:29 +01:00
Milos Holba
527dfeef9f merge with bulk-operations 2020-12-07 11:32:43 +01:00
Milos Holba
1b3baab691 set timeout between multi download cycles 2020-12-05 18:17:45 +01:00
Milos Holba
5d512f7806 available create folder and upload files at multi selecting 2020-12-05 17:46:22 +01:00
Milos Holba
0da525f692 add the command key for selecting to FileItemGrid 2020-12-05 17:38:08 +01:00
Milos Holba
d076817c9e Merge branch 'bulk-operations' into sorting 2020-12-05 17:25:38 +01:00
Peter Papp
d2af7c1f5e version changed 2020-12-05 17:17:11 +01:00
Peter Papp
ef002f9186 frontend build 2020-12-05 17:15:27 +01:00
Peter Papp
f1006355c4 changed default sorting in navigation tree for move popup action 2020-12-05 17:09:44 +01:00
Milos Holba
ec6087a03c sorting first commit 2020-12-05 17:08:57 +01:00
Peter Papp
2e465f4d03 'Cancel Sharing' edit in language files 2020-12-05 16:56:17 +01:00
Peter Papp
08bf6654fc - Folder tree in navigator now has correct ordering with folder list in file view
- added translation to alert popup
- SCOUT_QUEUE default to true
2020-12-05 11:18:37 +01:00
Peter Papp
77e29852a5 SQLite indexer overload fix
- added jobs migration
- added queue:work to scheduler
- new setup in env.example
- frontend build
2020-12-05 10:22:50 +01:00
Milos Holba
6bc84d4b25 bulk-operations v0.3 fixed DragUI subtitle for single item , add handle for move item to the same parent 2020-12-04 15:47:32 +01:00
Milos Holba
d31e2ab98b bulk-operations v0.3 add multi shared cancel to contextMenu 2020-12-04 13:34:00 +01:00
Milos Holba
ee14c34671 bulk-operations fix desktopToolbar delete 2020-12-04 11:26:15 +01:00
Milos Holba
a8b290692e bulk-operations merge 2020-12-04 11:15:10 +01:00
Milos Holba
441f911560 bulk-operations v0.3 issues solved 2020-12-04 10:56:27 +01:00
Peter Papp
10090b474a - navigator in shared folder page fix
- fixed trash in MobileNavigation.vue
- MobileMultiSelectMenu.vue refactor
- frontend build
2020-12-03 20:19:21 +01:00
Milos Holba
aff2594ef2 bulk-operations fix drop of dragged item 2020-12-02 19:56:54 +01:00
Milos Holba
66aad7c488 merge 2020-12-02 17:09:35 +01:00
Milos Holba
896be9c9c9 bulk-operations change MultiSelect component 2020-12-02 17:06:35 +01:00
Peter Papp
8d1821e05d changed version 2020-12-01 17:55:20 +01:00
Peter Papp
b7014552d2 frontend build 2020-12-01 17:53:25 +01:00
Milos Holba
8561556f5c bulk-operations fixed moveItem popup Three, fixed multiSelect with Shift from bottom to top 2020-11-30 18:49:54 +01:00
Milos Holba
58f7479380 bulk-operations v0.1 add opcaity for draged items 2020-11-29 17:50:59 +01:00
Peter Papp
7b70c81d4d binding key delete 2020-11-29 09:55:58 +01:00
Peter Papp
1981f39f9e traffic fix
drag preview styling
2020-11-29 09:39:26 +01:00
Milos Holba
e86ea3e5c4 bulk-operations v0.1 disable rename if are multiple items selected , add Drag & Drop UI Ghost for share 2020-11-28 18:06:42 +01:00
Milos Holba
8e01b837a2 bulk-operations v0.1 add the Drag & Drop UI Ghost , styled scrollbar 2020-11-28 15:56:12 +01:00
Peter Papp
f33fe84350 traffic id fix 2020-11-28 14:46:59 +01:00
Milos Holba
dbbad817c7 bulk-operations multiSelect items UI v0.1 2020-11-26 12:28:59 +01:00
Milos Holba
0eb0939598 bulk-operations multiSelect items UI v0.1 2020-11-26 12:26:30 +01:00
Peter Papp
65f7855703 I killed that ghost beach! 2020-11-25 20:40:18 +01:00
Peter Papp
45d482d347 Merge remote-tracking branch 'origin/monitor' into bulk-operations
# Conflicts:
#	public/mix-manifest.json
2020-11-24 15:58:43 +01:00
Milos Holba
1654dc8678 bulk-operations draged item multiSelect UI 2020-11-24 11:19:40 +01:00
Peter Papp
cb417ea76d added basic traffic meter for upload/download 2020-11-23 18:29:23 +01:00
Milos Holba
17df4aea35 bulk-operations add the command key for selecting the items 2020-11-22 19:09:10 +01:00
Milos Holba
714429d8f4 bulk-operations merge with the improvements branch 2020-11-22 16:39:58 +01:00
Milos Holba
0df03f1d32 bulk-operations make new MobileMultiSelectMenu component, add multi dwonload 2020-11-22 16:21:51 +01:00
Peter Papp
fefc10afb8 Prevent browser 'Go Back' when you undesirably trying to go to previous page after sign in to your account 2020-11-22 10:30:06 +01:00
Peter Papp
1658627069 updated language files 2020-11-22 09:44:50 +01:00
Peter Papp
16ab540298 Ability to cancel uploading progress via x button 2020-11-22 09:42:44 +01:00
Peter Papp
4e5afa4747 Ability to remove uploaded logo and get back to text logo 2020-11-22 08:56:53 +01:00
Peter Papp
d76ff07bf4 Ability to collapse navigator or favourites widget in File page 2020-11-21 19:56:51 +01:00
Peter Papp
b38333bb64 Trash moved to file page 2020-11-21 18:02:46 +01:00
Peter Papp
f863537190 Integrated rename popup 2020-11-21 17:14:56 +01:00
Peter Papp
a72a672aaf Added navigator to shared page with folders when you have multiple folders within for better user experience
Title name of favourite folder overflowed sidebar when you have long title
Share button in image preview appear when you are in shared public folder
2020-11-21 10:33:27 +01:00
Milos Holba
a3dd817e7a bulk-operations v0.1 adding Drag & Drop for moving items to navigations folders, add folders to favourites 2020-11-20 17:54:39 +01:00
Milos Holba
9d9e07d0fa bulk-operations v0.1 mobileSeleting finished, change FileFullPreview code 2020-11-16 17:57:43 +01:00
Peter Papp
30783d0e5d frontend build 2020-11-16 17:19:59 +01:00
Peter Papp
3a296f0f9c Merge remote-tracking branch 'origin/upload-limit' into upload-limit 2020-11-16 17:17:46 +01:00
Peter Papp
c0d5a771a5 upload-limit branch review 2020-11-16 17:16:38 +01:00
Milos Holba
8fc7272e38 upload-limit v0.3 solved the multiple DB querys,uploadLimit in config 2020-11-16 17:16:38 +01:00
Milos Holba
8b8dc34ba6 upload-limit v0.2 solved uploadLimitFormate issues , add helper for format_megabytes 2020-11-16 17:16:38 +01:00
Milos Holba
966145d384 upload-limit v0.2 2020-11-16 17:16:38 +01:00
Milos Holba
2b4060cb7b upload-limit v0.1 2020-11-16 17:16:38 +01:00
Peter Papp
9455a361dc upload-limit branch review 2020-11-16 17:15:10 +01:00
Milos Holba
26132e23a3 bulk-operations v0.1 ContextMenu Add selecting for mobile version 2020-11-15 20:24:12 +01:00
Milos Holba
5acaadeaae bulk-version v0.1 contextMenu Mobile version selecting 2020-11-15 19:59:12 +01:00
Milos Holba
324f4b1ffa bulk-operations v0.1 setup bulk delete,move items and FileInfoPanel 2020-11-13 19:10:36 +01:00
Milos Holba
0c02952f7a bulk-operations v0.1 add selecting to FileItem List and Grid 2020-11-13 19:05:47 +01:00
Milos Holba
f76a4b37e4 bulk-operations v0.1 2020-11-13 19:03:13 +01:00
Milos Holba
f33f93006e bulk-operations v0.1 user_move, guest_move BE 2020-11-13 19:02:27 +01:00
Milos Holba
382756a6f0 rebase 2020-11-13 19:02:08 +01:00
Milos Holba
559bee6ca2 bulk-operations v0.1 setup bulk delete,move items and FileInfoPanel 2020-11-13 17:56:45 +01:00
Milos Holba
190fc651ae upload-limit v0.3 solved the multiple DB querys,uploadLimit in config 2020-11-12 17:46:23 +01:00
Peter Papp
1c62da4e7c fixed plan description validation in payment request 2020-11-12 17:16:37 +01:00
Milos Holba
8a9d2d7f9a bulk-operations add select for FileItemgrid 2020-11-12 17:12:09 +01:00
Peter Papp
ae3be12934 fixed plan description validation in payment request 2020-11-12 09:46:38 +01:00
Milos Holba
4683e0d084 bulk-operations select items v0.1 2020-11-11 18:03:46 +01:00
Milos Holba
c55d3f5350 upload-limit v0.2 solved uploadLimitFormate issues , add helper for format_megabytes 2020-11-07 15:19:03 +01:00
Milos Holba
7273d60154 upload-limit v0.2 2020-11-06 12:19:31 +01:00
Milos Holba
587daa5ffe upload-limit v0.1 2020-11-04 12:48:15 +01:00
Milos Holba
064e635d35 bulk-operations v0.1 user_move, guest_move BE 2020-11-03 15:36:08 +01:00
Milos Holba
06db522545 bulk-operations v0.1 user_delete,guest_delete BE 2020-11-01 19:52:33 +01:00
Peter Papp
e5335c2472 Merge remote-tracking branch 'origin/exifBlacklist' into exifBlacklist
# Conflicts:
#	public/mix-manifest.json
#	resources/js/helpers.js
#	resources/js/i18n/lang/cn.json
#	resources/js/i18n/lang/en.json
#	resources/js/i18n/lang/sk.json
#	resources/js/store/modules/fileFunctions.js
#	resources/js/views/Admin/AppSettings/AppSettingsTabs/Others.vue
2020-10-24 10:40:59 +02:00
Peter Papp
a2ec066c6d added metadata to UpgradeAppController.php
updated readme with upgrading step to 1.7.11
Frontend build
2020-10-24 10:39:39 +02:00
Miloš Holba
15d4ffc349 Add to metadata Longitude and Latitude 2020-10-24 09:44:23 +02:00
Peter Papp
9af9e45b8a night mode for ImageMetaData.vue 2020-10-24 09:44:23 +02:00
Peter Papp
f30dd38b96 migration column in file_manager_files renamed from meta_data to metadata
context menu feractoring
Editor.php typo changes
FileInfoPanel.vue small changes when to show metadata info
Added new exif information and reordering existing in ImageMetaData.vue
Added new translation strings to i18n files
2020-10-24 09:44:23 +02:00
Miloš Holba
d5f3599b9e v0.1 Add enable empty input in uploadText method 2020-10-24 09:44:23 +02:00
Miloš Holba
de62ab535c v0.1 Fix exif data function just for jpeg and Fix config in index.blade for mimetype_blacklist 2020-10-24 09:44:18 +02:00
Miloš Holba
8b8562916b v0.1 exifBlacklist 2020-10-24 09:44:05 +02:00
Miloš Holba
0d7b920cbe v0.1 add check mimetype if mimetype of file is undefined 2020-10-24 09:44:04 +02:00
Miloš Holba
f3254a380f v0.1 exif Blacklist add frontend validation 2020-10-24 09:44:02 +02:00
Miloš Holba
0e12029efc v0.1 Blacklist and Exif data 2020-10-24 09:43:58 +02:00
Miloš Holba
fd6aa5c6b2 Lazy loading (#41)
* lazy-loading and solved bugs

* lazy-loading for pull request on master

* Update vuefilemanager.php

Co-authored-by: Peter Papp <peterpapp@makingcg.com>
2020-10-24 09:40:05 +02:00
Miloš Holba
5be9db83f7 version change to v1.7.11 2020-10-23 16:14:34 +02:00
Peter Papp
12d6b0bf57 scheduler changed from hourly to every minute 2020-10-13 17:09:05 +02:00
nourisk
961462fe54 Update package.json (#32)
The "vue" and "vue-template[..]" versions not being the same, this has the effect of breaking the "npm run prod" command with error "version missmatch".
For people who have already installed it, just change the version then "npm install" and that should solve the problem.
2020-10-07 08:19:39 +02:00
nourisk
f0e0103d81 Update router.js (#31)
Capital i missing
2020-10-06 17:03:26 +02:00
Miloš Holba
755523e07b Add to metadata Longitude and Latitude 2020-09-25 09:31:31 +02:00
Peter Papp
c4ace0697b version change to v1.7.10.3 2020-09-20 12:09:07 +02:00
Peter Papp
69489c4ee2 - fixed simultaneously action with show and download file on doubleclick
- Changed download name for Backblaze
- Price plan can be defined in 12 digit number
2020-09-20 12:08:29 +02:00
Peter Papp
e05d7468b5 night mode for ImageMetaData.vue 2020-09-20 11:23:50 +02:00
Peter Papp
1a6a91335e migration column in file_manager_files renamed from meta_data to metadata
context menu feractoring
Editor.php typo changes
FileInfoPanel.vue small changes when to show metadata info
Added new exif information and reordering existing in ImageMetaData.vue
Added new translation strings to i18n files
2020-09-20 11:17:34 +02:00
Miloš Holba
80de069c7b v0.1 Add enable empty input in uploadText method 2020-09-15 13:20:39 +02:00
Miloš Holba
2de8bbe548 v0.1 Fix exif data function just for jpeg and Fix config in index.blade for mimetype_blacklist 2020-09-15 10:33:39 +02:00
Peter Papp
7ba2a3bec1 fixed backblaze broken download link when filename contain space (Content Disposition header wasn't read properly with space) 2020-09-14 09:53:38 +02:00
Miloš Holba
89fa2fce23 v0.1 exifBlacklist 2020-09-12 11:15:32 +02:00
Miloš Holba
84b47416d6 v0.1 add check mimetype if mimetype of file is undefined 2020-09-06 20:29:16 +02:00
Miloš Holba
55c72cddba v0.1 exif Blacklist add frontend validation 2020-09-05 18:35:27 +02:00
Miloš Holba
6effd4a7d9 v0.1 Blacklist and Exif data 2020-09-05 14:35:51 +02:00
Peter Papp
95f6695d00 Fixed when default value incorrectly showing in switches in app settings 2020-09-01 07:41:05 +02:00
Peter Papp
fde7f0f73b Fixed when default value incorrectly showing in switches in app settings 2020-09-01 07:10:56 +02:00
Peter Papp
dd1bffec09 typo error 2020-08-31 08:38:40 +02:00
185 changed files with 7872 additions and 4505 deletions

View File

@@ -6,7 +6,10 @@ APP_URL=http://localhost
APP_DEMO=false
LOG_CHANNEL=stack
SCOUT_DRIVER=tntsearch
SCOUT_QUEUE=true
FILESYSTEM_DRIVER=
CHUNK_SIZE=128
@@ -19,7 +22,7 @@ DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120

View File

@@ -150,13 +150,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -316,13 +318,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -482,13 +486,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -648,13 +654,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -814,13 +822,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -980,13 +990,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -1146,13 +1158,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -1312,13 +1326,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -1478,13 +1494,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -1644,13 +1662,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,
@@ -1810,13 +1830,15 @@ namespace PHPSTORM_META {
'hash.driver' => \Illuminate\Hashing\BcryptHasher::class,
'image' => \Intervention\Image\ImageManager::class,
'log' => \Illuminate\Log\LogManager::class,
'madzipper' => \Madnest\Madzipper\Madzipper::class,
'mail.manager' => \Illuminate\Mail\MailManager::class,
'mailer' => \Illuminate\Mail\Mailer::class,
'memcached.connector' => \Illuminate\Cache\MemcachedConnector::class,
'migration.creator' => \Illuminate\Database\Migrations\MigrationCreator::class,
'migration.repository' => \Illuminate\Database\Migrations\DatabaseMigrationRepository::class,
'migrator' => \Illuminate\Database\Migrations\Migrator::class,
'queue' => \Illuminate\Queue\QueueManager::class,
'queue.connection' => \Illuminate\Queue\SyncQueue::class,
'queue.connection' => \Illuminate\Queue\DatabaseQueue::class,
'queue.failer' => \Illuminate\Queue\Failed\DatabaseFailedJobProvider::class,
'queue.listener' => \Illuminate\Queue\Listener::class,
'queue.worker' => \Illuminate\Queue\Worker::class,

View File

@@ -1,16 +1,6 @@
![logo](https://vuefilemanager.com/assets/images/vuefilemanager-horizontal-logo.svg)
# Private Cloud Storage Build on Laravel & Vue.js
## Supporting VueFileManager
Hi, we are trying make the best experience with VueFileManager. There is a lot things to do, and a lot of features we can make.
But, it can't be done without you, development is more and more complicated and we have to hire new colleagues to help with it. There is couple way you can support us, and then, we support you with all great new features which can be. Thanks you for participating on this awesome software!
- [Buy me a Coffe](https://www.buymeacoffee.com/pepe)
- [One-time donation via PayPal](https://www.paypal.me/peterpapp)
- [Become a backer or sponsor on Patreon](https://www.patreon.com/vuefilemanager)
- [Purchase Licence on CodeCanyon](https://codecanyon.net/item/vue-file-manager-with-laravel-backend/25815986)
## Contents
- [Installation](#installation)
@@ -20,6 +10,8 @@ But, it can't be done without you, development is more and more complicated and
- [Chunk Upload](#chunk-upload)
- [Upgrade Guide](#upgrade-guide)
- [Common Instructions](#common-instructions)
- [Update from 1.7.12 to 1.8](#update-from-1712-to-178)
- [Update from 1.7.10 to 1.7.11](#update-from-1710-to-1711)
- [Update from 1.7.8 to 1.7.9](#update-from-178-to-179)
- [Update from 1.7.x to 1.7.8](#update-from-17x-to-178)
- [Update from 1.6.x to 1.7](#update-from-16x-to-17)
@@ -51,7 +43,6 @@ But, it can't be done without you, development is more and more complicated and
- Nginx or Apache
**These PHP Extensions are required:**
- GD
@@ -136,13 +127,23 @@ These instructions is applicable for all updates. Please follow this step:
- Just rewrite all project files with new excluded `/.env` file and `/storage` folder. These items must be preserved!
### Update from 1.7.12 to 1.8
- Before upload new files to your hosting, log in to VueFileManager as Admin. After uploading new files on your webhosting, visit this url `your-domain.com/service/upgrade-database` for upgrading your database.
- Just rewrite all project files with new, excluded /.env file and /storage folder. These items must be preserved!
- set **QUEUE_CONNECTION** to **database** in your **.env** file
- Clear cache in your administration panel - Settings / Application / Clear Cache
If you are upgrading from GitHub, don't forget run `composer install` to install new vendors.
### Update from 1.7.10 to 1.7.11
Before upload new files to your hosting, log in to VueFileManager as Admin. After uploading new files on your webhosting, visit this url `your-domain.com/service/upgrade-database` for upgrading your database.
### Update from 1.7.8 to 1.7.9
After rewrited old files with new files, log in as admin to the app and go to `your-domain.com/service/upgrade-database`. This will upgrade your database on the background.
Add the following Cron entry to your server. Just update your php path (if it's different) and project path:
```
* * * * * /usr/local/bin/php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
```
### Update from 1.7.x to 1.7.8
@@ -362,6 +363,15 @@ The following support channels are available at your fingertips:
- [CodeCanyon support message](https://codecanyon.net/item/vue-file-manager-with-laravel-backend/25815986/support)
- [GitHub repository](https://vuefilemanager.com/github-access)
## Supporting VueFileManager
Hi, we are trying make the best experience with VueFileManager. There is a lot things to do, and a lot of features we can make.
But, it can't be done without you, development is more and more complicated and we have to hire new colleagues to help with it. There is couple way you can support us, and then, we support you with all great new features which can be. Thanks you for participating on this awesome software!
- [Buy me a Coffe](https://www.buymeacoffee.com/pepe)
- [Become a Patreon](https://www.patreon.com/vuefilemanager)
- [One-time donation via PayPal](https://www.paypal.me/peterpapp)
## Security Vulnerabilities
If you discover a security vulnerability within this project, please send an e-mail to [peterpapp@makingcg.com](peterpapp@makingcg.com). All security vulnerabilities will be promptly addressed.

View File

@@ -7525,6 +7525,57 @@
{
/** @var \Illuminate\Support\Testing\Fakes\QueueFake $instance */
return $instance->setConnectionName($name);
}
/**
* Release a reserved job back onto the queue.
*
* @param string $queue
* @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job
* @param int $delay
* @return mixed
* @static
*/
public static function release($queue, $job, $delay)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->release($queue, $job, $delay);
}
/**
* Delete a reserved job from the queue.
*
* @param string $queue
* @param string $id
* @return void
* @throws \Throwable
* @static
*/
public static function deleteReserved($queue, $id)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
$instance->deleteReserved($queue, $id);
}
/**
* Get the queue or return the default.
*
* @param string|null $queue
* @return string
* @static
*/
public static function getQueue($queue)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->getQueue($queue);
}
/**
* Get the underlying database instance.
*
* @return \Illuminate\Database\Connection
* @static
*/
public static function getDatabase()
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->getDatabase();
}
/**
* Get the retry delay for an object-based queue handler.
@@ -7535,7 +7586,7 @@
*/
public static function getJobRetryDelay($job)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\SyncQueue $instance */
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->getJobRetryDelay($job);
}
/**
@@ -7547,7 +7598,7 @@
*/
public static function getJobExpiration($job)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\SyncQueue $instance */
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->getJobExpiration($job);
}
/**
@@ -7559,7 +7610,7 @@
*/
public static function createPayloadUsing($callback)
{ //Method inherited from \Illuminate\Queue\Queue
\Illuminate\Queue\SyncQueue::createPayloadUsing($callback);
\Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback);
}
/**
* Set the IoC container instance.
@@ -7570,7 +7621,7 @@
*/
public static function setContainer($container)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\SyncQueue $instance */
/** @var \Illuminate\Queue\DatabaseQueue $instance */
$instance->setContainer($container);
}
@@ -14446,6 +14497,324 @@
}
}
namespace Madnest\Madzipper\Facades {
/**
*
*
*/
class Madzipper {
/**
* Create a new zip Archive if the file does not exists
* opens a zip archive if the file exists
*
* @param $pathToFile string The file to open
* @param \Madnest\Madzipper\RepositoryInterface|string $type The type of the archive, defaults to zip, possible are zip, phar
* @throws \RuntimeException
* @throws \Exception
* @throws \InvalidArgumentException
* @return \Madnest\Madzipper\Madzipper Madzipper instance
* @static
*/
public static function make($pathToFile, $type = 'zip')
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->make($pathToFile, $type);
}
/**
* Create a new zip archive or open an existing one
*
* @param $pathToFile
* @throws \Exception
* @return \Madnest\Madzipper\Madzipper
* @static
*/
public static function zip($pathToFile)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->zip($pathToFile);
}
/**
* Create a new phar file or open one
*
* @param $pathToFile
* @throws \Exception
* @return \Madnest\Madzipper\Madzipper
* @static
*/
public static function phar($pathToFile)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->phar($pathToFile);
}
/**
* Create a new rar file or open one
*
* @param $pathToFile
* @throws \Exception
* @return \Madnest\Madzipper\Madzipper
* @static
*/
public static function rar($pathToFile)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->rar($pathToFile);
}
/**
* Extracts the opened zip archive to the specified location <br/>
* you can provide an array of files and folders and define if they should be a white list
* or a black list to extract. By default this method compares file names using "string starts with" logic
*
* @param $path string The path to extract to
* @param array $files An array of files
* @param int $methodFlags The Method the files should be treated
* @throws \Exception
* @static
*/
public static function extractTo($path, $files = [], $methodFlags = 2)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->extractTo($path, $files, $methodFlags);
}
/**
* Extracts matching files/folders from the opened zip archive to the specified location.
*
* @param string $extractToPath The path to extract to
* @param string $regex regular expression used to match files. See @link http://php.net/manual/en/reference.pcre.pattern.syntax.php
* @throws \InvalidArgumentException
* @throws \RuntimeException
* @static
*/
public static function extractMatchingRegex($extractToPath, $regex)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->extractMatchingRegex($extractToPath, $regex);
}
/**
* Gets the content of a single file if available
*
* @param $filePath string The full path (including all folders) of the file in the zip
* @throws \Exception
* @return mixed returns the content or throws an exception
* @static
*/
public static function getFileContent($filePath)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getFileContent($filePath);
}
/**
* Add one or multiple files to the zip.
*
* @param $pathToAdd array|string An array or string of files and folders to add
* @param null|mixed $fileName
* @return \Madnest\Madzipper\Madzipper Madzipper instance
* @static
*/
public static function add($pathToAdd, $fileName = null)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->add($pathToAdd, $fileName);
}
/**
* Add an empty directory
*
* @param $dirName
* @return \Madzipper
* @static
*/
public static function addEmptyDir($dirName)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->addEmptyDir($dirName);
}
/**
* Add a file to the zip using its contents
*
* @param $filename string The name of the file to create
* @param $content string The file contents
* @return \Madnest\Madzipper\Madzipper Madzipper instance
* @static
*/
public static function addString($filename, $content)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->addString($filename, $content);
}
/**
* Gets the status of the zip.
*
* @return int The status of the internal zip file
* @static
*/
public static function getStatus()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getStatus();
}
/**
* Remove a file or array of files and folders from the zip archive
*
* @param $fileToRemove array|string The path/array to the files in the zip
* @return \Madnest\Madzipper\Madzipper Madzipper instance
* @static
*/
public static function remove($fileToRemove)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->remove($fileToRemove);
}
/**
* Returns the path of the current zip file if there is one.
*
* @return string The path to the file
* @static
*/
public static function getFilePath()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getFilePath();
}
/**
* Sets the password to be used for decompressing
*
* @param $password
* @return bool
* @static
*/
public static function usePassword($password)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->usePassword($password);
}
/**
* Closes the zip file and frees all handles
*
* @static
*/
public static function close()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->close();
}
/**
* Sets the internal folder to the given path.<br/>
* Useful for extracting only a segment of a zip file.
*
* @param $path
* @return \Madnest\Madzipper\Madzipper
* @static
*/
public static function folder($path)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->folder($path);
}
/**
* Resets the internal folder to the root of the zip file.
*
* @return \Madnest\Madzipper\Madzipper
* @static
*/
public static function home()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->home();
}
/**
* Deletes the archive file
*
* @static
*/
public static function delete()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->delete();
}
/**
* Get the type of the Archive
*
* @return string
* @static
*/
public static function getArchiveType()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getArchiveType();
}
/**
* Get the current internal folder pointer
*
* @return string
* @static
*/
public static function getCurrentFolderPath()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getCurrentFolderPath();
}
/**
* Checks if a file is present in the archive
*
* @param $fileInArchive
* @return bool
* @static
*/
public static function contains($fileInArchive)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->contains($fileInArchive);
}
/**
*
*
* @return \Madnest\Madzipper\RepositoryInterface
* @static
*/
public static function getRepository()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getRepository();
}
/**
*
*
* @return \Madnest\Madzipper\Filesystem
* @static
*/
public static function getFileHandler()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getFileHandler();
}
/**
* Gets the path to the internal folder
*
* @return string
* @static
*/
public static function getInternalPath()
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->getInternalPath();
}
/**
* List all files that are within the archive
*
* @param string|null $regexFilter regular expression to filter returned files/folders. See @link http://php.net/manual/en/reference.pcre.pattern.syntax.php
* @throws \RuntimeException
* @return array
* @static
*/
public static function listFiles($regexFilter = null)
{
/** @var \Madnest\Madzipper\Madzipper $instance */
return $instance->listFiles($regexFilter);
}
}
}
@@ -17425,6 +17794,7 @@ namespace {
class Stripe extends \Cartalyst\Stripe\Laravel\Facades\Stripe {}
class Crawler extends \Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect {}
class Flare extends \Facade\Ignition\Facades\Flare {}
class Madzipper extends \Madnest\Madzipper\Facades\Madzipper {}
}

View File

@@ -3,11 +3,13 @@
namespace App\Console;
use App\Console\Commands\Deploy;
//use App\Console\Commands\SetupDevelopmentEnvironment;
// use App\Console\Commands\SetupDevelopmentEnvironment;
use App\Console\Commands\SetupDevEnvironment;
use App\Console\Commands\SetupProductionEnvironment;
use App\Console\Commands\UpgradeApp;
use App\Share;
use App\Zip;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -21,7 +23,7 @@ class Kernel extends ConsoleKernel
*/
protected $commands = [
Deploy::class,
//SetupDevelopmentEnvironment::class,
// SetupDevelopmentEnvironment::class,
];
/**
@@ -34,7 +36,16 @@ class Kernel extends ConsoleKernel
{
$schedule->call(function () {
$this->delete_expired_shared_links();
})->hourly();
})->everyMinute();
$schedule->call(function () {
$this->delete_old_zips();
})->everySixHours();
// Run queue jobs every minute
$schedule->command('queue:work --tries=3')
->everyMinute()
->withoutOverlapping();
}
/**
@@ -49,6 +60,24 @@ class Kernel extends ConsoleKernel
require base_path('routes/console.php');
}
/**
* Delete old zips
*/
protected function delete_old_zips(): void
{
// Get all zips
$zips = Zip::where('created_at', '<=', Carbon::now()->subDay()->toDateTimeString())->get();
$zips->each(function ($zip) {
// Delete zip file
\Storage::disk('local')->delete('zip/' . $zip->basename);
// Delete zip record
$zip->delete();
});
}
/**
* Get and delete expired shared links
*/

View File

@@ -9,6 +9,7 @@ use Illuminate\Support\Str;
use Laravel\Scout\Searchable;
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
use \Illuminate\Database\Eloquent\SoftDeletes;
use Kyslik\ColumnSortable\Sortable;
/**
* App\FileManagerFile
@@ -52,10 +53,13 @@ use \Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Query\Builder|\App\FileManagerFile withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\FileManagerFile withoutTrashed()
* @mixin \Eloquent
* @property array|null $metadata
* @method static \Illuminate\Database\Eloquent\Builder|FileManagerFile sortable($defaultParameters = null)
* @method static \Illuminate\Database\Eloquent\Builder|FileManagerFile whereMetadata($value)
*/
class FileManagerFile extends Model
{
use Searchable, SoftDeletes;
use Searchable, SoftDeletes , Sortable;
public $public_access = null;
@@ -67,6 +71,20 @@ class FileManagerFile extends Model
'file_url'
];
protected $casts = [
'metadata' => 'array',
];
/**
* Sortable columns
*
* @var string[]
*/
public $sortable = [
'name',
'created_at',
];
/**
* Set routes with public access
*
@@ -148,7 +166,9 @@ class FileManagerFile extends Model
// Get file from external storage
if (is_storage_driver(['s3', 'spaces', 'wasabi', 'backblaze'])) {
$file_pretty_name = get_pretty_name($this->attributes['basename'], $this->attributes['name'], $this->attributes['mimetype']);
$file_pretty_name = is_storage_driver('backblaze')
? Str::snake(mb_strtolower($this->attributes['name']))
: get_pretty_name($this->attributes['basename'], $this->attributes['name'], $this->attributes['mimetype']);
$header = [
"ResponseAcceptRanges" => "bytes",

View File

@@ -11,6 +11,7 @@ use RecursiveArrayIterator;
use RecursiveIteratorIterator;
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
use \Illuminate\Database\Eloquent\SoftDeletes;
use Kyslik\ColumnSortable\Sortable;
/**
* App\FileManagerFolder
@@ -58,10 +59,11 @@ use \Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Query\Builder|\App\FileManagerFolder withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\FileManagerFolder withoutTrashed()
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|FileManagerFolder sortable($defaultParameters = null)
*/
class FileManagerFolder extends Model
{
use Searchable, SoftDeletes;
use Searchable, SoftDeletes , Sortable;
protected $guarded = [
'id'
@@ -71,6 +73,16 @@ class FileManagerFolder extends Model
'items', 'trashed_items'
];
/**
* Sortable columns
*
* @var string[]
*/
public $sortable = [
'name',
'created_at',
];
/**
* Index folder
*

View File

@@ -102,7 +102,7 @@ class UserController extends Controller
public function users()
{
return new UsersCollection(
User::sortable()->paginate('20')
User::sortable(['created_at', 'DESC'])->paginate('20')
);
}

View File

@@ -3,8 +3,11 @@
namespace App\Http\Controllers;
use App\FileManagerFolder;
use App\Http\Tools\Editor;
use App\Http\Tools\Guardian;
use App\Share;
use App\User;
use App\Zip;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@@ -13,7 +16,11 @@ use Illuminate\Http\Request;
use App\FileManagerFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Http\Exceptions\HttpResponseException;
use Madnest\Madzipper\Facades\Madzipper;
use Response;
use League\Flysystem\FileNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
class FileAccessController extends Controller
{
@@ -84,9 +91,63 @@ class FileAccessController extends Controller
$this->check_file_access($shared, $file);
}
// Store user download size
$request->user()->record_download((int)$file->getRawOriginal('filesize'));
return $this->download_file($file);
}
/**
* Get generated zip for user
*
* @param $id
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function get_zip($id)
{
$zip = Zip::where('id', $id)
->where('user_id', Auth::id())
->first();
$zip_path = 'zip/' . $zip->basename;
$header = [
"Content-Type" => 'application/zip',
"Content-Length" => Storage::disk('local')->size($zip_path),
"Accept-Ranges" => "bytes",
"Content-Range" => "bytes 0-600/" . Storage::disk('local')->size($zip_path),
"Content-Disposition" => "attachment; filename=" . $zip->basename,
];
return Storage::disk('local')->download($zip_path, $zip->basename, $header);
}
/**
* Get generated zip for guest
*
* @param $id
* @param $token
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function get_zip_public($id, $token)
{
$zip = Zip::where('id', $id)
->where('shared_token', $token)
->first();
$zip_path = 'zip/' . $zip->basename;
$header = [
"Content-Type" => 'application/zip',
"Content-Length" => Storage::disk('local')->size($zip_path),
"Accept-Ranges" => "bytes",
"Content-Range" => "bytes 0-600/" . Storage::disk('local')->size($zip_path),
"Content-Disposition" => "attachment; filename=" . $zip->basename,
];
return Storage::disk('local')->download($zip_path, $zip->basename, $header);
}
/**
* Get file public
*
@@ -113,6 +174,9 @@ class FileAccessController extends Controller
// Check file access
$this->check_file_access($shared, $file);
// Store user download size
User::find($shared->user_id)->record_download((int)$file->getRawOriginal('filesize'));
return $this->download_file($file);
}

View File

@@ -36,6 +36,7 @@ class BrowseController extends Controller
->with(['parent'])
->where('user_id', $user_id)
->whereIn('unique_id', filter_folders_ids($folders_trashed))
->sortable()
->get();
// Get files trashed
@@ -43,6 +44,7 @@ class BrowseController extends Controller
->with(['parent'])
->where('user_id', $user_id)
->whereNotIn('folder_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'unique_id'))))
->sortable()
->get();
// Collect folders and files to single array
@@ -72,11 +74,13 @@ class BrowseController extends Controller
$folders = FileManagerFolder::with(['parent', 'shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->whereIn('unique_id', $folder_ids)
->sortable()
->get();
$files = FileManagerFile::with(['parent', 'shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->whereIn('unique_id', $file_ids)
->sortable()
->get();
// Collect folders and files to single array
@@ -91,7 +95,9 @@ class BrowseController extends Controller
public function latest() {
// Get User
$user = User::with(['latest_uploads'])
$user = User::with(['latest_uploads' => function($query) {
$query->sortable();
}])
->where('id', Auth::id())
->first();
@@ -106,8 +112,11 @@ class BrowseController extends Controller
public function participant_uploads() {
// Get User
$uploads = FileManagerFile::with(['parent'])->where('user_id', Auth::id())
->whereUserScope('editor')->orderBy('created_at', 'DESC')->get();
$uploads = FileManagerFile::with(['parent'])
->where('user_id', Auth::id())
->whereUserScope('editor')
->sortable()
->get();
return $uploads;
}
@@ -132,12 +141,14 @@ class BrowseController extends Controller
->with('parent')
->where('user_id', $user_id)
->where('parent_id', $unique_id)
->sortable()
->get();
$files = FileManagerFile::onlyTrashed()
->with('parent')
->where('user_id', $user_id)
->where('folder_id', $unique_id)
->sortable()
->get();
// Collect folders and files to single array
@@ -148,13 +159,13 @@ class BrowseController extends Controller
$folders = FileManagerFolder::with(['parent', 'shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->where('parent_id', $unique_id)
->orderBy('created_at', 'DESC')
->sortable()
->get();
$files = FileManagerFile::with(['parent', 'shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->where('folder_id', $unique_id)
->orderBy('created_at', 'DESC')
->sortable()
->get();
// Collect folders and files to single array
@@ -171,6 +182,7 @@ class BrowseController extends Controller
$folders = FileManagerFolder::with('folders:id,parent_id,unique_id,name')
->where('parent_id', 0)
->where('user_id', Auth::id())
->sortable()
->get(['id', 'parent_id', 'unique_id', 'name']);
return [
@@ -193,33 +205,17 @@ class BrowseController extends Controller
{
// Get user
$user_id = Auth::id();
$query = remove_accents($request->input('query'));
// Search files id db
$searched_files = FileManagerFile::search($request->input('query'))
$searched_files = FileManagerFile::search($query)
->where('user_id', $user_id)
->get();
$searched_folders = FileManagerFolder::search($request->input('query'))
$searched_folders = FileManagerFolder::search($query)
->where('user_id', $user_id)
->get();
// Collect folders and files to single array
return collect([$searched_folders, $searched_files])->collapse();
}
/**
* Get file record
*
* @param $unique_id
* @return mixed
*/
public function file_detail($unique_id)
{
// Get user id
$user_id = Auth::id();
return FileManagerFile::with(['shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
}
}

View File

@@ -10,6 +10,7 @@ use App\Http\Requests\FileFunctions\UploadRequest;
use App\Http\Tools\Demo;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use App\Http\Tools\Guardian;
@@ -168,40 +169,43 @@ class EditItemsController extends Controller
* @return ResponseFactory|\Illuminate\Http\Response
* @throws Exception
*/
public function user_delete_item(DeleteItemRequest $request, $unique_id)
public function user_delete_item(DeleteItemRequest $request)
{
// Demo preview
if (is_demo(Auth::id())) {
return Demo::response_204();
}
// Check permission to delete item for authenticated editor
if ($request->user()->tokenCan('editor')) {
foreach ($request->input('data') as $file) {
$unique_id = $file['unique_id'];
// Prevent force delete for non-master users
if ($request->input('data.force_delete')) abort('401');
// Check permission to delete item for authenticated editor
if ($request->user()->tokenCan('editor')) {
// check if shared_token cookie exist
if (!$request->hasCookie('shared_token')) abort('401');
// Prevent force delete for non-master users
if ($file['force_delete']) abort('401');
// Get shared token
$shared = get_shared($request->cookie('shared_token'));
// check if shared_token cookie exist
if (!$request->hasCookie('shared_token')) abort('401');
// Get file|folder item
$item = get_item($request->input('data.type'), $unique_id, Auth::id());
// Get shared token
$shared = get_shared($request->cookie('shared_token'));
// Check access to requested directory
if ($request->input('data.type') === 'folder') {
Guardian::check_item_access($item->unique_id, $shared);
} else {
Guardian::check_item_access($item->folder_id, $shared);
// Get file|folder item
$item = get_item($file['type'], $unique_id, Auth::id());
// Check access to requested directory
if ($file['type'] === 'folder') {
Guardian::check_item_access($item->unique_id, $shared);
} else {
Guardian::check_item_access($item->folder_id, $shared);
}
}
// Delete item
Editor::delete_item($file, $unique_id);
}
// Delete item
Editor::delete_item($request, $unique_id);
// Return response
return response(null, 204);
}
@@ -214,7 +218,7 @@ class EditItemsController extends Controller
* @return ResponseFactory|\Illuminate\Http\Response
* @throws Exception
*/
public function guest_delete_item(DeleteItemRequest $request, $unique_id, $token)
public function guest_delete_item(DeleteItemRequest $request, $token)
{
// Get shared record
$shared = get_shared($token);
@@ -227,19 +231,22 @@ class EditItemsController extends Controller
// Check shared permission
if (!is_editor($shared)) abort(403);
// Get file|folder item
$item = get_item($request->input('data.type'), $unique_id, $shared->user_id);
foreach ($request->input('data') as $file) {
$unique_id = $file['unique_id'];
// Check access to requested item
if ($request->input('data.type') === 'folder') {
Guardian::check_item_access($item->unique_id, $shared);
} else {
Guardian::check_item_access($item->folder_id, $shared);
// Get file|folder item
$item = get_item($file['type'], $unique_id, $shared->user_id);
// Check access to requested item
if ($file['type'] === 'folder') {
Guardian::check_item_access($item->unique_id, $shared);
} else {
Guardian::check_item_access($item->folder_id, $shared);
}
// Delete item
Editor::delete_item($file, $unique_id, $shared);
}
// Delete item
Editor::delete_item($request, $unique_id, $shared);
// Return response
return response(null, 204);
}
@@ -309,19 +316,13 @@ class EditItemsController extends Controller
}
/**
* Move item for authenticated master|editor user
* User download multiple files via zip
*
* @param MoveItemRequest $request
* @param $unique_id
* @return ResponseFactory|\Illuminate\Http\Response
* @param Request $request
* @return string
*/
public function user_move(MoveItemRequest $request, $unique_id)
public function user_zip_multiple_files(Request $request)
{
// Demo preview
if (is_demo(Auth::id())) {
return Demo::response_204();
}
// Check permission to upload for authenticated editor
if ($request->user()->tokenCan('editor')) {
@@ -331,12 +332,98 @@ class EditItemsController extends Controller
// Get shared token
$shared = get_shared($request->cookie('shared_token'));
$file_parent_folders = FileManagerFile::whereUserId(Auth::id())
->whereIn('unique_id', $request->input('files'))
->get()
->pluck('folder_id')
->toArray();
// Check access to requested directory
Guardian::check_item_access($request->to_unique_id, $shared);
Guardian::check_item_access($file_parent_folders, $shared);
}
// Get requested files
$files = FileManagerFile::whereUserId(Auth::id())
->whereIn('unique_id', $request->input('files'))
->get();
$zip = Editor::zip_files($files);
// Get file
return response([
'url' => route('zip', $zip->id),
'name' => $zip->basename,
], 200);
}
/**
* Guest download multiple files via zip
*
* @param Request $request
* @param $token
* @return string
*/
public function guest_zip_multiple_files(Request $request, $token)
{
// Get shared record
$shared = get_shared($token);
$file_parent_folders = FileManagerFile::whereUserId($shared->user_id)
->whereIn('unique_id', $request->input('files'))
->get()
->pluck('folder_id')
->toArray();
// Check access to requested directory
Guardian::check_item_access($file_parent_folders, $shared);
// Get requested files
$files = FileManagerFile::whereUserId($shared->user_id)
->whereIn('unique_id', $request->input('files'))
->get();
$zip = Editor::zip_files($files, $shared);
// Get file
return response([
'url' => route('zip_public', [
'id' => $zip->id,
'token' => $shared->token,
]),
'name' => $zip->basename,
], 200);
}
/**
* Move item for authenticated master|editor user
*
* @param MoveItemRequest $request
* @param $unique_id
* @return ResponseFactory|\Illuminate\Http\Response
*/
public function user_move(MoveItemRequest $request)
{
// Demo preview
if (is_demo(Auth::id())) {
return Demo::response_204();
}
$to_unique_id = $request->input('to_unique_id');
// Check permission to upload for authenticated editor
if ($request->user()->tokenCan('editor')) {
// check if shared_token cookie exist
if (!$request->hasCookie('shared_token')) abort('401');
// Get shared token
$shared = get_shared($request->cookie('shared_token'));
// Check access to requested directory
Guardian::check_item_access($to_unique_id, $shared);
}
// Move item
Editor::move($request, $unique_id);
Editor::move($request, $to_unique_id);
return response('Done!', 204);
}
@@ -349,11 +436,14 @@ class EditItemsController extends Controller
* @param $token
* @return ResponseFactory|\Illuminate\Http\Response
*/
public function guest_move(MoveItemRequest $request, $unique_id, $token)
public function guest_move(MoveItemRequest $request, $token)
{
// Get shared record
$shared = get_shared($token);
//Unique id of Folder where move
$to_unique_id = $request->input('to_unique_id');
// Demo preview
if (is_demo(Auth::id())) {
return Demo::response_204();
@@ -362,23 +452,28 @@ class EditItemsController extends Controller
// Check shared permission
if (!is_editor($shared)) abort(403);
$moving_unique_id = $unique_id;
foreach ($request->input('items') as $item) {
if ($request->from_type !== 'folder') {
$file = FileManagerFile::where('unique_id', $unique_id)
->where('user_id', $shared->user_id)
->firstOrFail();
$unique_id = $item['unique_id'];
$moving_unique_id = $unique_id;
$moving_unique_id = $file->folder_id;
if ($item['type'] !== 'folder') {
$file = FileManagerFile::where('unique_id', $unique_id)
->where('user_id', $shared->user_id)
->firstOrFail();
$moving_unique_id = $file->folder_id;
}
// Check access to requested item
Guardian::check_item_access([
$to_unique_id, $moving_unique_id
], $shared);
}
// Check access to requested item
Guardian::check_item_access([
$request->to_unique_id, $moving_unique_id
], $shared);
// Move item
Editor::move($request, $unique_id, $shared);
Editor::move($request, $to_unique_id, $shared);
return response('Done!', 204);
}

View File

@@ -20,16 +20,18 @@ class FavouriteController extends Controller
public function store(Request $request)
{
// Validate request
$validator = Validator::make($request->all(), [
'unique_id' => 'required|integer',
$validator = Validator::make($request->input('folders'), [
'*.unique_id' => 'required|integer',
]);
// Return error
if ($validator->fails()) abort(400, 'Bad input');
foreach($request->input('folders') as $item) {
// Get user & folder
$user = Auth::user();
$folder = FileManagerFolder::where('unique_id', $request->unique_id)->first();
$folder = FileManagerFolder::where('unique_id', $item['unique_id'])->first();
if (is_demo($user->id)) {
return Demo::favourites($user);
@@ -39,8 +41,9 @@ class FavouriteController extends Controller
if ($folder->user_id !== $user->id) abort(403);
// Add folder to user favourites
$user->favourite_folders()->syncWithoutDetaching($request->unique_id);
$user->favourite_folders()->syncWithoutDetaching($item['unique_id']);
}
// Return updated favourites
return $user->favourite_folders;
}

View File

@@ -5,6 +5,7 @@ namespace App\Http\Controllers\FileFunctions;
use App\Http\Requests\Share\CreateShareRequest;
use App\Http\Requests\Share\UpdateShareRequest;
use App\Http\Resources\ShareResource;
use App\Zip;
use Illuminate\Contracts\Routing\ResponseFactory;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
@@ -93,15 +94,25 @@ class ShareController extends Controller
* @return ResponseFactory|\Illuminate\Http\Response
* @throws \Exception
*/
public function destroy($token)
public function destroy(Request $request)
{
// Get sharing record
$shared = Share::where('token', $token)
->where('user_id', Auth::id())
->firstOrFail();
foreach($request->input('tokens') as $token) {
// Delete shared record
$shared->delete();
// Get sharing record
Share::where('token', $token)
->where('user_id', Auth::id())
->firstOrFail()
->delete();
// Get zip record
$zip = Zip::where('shared_token', $token)
->where('user_id', Auth::id())
->first();
if ($zip) {
$zip->delete();
}
}
// Done
return response('Done!', 204);

View File

@@ -171,5 +171,25 @@ class UpgradeAppController extends Controller
echo 'Operation failed.';
}
}
/*
* Upgrade expire_in in shares table
*
* @since v1.7.11
*/
if (! Schema::hasColumn('file_manager_files', 'metadata')) {
$command = Artisan::call('migrate', [
'--force' => true
]);
if ($command === 0) {
echo 'Operation was successful.';
}
if ($command === 1) {
echo 'Operation failed.';
}
}
}
}

View File

@@ -58,6 +58,10 @@ class FileSharingController extends Controller
->first();
if ($image) {
// Store user download size
User::find($shared->user_id)->record_download((int) $image->getRawOriginal('filesize'));
return $this->show_image($image);
}
}
@@ -247,6 +251,7 @@ class FileSharingController extends Controller
$folders = FileManagerFolder::with('folders:id,parent_id,unique_id,name')
->where('parent_id', $shared->item_id)
->where('user_id', $shared->user_id)
->sortable()
->get(['id', 'parent_id', 'unique_id', 'name']);
// Return folder tree
@@ -277,6 +282,7 @@ class FileSharingController extends Controller
$folders = FileManagerFolder::with('folders:id,parent_id,unique_id,name')
->where('parent_id', $shared->item_id)
->where('user_id', $shared->user_id)
->sortable()
->get(['id', 'parent_id', 'unique_id', 'name']);
// Return folder tree
@@ -399,10 +405,12 @@ class FileSharingController extends Controller
{
$folders = FileManagerFolder::where('user_id', $shared->user_id)
->where('parent_id', $unique_id)
->sortable()
->get();
$files = FileManagerFile::where('user_id', $shared->user_id)
->where('folder_id', $unique_id)
->sortable()
->get();
return [$folders, $files];

View File

@@ -107,7 +107,15 @@ class AccountController extends Controller
*/
public function update_user_settings(Request $request)
{
// TODO: validation
// Validate request
$validator = Validator::make($request->all(), [
'name' => 'string',
'value' => 'string',
]);
// Return error
if ($validator->fails()) abort(400, 'Bad input');
// Get user
$user = Auth::user();

View File

@@ -355,6 +355,25 @@ function format_gigabytes($gigabytes)
}
}
/**
* Format string to formated megabytes string
*
* @param $megabytes
* @return string
*/
function format_megabytes($megabytes)
{
if ($megabytes >= 1000) {
return $megabytes / 1000 . 'GB';
}
if ($megabytes >= 1000000) {
return $megabytes / 1000000 . 'TB';
}
return $megabytes . 'MB';
}
/**
* Convert megabytes to bytes
*
@@ -528,4 +547,189 @@ function get_pretty_name($basename, $name, $mimetype)
}
return $name . '.' . $mimetype;
}
}
/**
* Get exif data from jpeg image
*
* @param $file
* @return array
*/
function get_image_meta_data($file)
{
if (get_file_type_from_mimetype($file->getMimeType()) === 'jpeg') {
return exif_read_data($file);
}
}
/**
* Check if app is in dev mode
*
* @return bool
*/
function is_dev()
{
return env('APP_ENV') === 'local' ? true : false;
}
/**
* @param $str
* @return bool
*/
function seems_utf8($str)
{
$length = strlen($str);
for ($i=0; $i < $length; $i++) {
$c = ord($str[$i]);
if ($c < 0x80) $n = 0; # 0bbbbbbb
elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb
elseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb
elseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb
elseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb
elseif (($c & 0xFE) == 0xFC) $n=5; # 1111110b
else return false; # Does not match any model
for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))
return false;
}
}
return true;
}
/**
* Converts all accent characters to ASCII characters.
*
* If there are no accent characters, then the string given is just returned.
*
* @param string $string Text that might have accent characters
* @return string Filtered string with replaced "nice" characters.
*/
function remove_accents($string) {
if ( !preg_match('/[\x80-\xff]/', $string) )
return $string;
if (seems_utf8($string)) {
$chars = array(
// Decompositions for Latin-1 Supplement
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
chr(195).chr(191) => 'y',
// Decompositions for Latin Extended-A
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
chr(197).chr(190) => 'z', chr(197).chr(191) => 's',
// Euro Sign
chr(226).chr(130).chr(172) => 'E',
// GBP (Pound) Sign
chr(194).chr(163) => '');
$string = strtr($string, $chars);
} else {
// Assume ISO-8859-1 if not UTF-8
$chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)
.chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)
.chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)
.chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)
.chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)
.chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)
.chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)
.chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)
.chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)
.chr(252).chr(253).chr(255);
$chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";
$string = strtr($string, $chars['in'], $chars['out']);
$double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));
$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');
$string = str_replace($double_chars['in'], $double_chars['out'], $string);
}
return $string;
}

View File

@@ -25,8 +25,9 @@ class DeleteItemRequest extends FormRequest
public function rules()
{
return [
'data.type' => 'required|string',
'data.force_delete' => 'required|boolean',
'data[*].force_delete' => 'required|boolean',
'data[*].type' => 'required|string',
'data[*].unique_id' => 'required|integer'
];
}
}

View File

@@ -25,8 +25,9 @@ class MoveItemRequest extends FormRequest
public function rules()
{
return [
'to_unique_id' => 'required|integer',
'from_type' => 'required|string',
'to_unique_id' => 'required|integer',
'items[*].type' => 'required|string',
'items[*].unique_id' => 'required|integer',
];
}
}

View File

@@ -2,6 +2,7 @@
namespace App\Http\Requests\FileFunctions;
use App\Rules\MimetypeBlacklistValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
@@ -26,7 +27,7 @@ class UploadRequest extends FormRequest
{
return [
'parent_id' => 'required|integer',
'file' => 'required|file',
'file' => ['required','file' , new MimetypeBlacklistValidation]
];
}
}

View File

@@ -46,7 +46,7 @@ class StoreUpgradeAccountRequest extends FormRequest
'plan.data.attributes.capacity' => 'required|digits_between:1,9',
'plan.data.attributes.capacity_formatted' => 'required|string',
'plan.data.attributes.currency' => 'required|string',
'plan.data.attributes.description' => 'required|string',
'plan.data.attributes.description' => 'sometimes|string|nullable',
'plan.data.attributes.name' => 'required|string',
'plan.data.attributes.price' => 'required|string',
'plan.data.id' => 'required|string',

View File

@@ -8,6 +8,7 @@ use App\FileManagerFile;
use App\FileManagerFolder;
use App\Http\Requests\FileFunctions\RenameItemRequest;
use App\User;
use App\Zip;
use Aws\Exception\MultipartUploadException;
use Aws\S3\MultipartUploader;
use Carbon\Carbon;
@@ -18,11 +19,83 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Intervention\Image\ImageManagerStatic as Image;
use League\Flysystem\FileNotFoundException;
use Madnest\Madzipper\Facades\Madzipper;
use Symfony\Component\HttpKernel\Exception\HttpException;
class Editor
{
/**
* Zip selected files, store it in /zip folder and retrieve zip record
*
* @param $files
* @param null $shared
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public static function zip_files($files, $shared = null)
{
// Local storage instance
$disk_local = Storage::disk('local');
// Create zip directory
if (!$disk_local->exists('zip')) {
$disk_local->makeDirectory('zip');
}
// Move file to local storage from external storage service
if (!is_storage_driver('local')) {
// Create temp directory
if (!$disk_local->exists('temp')) {
$disk_local->makeDirectory('temp');
}
foreach ($files as $file) {
try {
$disk_local->put('temp/' . $file['basename'], Storage::get('file-manager/' . $file['basename']));
} catch (FileNotFoundException $e) {
throw new HttpException(404, 'File not found');
}
}
}
// Get zip path
$zip_name = Str::random(16) . '.zip';
$zip_path = 'zip/' . $zip_name;
// Create zip
$zip = Madzipper::make(storage_path() . '/app/' . $zip_path);
// Get files folder on local storage drive
$files_directory = is_storage_driver('local') ? 'file-manager' : 'temp';
// Add files to zip
$files->each(function ($file) use ($zip, $files_directory) {
$zip->addString($file['name'], File::get(storage_path() . '/app/' . $files_directory . '/' . $file['basename']));
});
// Close zip
$zip->close();
// Delete temporary files
if (!is_storage_driver('local')) {
$files->each(function ($file) use ($disk_local) {
$disk_local->delete('temp/' . $file['basename']);
});
}
// Store zip record
return Zip::create([
'user_id' => $shared->user_id ?? Auth::id(),
'shared_token' => $shared->token ?? null,
'basename' => $zip_name,
]);
}
/**
* Create new directory
*
@@ -86,13 +159,13 @@ class Editor
* @param null $shared
* @throws \Exception
*/
public static function delete_item($request, $unique_id, $shared = null)
public static function delete_item($file, $unique_id, $shared = null)
{
// Get user id
$user = is_null($shared) ? Auth::user() : User::findOrFail($shared->user_id);
// Delete folder
if ($request->input('data.type') === 'folder') {
if ($file['type'] === 'folder') {
// Get folder
$folder = FileManagerFolder::withTrashed()
@@ -113,7 +186,7 @@ class Editor
}
// Force delete children files
if ($request->input('data.force_delete')) {
if ($file['force_delete']) {
// Get children folder ids
$child_folders = filter_folders_ids($folder->trashed_folders, 'unique_id');
@@ -142,7 +215,7 @@ class Editor
}
// Soft delete items
if (!$request->input('data.force_delete')) {
if (!$file['force_delete']) {
// Remove folder from user favourites
$user->favourite_folders()->detach($unique_id);
@@ -153,10 +226,10 @@ class Editor
}
// Delete item
if ($request->input('data.type') !== 'folder') {
if ($file['type'] !== 'folder') {
// Get file
$file = FileManagerFile::withTrashed()
$item = FileManagerFile::withTrashed()
->where('user_id', $user->id)
->where('unique_id', $unique_id)
->first();
@@ -173,23 +246,23 @@ class Editor
}
// Force delete file
if ($request->input('data.force_delete')) {
if ($file['force_delete']) {
// Delete file
Storage::delete('/file-manager/' . $file->basename);
Storage::delete('/file-manager/' . $item->basename);
// Delete thumbnail if exist
if ($file->thumbnail) Storage::delete('/file-manager/' . $file->getRawOriginal('thumbnail'));
if ($item->thumbnail) Storage::delete('/file-manager/' . $item->getRawOriginal('thumbnail'));
// Delete file permanently
$file->forceDelete();
$item->forceDelete();
}
// Soft delete file
if (!$request->input('data.force_delete')) {
if (!$file['force_delete']) {
// Soft delete file
$file->delete();
$item->delete();
}
}
}
@@ -201,32 +274,36 @@ class Editor
* @param $unique_id
* @param null $shared
*/
public static function move($request, $unique_id, $shared = null)
public static function move($request, $to_unique_id, $shared = null)
{
// Get user id
$user_id = is_null($shared) ? Auth::id() : $shared->user_id;
if ($request->from_type === 'folder') {
foreach ($request->input('items') as $item) {
$unique_id = $item['unique_id'];
// Move folder
$item = FileManagerFolder::where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
if ($item['type'] === 'folder') {
$item->update([
'parent_id' => $request->to_unique_id
]);
// Move folder
$item = FileManagerFolder::where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
} else {
$item->update([
'parent_id' => $to_unique_id
]);
// Move file under new folder
$item = FileManagerFile::where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
} else {
$item->update([
'folder_id' => $request->to_unique_id
]);
// Move file under new folder
$item = FileManagerFile::where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
$item->update([
'folder_id' => $to_unique_id
]);
}
}
}
@@ -251,12 +328,26 @@ class Editor
$disk_file_name = basename('chunks/' . $file->getClientOriginalName(), '.part');
$temp_filename = $file->getClientOriginalName();
// Generate file
File::append(config('filesystems.disks.local.root') . '/chunks/' . $temp_filename, $file->get());
// File Path
$file_path = config('filesystems.disks.local.root') . '/chunks/' . $temp_filename;\
// Generate file
File::append($file_path, $file->get());
// Size of file
$file_size = File::size($file_path);
// Size of limit
$limit = get_setting('upload_limit');
// File size handling
if( $limit && $file_size > format_bytes($limit)) abort(413);
// If last then process file
if ($request->boolean('is_last')) {
$metadata = get_image_meta_data($file);
$disk_local = Storage::disk('local');
$unique_id = get_unique_id();
@@ -292,6 +383,7 @@ class Editor
'mimetype' => get_file_type_from_mimetype($file_mimetype),
'type' => get_file_type($file_mimetype),
'folder_id' => $request->parent_id,
'metadata' => $metadata,
'name' => $user_file_name,
'unique_id' => $unique_id,
'basename' => $disk_file_name,
@@ -301,6 +393,19 @@ class Editor
'user_id' => $user_id,
];
// Store user upload size
if ($request->user()) {
// If upload a loged user
$request->user()->record_upload($file_size);
} else {
// If upload guest
User::find($shared->user_id)->record_upload($file_size);
}
// Return new file
return FileManagerFile::create($options);
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class MimetypeBlacklistValidation implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$mimetype_blacklist = explode(',' ,get_setting('mimetypes_blacklist'));
$file_mimetype = explode('/' ,$value->getMimeType());
return !array_intersect($file_mimetype , $mimetype_blacklist);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
abort (415,'Type of this mime type is not allowed.');
}
}

View File

@@ -32,6 +32,8 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Share whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Share whereUserId($value)
* @mixin \Eloquent
* @property int|null $expire_in
* @method static \Illuminate\Database\Eloquent\Builder|Share whereExpireIn($value)
*/
class Share extends Model
{

30
app/Traffic.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* App\Traffic
*
* @property int $id
* @property int $user_id
* @property int $upload
* @property int $download
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Traffic newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Traffic newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Traffic query()
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereDownload($value)
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereUpload($value)
* @method static \Illuminate\Database\Eloquent\Builder|Traffic whereUserId($value)
* @mixin \Eloquent
*/
class Traffic extends Model
{
protected $fillable = ['user_id', 'upload', 'download'];
}

View File

@@ -5,6 +5,7 @@ namespace App;
use App\Notifications\ResetPassword;
use App\Notifications\ResetUserPasswordNotification;
use ByteUnits\Metric;
use Carbon\Carbon;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Storage;
@@ -157,10 +158,10 @@ class User extends Authenticatable
$is_storage_limit = $storage_limitation ? $storage_limitation : 1;
// Get user storage usage
if (! $is_storage_limit) {
if (!$is_storage_limit) {
return [
'used' => $this->used_capacity,
'used' => $this->used_capacity,
'used_formatted' => Metric::bytes($this->used_capacity)->format(),
];
}
@@ -194,9 +195,12 @@ class User extends Authenticatable
*/
public function getFolderTreeAttribute()
{
// Get sorting setup
return FileManagerFolder::with(['folders.shared', 'shared:token,id,item_id,permission,protected,expire_in'])
->where('parent_id', 0)
->where('user_id', $this->id)
->sortable()
->get();
}
@@ -252,6 +256,46 @@ class User extends Authenticatable
$this->notify(new ResetPassword($token));
}
/**
* Record user upload filesize
*
* @param $file_size
*/
public function record_upload($file_size)
{
$now = Carbon::now();
$record = Traffic::whereYear('created_at', '=', $now->year)
->whereMonth('created_at', '=', $now->month)
->firstOrCreate([
'user_id' => $this->id,
]);
$record->update([
'upload' => $record->upload + $file_size
]);
}
/**
* Record user download filesize
*
* @param $file_size
*/
public function record_download($file_size)
{
$now = Carbon::now();
$record = Traffic::whereYear('created_at', '=', $now->year)
->whereMonth('created_at', '=', $now->month)
->firstOrCreate([
'user_id' => $this->id,
]);
$record->update([
'download' => $record->download + $file_size
]);
}
/**
* Get user favourites folder
*
@@ -269,7 +313,7 @@ class User extends Authenticatable
*/
public function latest_uploads()
{
return $this->hasMany(FileManagerFile::class)->with(['parent'])->orderBy('created_at', 'DESC')->take(40);
return $this->hasMany(FileManagerFile::class)->with(['parent'])->take(40);
}
/**

27
app/Zip.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Zip extends Model
{
protected $guarded = ['id'];
public $incrementing = false;
protected $keyType = 'string';
/**
* Generate uuid
*/
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->id = (string)Str::uuid();
});
}
}

View File

@@ -25,6 +25,7 @@
"laravel/ui": "^2.0",
"league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-cached-adapter": "^1.0",
"madnest/madzipper": "^1.1",
"teamtnt/laravel-scout-tntsearch-driver": "^8.3"
},
"require-dev": {

59
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "aadbe31a952d26aab5730369e2bf4089",
"content-hash": "2753a719196cd76d1bd7ee346540266c",
"packages": [
{
"name": "asm89/stack-cors",
@@ -2778,6 +2778,62 @@
],
"time": "2020-07-01T11:33:50+00:00"
},
{
"name": "madnest/madzipper",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/madnest/madzipper.git",
"reference": "fd1d8199d04eac103eed9355c9bba680dcf8b89b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/madnest/madzipper/zipball/fd1d8199d04eac103eed9355c9bba680dcf8b89b",
"reference": "fd1d8199d04eac103eed9355c9bba680dcf8b89b",
"shasum": ""
},
"require": {
"ext-zip": "*",
"illuminate/filesystem": "^6.18|^7.0|^8.0",
"illuminate/support": "^6.18|^7.0|^8.0",
"php": ">=7.2.0"
},
"require-dev": {
"mockery/mockery": "^1.3",
"orchestra/testbench": "^5.1",
"phpunit/phpunit": "^8.0|^9.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Madnest\\Madzipper\\MadzipperServiceProvider"
],
"aliases": {
"Madzipper": "Madnest\\Madzipper\\Madzipper"
}
}
},
"autoload": {
"psr-4": {
"Madnest\\Madzipper\\": "src/Madnest/Madzipper"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jakub Theimer",
"email": "theimer@madne.st",
"homepage": "https://madne.st",
"role": "Developer"
}
],
"description": "Wannabe successor of Chumper/Zipper package for Laravel",
"time": "2020-12-01T23:44:14+00:00"
},
{
"name": "moneyphp/money",
"version": "v3.3.1",
@@ -7809,6 +7865,7 @@
"faker",
"fixtures"
],
"abandoned": true,
"time": "2019-12-12T13:22:17+00:00"
},
{

View File

@@ -165,6 +165,7 @@ return [
TeamTNT\Scout\TNTSearchScoutServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Laravel\Passport\PassportServiceProvider::class,
Madnest\Madzipper\MadzipperServiceProvider::class,
/*
* Package Service Providers...
@@ -232,6 +233,7 @@ return [
'Image' => Intervention\Image\Facades\Image::class,
'Stripe' => Cartalyst\Stripe\Laravel\Facades\Stripe::class,
'Crawler' => Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect::class,
'Madzipper' => Madnest\Madzipper\Madzipper::class,
],
'deploy_secret' => env('APP_DEPLOY_SECRET'),

View File

@@ -41,7 +41,7 @@ return [
|
*/
'queue' => env('SCOUT_QUEUE', false),
'queue' => env('SCOUT_QUEUE', true),
/*
|--------------------------------------------------------------------------

View File

@@ -2,8 +2,8 @@
return [
'version' => '1.7.10',
'version' => '1.8',
// Define size of chunk uploaded by MB. E.g. integer 128 means chunk size will be 128MB.
'chunk_size' => env('CHUNK_SIZE', '128'),
];
];

View File

@@ -0,0 +1,20 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\FileManagerFile;
use Faker\Generator as Faker;
use Illuminate\Support\Carbon;
$factory->define(FileManagerFile::class, function (Faker $faker) {
return [
'unique_id' => $faker->randomDigit,
'user_id' => 0,
'folder_id' => 0,
'name' => $faker->firstName,
'basename' => $faker->lastName,
'user_scope' => 'master',
'updated_at' => Carbon::now(),
'created_at' => Carbon::now()
];
});

View File

@@ -0,0 +1,17 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\FileManagerFolder;
use Faker\Generator as Faker;
$factory->define(FileManagerFolder::class, function (Faker $faker) {
return [
'id' => $faker->randomDigit,
'unique_id' => $faker->randomDigit,
'user_id' => 1,
'parent_id' => 0,
'name' => $faker->sentence,
'type' => 'folder',
];
});

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddExifDataToFileManagerFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('file_manager_files', function (Blueprint $table) {
$table->longText('metadata')->after('type')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('file_manager_files', function (Blueprint $table) {
//
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTrafficTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('traffic', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('user_id');
$table->bigInteger('upload')->default(0);
$table->bigInteger('download')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('traffic');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateZipsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('zips', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->bigInteger('user_id');
$table->string('shared_token')->nullable();
$table->text('basename');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('zips');
}
}

70
env.testing Normal file
View File

@@ -0,0 +1,70 @@
APP_NAME=vueFileManager
APP_ENV=local
APP_KEY=base64:v+s0R2C5q8jYySj3uwrKA8KH8c9JBIZTdXqB2ytk4j8=
APP_DEBUG=true
APP_URL=http://localhost
APP_DEMO=false
LOG_CHANNEL=stack
DB_CONNECTION=sqlite
DB_HOST=null
DB_PORT=null
DB_DATABASE=database/database.sqlite
DB_USERNAME=null
DB_PASSWORD=null
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=sty
MAIL_PORT=3254
MAIL_USERNAME=Milos
MAIL_PASSWORD=milos123
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="${MAIL_USERNAME}"
MAIL_FROM_NAME="${MAIL_USERNAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=
DO_SPACES_KEY=
DO_SPACES_SECRET=
DO_SPACES_ENDPOINT=
DO_SPACES_REGION=
DO_SPACES_BUCKET=
WASABI_KEY=
WASABI_SECRET=
WASABI_ENDPOINT=
WASABI_REGION=
WASABI_BUCKET=
BACKBLAZE_KEY=
BACKBLAZE_SECRET=
BACKBLAZE_ENDPOINT=
BACKBLAZE_REGION=
BACKBLAZE_BUCKET=
PASSPORT_CLIENT_ID=1
PASSPORT_CLIENT_SECRET=TqSdKJUbCbC7g5To3Clriw9BMblef0nIdEaI81Q5
APP_DEPLOY_SECRET=
CASHIER_LOGGER=stack
CASHIER_CURRENCY=
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
CASHIER_PAYMENT_NOTIFICATION=App\Notifications\ConfirmPayment

View File

@@ -24,7 +24,7 @@
"lodash": "^4.17.20",
"node-sass": "^4.14.1",
"vee-validate": "^3.3.9",
"vue": "^2.6.10",
"vue": "^2.6.11",
"vue-feather-icons": "^5.1.0",
"vue-i18n": "^8.21.0",
"vue-router": "^3.4.3",

View File

@@ -0,0 +1,12 @@
<svg width="13px" height="15px" viewBox="0 0 13 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="VueFileManager" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Storage-Alert-Copy" transform="translate(-888.000000, -238.000000)" stroke="#000000" stroke-width="1.6">
<g id="Sorting-Menu" transform="translate(865.000000, 67.000000)">
<g id="alphabet-icon" transform="translate(24.000000, 172.000000)">
<polyline id="Path" points="11.1999993 13.1999991 5.59999967 0.199999094 0 13.1999991 5.59999967 0.199999094"></polyline>
<line x1="2.25" y1="8" x2="8.75" y2="8" id="Line-2"></line>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 854 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More