diff --git a/Admin/Installer.php b/Admin/Installer.php index cd565ea..1216349 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -297,9 +297,9 @@ final class Installer extends InstallerAbstract $module->apiMediaUpload($request, $response); - $uploadedIds = $response->getDataArray('')['response']; + $uploadedIds = $response->getDataArray('')['response'] ?? []; - if ($data['create_collection'] ?? false) { + if (($data['create_collection'] ?? false) && !empty($uploadedIds)) { $response = new HttpResponse(); $request = new HttpRequest(); diff --git a/Docs/Dev/en/structure.md b/Docs/Dev/en/structure.md deleted file mode 100755 index 2f50fee..0000000 --- a/Docs/Dev/en/structure.md +++ /dev/null @@ -1,5 +0,0 @@ -# Structure - -## ER - -![ER](Modules/Media/Docs/Dev/img/er.png) \ No newline at end of file diff --git a/Docs/Dev/img/er.png b/Docs/Dev/img/er.png deleted file mode 100644 index 5da1ffe..0000000 Binary files a/Docs/Dev/img/er.png and /dev/null differ diff --git a/Docs/Help/en/SUMMARY.md b/Docs/Help/en/SUMMARY.md deleted file mode 100755 index 4b927b3..0000000 --- a/Docs/Help/en/SUMMARY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Developer Content - -* [Templates]({%}&page=Dev/api_template) diff --git a/Docs/Help/en/introduction.md b/Docs/Help/en/introduction.md deleted file mode 100755 index d94e0fd..0000000 --- a/Docs/Help/en/introduction.md +++ /dev/null @@ -1,31 +0,0 @@ -# Introduction - -The **Media** module is used for uploading and managing all files. This makes the module a core module which is installed upon application installation. - -## Target Group - -The target group for this module is everyone, since every application musst have this module. Depending on the configuration every user can use this module to upload files. - -# Setup - -The module can be installed through the integrated module downloader and installer or by uploading the module into the `Modules/` directory and executing the installation through the module installer. - -# Features - -## Media Upload - -This module is always used to upload files to the application. All other modules that have to handle files have to use this module in order to upload and provide files. If no connection to the application is available the upload will begin as soon as a connection is made. Even files that stopped uploading due to connection loss will continue the upload once a connection is re-established. - -Instead of manually uploading files it's also possible to link directories on the hard drive of the application. This enables organizations to share large amounts of files without uploading them to the application. - -## Media Management - -The module allows to group files (collection) together for easier sharing and management. This grouping is different from traditional directories since multiple groups can contain a reference to the same file. It's also possible to organize files in traditional directories and manage their permissions. - -Permissions can be on file/collection/directory, user and group level providing full control over who can do what. On top of these permissions it's also possible to assign passwords to them. The permission management allows finely tune how to share files. - -# Recommendation - -Other modules that work great with this one together are: - -* [Draw](Draw) diff --git a/Models/Media.php b/Models/Media.php index 8a64a35..0fbca83 100755 --- a/Models/Media.php +++ b/Models/Media.php @@ -268,9 +268,7 @@ class Media implements \JsonSerializable */ public function setPassword(?string $password) : void { - $temp = empty($password) ? null : \password_hash($password, \PASSWORD_BCRYPT); - - $this->password = $temp === false ? null : $temp; + $this->password = empty($password) ? null : \password_hash($password, \PASSWORD_BCRYPT); } /** diff --git a/Models/UploadFile.php b/Models/UploadFile.php index a520482..8020ba9 100755 --- a/Models/UploadFile.php +++ b/Models/UploadFile.php @@ -201,7 +201,7 @@ class UploadFile // Make sure uploaded file is not executable $currentPermissions = \fileperms($dest); - $newPermissions = $currentPermissions & ~0100; + $newPermissions = $currentPermissions & ~0100; \chmod($dest, $newPermissions); if ($encryptionKey !== '') { diff --git a/info.json b/info.json index 2bfc281..6c5e243 100755 --- a/info.json +++ b/info.json @@ -12,7 +12,7 @@ }, "creator": { "name": "Jingga", - "website": "jingga.app" + "website": "https://jingga.app" }, "description": "The media module.", "directory": "Media",