From b5b7befd34e9327134b84dab85090e0c93fba89d Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Wed, 25 Dec 2024 16:32:23 +0300 Subject: [PATCH] user photo add --- kernel/FileUpload.php | 8 ++++-- kernel/admin_themes/default/layout/main.php | 6 ++++- ...ativeArr.php => BootstrapSelectFilter.php} | 2 +- kernel/filters/CustomSelectFilter.php | 23 ------------------ kernel/modules/menu/views/index.php | 7 ++++-- .../ModuleShopClientController.php | 1 + .../module_shop_client/views/index.php | 11 ++++++--- kernel/modules/post/views/index.php | 2 +- .../user/controllers/UserController.php | 18 +++++++++++++- .../2024_09_23_125827_create_user_table.php | 1 + kernel/modules/user/models/User.php | 4 ++- .../user/models/forms/CreateUserForm.php | 7 ++++-- kernel/modules/user/service/UserService.php | 14 +++++++++++ kernel/modules/user/views/form.php | 10 ++++++++ kernel/modules/user/views/index.php | 3 +++ kernel/modules/user/views/view.php | 3 +++ kernel/templates/views/index_template | 10 ++++++++ resources/images/noPhoto.png | Bin 0 -> 4085 bytes 18 files changed, 92 insertions(+), 38 deletions(-) rename kernel/filters/{CustomSelectFilterForAssociativeArr.php => BootstrapSelectFilter.php} (88%) delete mode 100644 kernel/filters/CustomSelectFilter.php create mode 100644 resources/images/noPhoto.png diff --git a/kernel/FileUpload.php b/kernel/FileUpload.php index 7a1705b..a61893c 100644 --- a/kernel/FileUpload.php +++ b/kernel/FileUpload.php @@ -36,7 +36,9 @@ class FileUpload $newFileName = md5(time() . $this->fileName) . '.' . $this->fileExtension; if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir . mb_substr($newFileName, 0, 2) . '/' . mb_substr($newFileName, 2, 2) . '/'; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $newFileName; $this->uploadFile = $this->uploadDir . $newFileName; @@ -49,7 +51,9 @@ class FileUpload } else { if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $this->fileName; $this->uploadFile = $this->uploadDir . $this->fileName; diff --git a/kernel/admin_themes/default/layout/main.php b/kernel/admin_themes/default/layout/main.php index db00106..1574044 100644 --- a/kernel/admin_themes/default/layout/main.php +++ b/kernel/admin_themes/default/layout/main.php @@ -27,7 +27,11 @@