From 3ff1d429242d613e7af1d80d76de6100fa4e5bf1 Mon Sep 17 00:00:00 2001 From: Tristan Smith Date: Sun, 22 Sep 2024 17:20:51 -0400 Subject: [PATCH] fixed reset password script, adding user panel --- scripts/forgot_password.cgi | 4 +-- scripts/reset_password.cgi | 2 +- user_panel/index.html | 70 +++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 user_panel/index.html diff --git a/scripts/forgot_password.cgi b/scripts/forgot_password.cgi index e8ceb6a..e321217 100644 --- a/scripts/forgot_password.cgi +++ b/scripts/forgot_password.cgi @@ -30,7 +30,7 @@ for param in $POST_DATA; do done # Check if the user exists in the database -DB_PATH="/path/to/your/database.db" +DB_PATH="/var/lib/monotreme/data/monotreme .db" USER_EXISTS=$(sqlite3 $DB_PATH "SELECT COUNT(*) FROM users WHERE username='$USERNAME' AND email='$EMAIL';") if [ "$USER_EXISTS" -eq 0 ]; then @@ -53,7 +53,7 @@ TOKEN=$(openssl rand -hex 16) EXPIRATION=$(($(date +%s) + 3600)) # Store the reset token and expiration in the database -sqlite3 $DB_PATH "UPDATE users SET reset_token='$TOKEN', reset_expires=$EXPIRATION WHERE username='$USERNAME';" +sqlite3 $DB_PATH "UPDATE users SET reset_token='$TOKEN', reset_expires=$EXPIRATION WHERE username='$USERNAME';" # Send reset link email RESET_LINK="https://monotreme.org/cgi-bin/reset_password.cgi?token=$TOKEN" diff --git a/scripts/reset_password.cgi b/scripts/reset_password.cgi index 65f3a92..a62dcc2 100644 --- a/scripts/reset_password.cgi +++ b/scripts/reset_password.cgi @@ -30,7 +30,7 @@

Reset Your Password

- +
diff --git a/user_panel/index.html b/user_panel/index.html new file mode 100644 index 0000000..2f68e51 --- /dev/null +++ b/user_panel/index.html @@ -0,0 +1,70 @@ + + + + + + User Panel - monotreme.org + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Welcome to Your User Panel

+
+

Hello, [USERNAME]!

+

Welcome to your personal dashboard. Here, you can manage your account, view recent activity, and update your profile information.

+ +
+

Your Recent Activity

+

No recent activity available.

+
+ + +
+ +