From 656ec726f24dc76690d51fed4c10385c04ca69e3 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:30:10 +0300 Subject: [PATCH] admin --- app/Controllers/AdminController.php | 54 +++ app/Controllers/Api/Profile/Update.php | 5 +- app/Core/Routes.php | 2 + app/Services/Upload.php | 10 +- views/components/AdminSidebar.php | 112 +++++ views/components/Navbar.php | 4 + views/pages/Admin/General.php | 0 views/pages/Admin/Index.php | 576 +++++++++++++++++++++++++ views/pages/Main.php | 42 -- 9 files changed, 757 insertions(+), 48 deletions(-) create mode 100644 views/components/AdminSidebar.php create mode 100644 views/pages/Admin/General.php create mode 100644 views/pages/Admin/Index.php diff --git a/app/Controllers/AdminController.php b/app/Controllers/AdminController.php index e69de29..07494cf 100644 --- a/app/Controllers/AdminController.php +++ b/app/Controllers/AdminController.php @@ -0,0 +1,54 @@ +getType() !== null) { + $this->photourl = $upload->getSrc(); } else { + $this->photourl = $user->i('photourl'); } } else { diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 0abb501..706c43d 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -39,6 +39,8 @@ class Routes Router::get('/api/photo/vote', 'ApiController@photovote'); Router::get('/api/photo/comment/rate', 'ApiController@photocommentvote'); + Router::get('/admin', 'AdminController@index'); + Router::get('/logout', 'MainController@logout'); Router::get('/404', 'ExceptionRegister@notfound'); } else { diff --git a/app/Services/Upload.php b/app/Services/Upload.php index 5201889..1f9d4ca 100644 --- a/app/Services/Upload.php +++ b/app/Services/Upload.php @@ -24,7 +24,9 @@ class Upload } public function __construct($file, $location) { - $filecdn = bin2hex(openssl_random_pseudo_bytes(64, $cstrong)) . '.' . pathinfo($file['name'])['extension']; + + $cstrong = True; + $filecdn = bin2hex(openssl_random_pseudo_bytes(64, $cstrong)) . '.' . 'jpeg'; $folder = $location . $filecdn; $s3 = new \Aws\S3\S3Client([ 'region' => NGALLERY['root']['storage']['s3']['credentials']['region'], @@ -35,10 +37,10 @@ class Upload ], 'endpoint' => NGALLERY['root']['storage']['s3']['domains']['gateway'], ]); - $cstrong = True; - $result = $s3->putObject([ + + $s3->putObject([ 'Bucket' => NGALLERY['root']['storage']['s3']['credentials']['bucket'], - 'Key' => $folder, + 'Key' => 'cdn/img/'.$filecdn, 'SourceFile' => $file['tmp_name'] ]); $this->type = explode('/', $file['type'])[0]; diff --git a/views/components/AdminSidebar.php b/views/components/AdminSidebar.php new file mode 100644 index 0000000..dadd239 --- /dev/null +++ b/views/components/AdminSidebar.php @@ -0,0 +1,112 @@ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+
+
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+
+
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+ dfgfgdfggdfdgf
+
+ df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