Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix: access to tmp folder by www-data

Miguel Ribeiro51b22727bf56
diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php
index 36821b1..8d61ae5 100644
--- a/endpoints/subscriptions/get.php
+++ b/endpoints/subscriptions/get.php
@@ -194,6 +194,18 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
}
}
+ if ($sortOrder == "category_id") {
+ usort($print, function ($a, $b) use ($categories) {
+ return $categories[$a['category_id']]['order'] - $categories[$b['category_id']]['order'];
+ });
+ }
+
+ if ($sortOrder == "payment_method_id") {
+ usort($print, function ($a, $b) use ($payment_methods) {
+ return $payment_methods[$a['payment_method_id']]['order'] - $payment_methods[$b['payment_method_id']]['order'];
+ });
+ }
+
if (isset($print)) {
printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "../../", $settings['disabledToBottom'], $settings['mobileNavigation'], $settings['showSubscriptionProgress']);
}
diff --git a/includes/version.php b/includes/version.php
index c09e001..81a4134 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v2.45.2";
+$version = "v2.46.0";
?>
\ No newline at end of file
diff --git a/index.php b/index.php
index f8e5681..1812947 100644
--- a/index.php
+++ b/index.php
@@ -130,6 +130,18 @@ foreach ($subscriptions as $subscription) {
$payment_methods[$paymentMethodId]['count']++;
}
+if ($sortOrder == "category_id") {
+ usort($subscriptions, function ($a, $b) use ($categories) {
+ return $categories[$a['category_id']]['order'] - $categories[$b['category_id']]['order'];
+ });
+}
+
+if ($sortOrder == "payment_method_id") {
+ usort($subscriptions, function ($a, $b) use ($payment_methods) {
+ return $payment_methods[$a['payment_method_id']]['order'] - $payment_methods[$b['payment_method_id']]['order'];
+ });
+}
+
$headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hidden";
?>
<style>
diff --git a/startup.sh b/startup.sh
index 388c353..df370e1 100644
--- a/startup.sh
+++ b/startup.sh
@@ -11,6 +11,8 @@ PGID=${PGID:-82}
groupmod -o -g "$PGID" www-data
usermod -o -u "$PUID" www-data
chown -R www-data:www-data /var/www/html
+chown -R www-data:www-data /tmp
+chmod -R 770 /tmp
# Start both PHP-FPM and Nginx
php-fpm & nginx -g 'daemon off;' & touch ~/startup.txt