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 = $version ?>
+Wallos = $version ?> = $demoMode ? "Demo" : "" ?>
= translate('license', $i18n) ?>:
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) {
+ ?>
+
diff --git a/styles/styles.css b/styles/styles.css index 64619fc39..facdeb3de 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -1262,7 +1262,9 @@ button.disabled { cursor: not-allowed; } -input[type="text"]:disabled { +input[type="text"]:disabled, +input[type="password"]:disabled, +input[type="email"]:disabled { background-color: #f5f5f5; border-color: #f5f5f5; cursor: not-allowed; @@ -2471,4 +2473,13 @@ input[type="radio"]:checked+label::after { .update-banner > span { font-weight: 500; +} + +.demo-banner { + padding: 15px 20px; + background-color: rgba(var(--error-color-rgb), 0.2); + border: 1px solid #f45a40; + border-radius: 12px; + margin-bottom: 20px; + text-align: center; } \ No newline at end of file