diff --git a/brain/utility/DocTools.php b/brain/utility/DocTools.php index d29c0db..6b99581 100644 --- a/brain/utility/DocTools.php +++ b/brain/utility/DocTools.php @@ -60,13 +60,13 @@ class DocTools public static function deleteFolder($path) { if (!empty($path) && is_dir($path)) { - $dir = new RecursiveDirectoryIterator( + $dir = new \RecursiveDirectoryIterator( $path, - RecursiveDirectoryIterator::SKIP_DOTS + \RecursiveDirectoryIterator::SKIP_DOTS ); //upper dirs are not included,otherwise DISASTER HAPPENS :) $files = new RecursiveIteratorIterator( $dir, - RecursiveIteratorIterator::CHILD_FIRST + \RecursiveIteratorIterator::CHILD_FIRST ); foreach ($files as $f) { if (is_file($f)) { diff --git a/brain/utility/FileUploader.php b/brain/utility/FileUploader.php index befb992..52421ba 100644 --- a/brain/utility/FileUploader.php +++ b/brain/utility/FileUploader.php @@ -4,7 +4,7 @@ namespace brain\utility use Psr\Http\Message\UploadedFileInterface; -define("MAXIMUM_FILESIZE", "10485760"); //10 MB +//define("MAXIMUM_FILESIZE", "10485760"); //10 MB class FileUploader { public static function uploadFile(string $directory, $file) diff --git a/brain/utility/Setup.php b/brain/utility/Setup.php index afa9a20..20909c0 100644 --- a/brain/utility/Setup.php +++ b/brain/utility/Setup.php @@ -106,6 +106,7 @@ class SetUp $backup = $request->getUploadedFiles(); $file = $backup["backup-upload"]; + //NOTE: If this fails check 'post_max_size' in php.ini $size = $file->getSize(); $name = $file->getClientFileName(); @@ -113,7 +114,7 @@ class SetUp $file->moveTo("../content" . "/" . $name); //open it and get files to verify user - $zip = new ZipArchive(); + $zip = new \ZipArchive(); if ($zip->open("../content" . "/" . $name) === true) { $folks = json_decode($zip->getFromName("settings/folks.json"), true); $found = find($folks, ["handle" => $body["restore_member_handle"]]); diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index 72413a9..beb0441 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -1199,8 +1199,11 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; method = REQUEST_TYPE_POST; type = CONTENT_TYPE_FORM; data = new FormData(form); - var result, err; - return; + this._request(url, event, method, type, data).then((result)=>{ + resolve(result); + }).catch((err)=>{ + reject(err); + }); }); } /** @@ -1770,7 +1773,7 @@ class PostEditor { exports.default = PostEditor; PostEditor.uploadFiles = []; -},{"../../libraries/FipamoAdminAPI":"6M96o","./MaintenanceManager":"kY7L1","../events/DataEvent":"edzJV","../actions/PageActions":"5t6eY","../events/EditorEvent":"dW8iq","../ui/TextEditor":"bMFpA","../ui/Notifications":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","../ui/FileManager":"kp4D5"}],"5t6eY":[function(require,module,exports) { +},{"../../libraries/FipamoAdminAPI":"6M96o","./MaintenanceManager":"kY7L1","../events/DataEvent":"edzJV","../actions/PageActions":"5t6eY","../events/EditorEvent":"dW8iq","../ui/TextEditor":"bMFpA","../ui/Notifications":"fmUxI","../ui/FileManager":"kp4D5","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"5t6eY":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _stringUtils = require("../utils/StringUtils"); @@ -2035,7 +2038,7 @@ class TextEditor extends _eventEmitterDefault.default { } exports.default = TextEditor; -},{"../events/DataEvent":"edzJV","caret-pos":"9lzNv","../events/EventEmitter":"cbFNs","../events/EditorEvent":"dW8iq","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","prismjs/components/prism-core":"cps8h","prismjs/components/prism-markup":"dIns2","prismjs/components/prism-markdown":"gqRFx"}],"9lzNv":[function(require,module,exports) { +},{"../events/DataEvent":"edzJV","caret-pos":"9lzNv","../events/EventEmitter":"cbFNs","../events/EditorEvent":"dW8iq","prismjs/components/prism-core":"cps8h","prismjs/components/prism-markup":"dIns2","prismjs/components/prism-markdown":"gqRFx","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"9lzNv":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); parcelHelpers.export(exports, "getOffset", ()=>getOffset1 @@ -5576,7 +5579,7 @@ class FileManager { } exports.default = FileManager; -},{"sortablejs":"fLJM6","../utils/DataUtils":"lpIyf","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","./Notifications.js":"fmUxI"}],"fLJM6":[function(require,module,exports) { +},{"sortablejs":"fLJM6","../utils/DataUtils":"lpIyf","./Notifications.js":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"fLJM6":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); parcelHelpers.export(exports, "MultiDrag", ()=>MultiDragPlugin diff --git a/src/com/controllers/MaintenanceManager.js b/src/com/controllers/MaintenanceManager.js index d53dd57..f7cc9c3 100644 --- a/src/com/controllers/MaintenanceManager.js +++ b/src/com/controllers/MaintenanceManager.js @@ -102,7 +102,6 @@ class MaintenanceManager { method = REQUEST_TYPE_POST; type = CONTENT_TYPE_FORM; data = new FormData(form); - return; this._request(url, event, method, type, data) .then(result => { resolve(result);