diff --git a/README.md b/README.md index 171d6cc7e..bf51ff148 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Wallos: Open-Source Personal Subscription Tracker - [Introduction](#introduction) - [Features](#features) +- [Demo](#demo) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Baremetal](#baremetal) @@ -46,6 +47,17 @@ Wallos is a powerful, open-source, and self-hostable web application designed to - Notifications: Wallos supports multiple notification methods (email, discord, pushover, telegram, gotify and webhooks). Get notified about your upcoming payments. - Multi Language support. +## Demo + +If you want to try Wallos, a demo is available at [https://demo.wallosapp.com](https://demo.wallosapp.com). +The database is reset every 2 hours. +To access the demo use the following credentials: + +```python +Username: demo +Password: demo +``` + ## Getting Started See instructions to run Wallos below. diff --git a/about.php b/about.php index bd5f9cfb8..66a1b96ef 100644 --- a/about.php +++ b/about.php @@ -10,7 +10,7 @@

-

Wallos

+

Wallos

: GPLv3 diff --git a/endpoints/user/save_user.php b/endpoints/user/save_user.php index 0931a9510..98d156dc9 100644 --- a/endpoints/user/save_user.php +++ b/endpoints/user/save_user.php @@ -90,6 +90,8 @@ function update_exchange_rate($db, $userId) } } +$demoMode = getenv('DEMO_MODE'); + $query = "SELECT main_currency FROM user WHERE id = :userId"; $stmt = $db->prepare($query); $stmt->bindParam(':userId', $userId, SQLITE3_INTEGER); @@ -244,7 +246,7 @@ function resizeAndUploadAvatar($uploadedFile, $uploadDir, $name) $avatar = resizeAndUploadAvatar($_FILES['profile_pic'], '../../images/uploads/logos/avatars/', $name); } - if (isset($_POST['password']) && $_POST['password'] != "") { + if (isset($_POST['password']) && $_POST['password'] != "" && !$demoMode) { $password = $_POST['password']; if (isset($_POST['confirm_password'])) { $confirm = $_POST['confirm_password']; @@ -266,7 +268,7 @@ function resizeAndUploadAvatar($uploadedFile, $uploadDir, $name) } } - if (isset($_POST['password']) && $_POST['password'] != "") { + if (isset($_POST['password']) && $_POST['password'] != "" && !$demoMode) { $sql = "UPDATE user SET avatar = :avatar, email = :email, password = :password, main_currency = :main_currency, language = :language WHERE id = :userId"; } else { $sql = "UPDATE user SET avatar = :avatar, email = :email, main_currency = :main_currency, language = :language WHERE id = :userId"; @@ -279,7 +281,7 @@ function resizeAndUploadAvatar($uploadedFile, $uploadDir, $name) $stmt->bindParam(':language', $language, SQLITE3_TEXT); $stmt->bindParam(':userId', $userId, SQLITE3_INTEGER); - if (isset($_POST['password']) && $_POST['password'] != "") { + if (isset($_POST['password']) && $_POST['password'] != "" && !$demoMode) { $hashedPassword = password_hash($password, PASSWORD_DEFAULT); $stmt->bindParam(':password', $hashedPassword, SQLITE3_TEXT); } diff --git a/includes/header.php b/includes/header.php index e7b3d9294..0b4a0bf02 100644 --- a/includes/header.php +++ b/includes/header.php @@ -18,6 +18,8 @@ exit(); } + $demoMode = getenv('DEMO_MODE'); + $theme = "automatic"; if (isset($settings['theme'])) { $theme = $settings['theme']; diff --git a/includes/version.php b/includes/version.php index 71ad0c7f5..8baed2d45 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/index.php b/index.php index f516c20c5..3306025cc 100644 --- a/index.php +++ b/index.php @@ -143,6 +143,15 @@ } } } + + if ($demoMode) { + ?> +

+ Running in Demo Mode, certain actions and settings are disabled.
+ The database will be reset every 120 minutes. +
+
diff --git a/login.php b/login.php index 0e930020b..36cedd051 100644 --- a/login.php +++ b/login.php @@ -20,6 +20,8 @@ exit(); } +$demoMode = getenv('DEMO_MODE'); + $cookieExpire = time() + (30 * 24 * 60 * 60); // Check if login is disabled @@ -258,10 +260,16 @@
-
- - -
+ +
+ + +
+
diff --git a/settings.php b/settings.php index ee750b8ce..b60458a83 100644 --- a/settings.php +++ b/settings.php @@ -59,8 +59,7 @@ class="avatar-option" data-src="images/uploads/logos/avatars/">
- +
@@ -68,11 +67,11 @@ class="avatar-option" data-src="images/uploads/logos/avatars/">
- + >
- + >
" /> placeholder="" value="" />
- +
:
+ placeholder="" + >
@@ -1193,19 +1193,25 @@ class="color-picker fa-solid fa-eye-dropper"> onClick="saveCustomColors()" class="buton thin mobile-grow" id="save-colors">
-
-

-
-
- -
-
- + +
+

+
+
+ +
+
+ +
-
+
- > + >

- > - + > +
@@ -1287,22 +1296,22 @@ class="thin">