From 7defd8b3888f7063acab7b8e7bb2a868ceced8b5 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 19 Jan 2023 11:26:56 +0100 Subject: [PATCH 1/4] Update minor dependency changes --- Dockerfile | 2 +- composer.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f2921f2..55e82aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM php:7.4-cli RUN apt-get update && \ apt-get install -y \ - sqlite \ + sqlite3 \ unzip \ git diff --git a/composer.json b/composer.json index b416487..f790e29 100644 --- a/composer.json +++ b/composer.json @@ -5,5 +5,10 @@ }, "require-dev": { "ext-pdo_sqlite": "*" + }, + "config": { + "allow-plugins": { + "simplesamlphp/composer-module-installer": true + } } } From 567962c94780bb320e653d66b16ecaf90ab5b113 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 19 Jan 2023 11:27:48 +0100 Subject: [PATCH 2/4] Fix admins addGroup and removeGroup, missing parameter --- src/pvv/admin/usermanager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pvv/admin/usermanager.php b/src/pvv/admin/usermanager.php index 8086297..3f45a9b 100644 --- a/src/pvv/admin/usermanager.php +++ b/src/pvv/admin/usermanager.php @@ -32,7 +32,7 @@ class UserManager{ } public function addGroup($uname, $group){ - $userFlags = $this->getUsergroups(); + $userFlags = $this->getUsergroups($uname); if($userFlags){ $newFlags = ($group | $userFlags); @@ -41,7 +41,7 @@ class UserManager{ } public function removeGroup($uname, $group){ - $userFlags = $this->getUsergroups(); + $userFlags = $this->getUsergroups($uname); if($userFlags){ $newFlags = ($userFlags & (~ $group)); @@ -131,4 +131,4 @@ class UserManager{ return $users; } -} \ No newline at end of file +} From 9f45271b18d17ba1929f383db63e4dbc28c822b8 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 19 Jan 2023 11:28:29 +0100 Subject: [PATCH 3/4] Update deprecated template syntax --- inc/navbar.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/navbar.php b/inc/navbar.php index bb86cc6..22c0af0 100644 --- a/inc/navbar.php +++ b/inc/navbar.php @@ -51,17 +51,17 @@ function loginBar($sp = null, $pdo = null) { $userManager = new \pvv\admin\UserManager($pdo); $isAdmin = $userManager->isAdmin($uname); } - $result .= "\t${svg}" . htmlspecialchars($uname) . "\n"; + $result .= "\t{$svg}" . htmlspecialchars($uname) . "\n"; $result .= "\n\t\n"; } else { - $result .= "\tgetLoginURL()) . "\">${svg}Logg inn\n"; + $result .= "\tgetLoginURL()) . "\">{$svg}Logg inn\n"; } $result .= "\n\t☰ MENU\n"; From 6bd3ce77316d41073795b9fb30f696c81fe57dc4 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 19 Jan 2023 13:46:39 +0100 Subject: [PATCH 4/4] Add notice on empty image gallery --- www/galleri/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/galleri/index.php b/www/galleri/index.php index b8d39ca..cba76e1 100644 --- a/www/galleri/index.php +++ b/www/galleri/index.php @@ -111,6 +111,11 @@ $imageTemplate = ' ]; echo strtr($imageTemplate, $vars); } + + if (count($images) == 0) { + echo "

Det er dessverre ingen bilder å vise.

"; + } + ?>