fixed reset password script, adding user panel
This commit is contained in:
parent
3d4a06df18
commit
3ff1d42924
3 changed files with 73 additions and 3 deletions
|
@ -30,7 +30,7 @@ for param in $POST_DATA; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check if the user exists in the database
|
# 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';")
|
USER_EXISTS=$(sqlite3 $DB_PATH "SELECT COUNT(*) FROM users WHERE username='$USERNAME' AND email='$EMAIL';")
|
||||||
|
|
||||||
if [ "$USER_EXISTS" -eq 0 ]; then
|
if [ "$USER_EXISTS" -eq 0 ]; then
|
||||||
|
@ -53,7 +53,7 @@ TOKEN=$(openssl rand -hex 16)
|
||||||
EXPIRATION=$(($(date +%s) + 3600))
|
EXPIRATION=$(($(date +%s) + 3600))
|
||||||
|
|
||||||
# Store the reset token and expiration in the database
|
# 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
|
# Send reset link email
|
||||||
RESET_LINK="https://monotreme.org/cgi-bin/reset_password.cgi?token=$TOKEN"
|
RESET_LINK="https://monotreme.org/cgi-bin/reset_password.cgi?token=$TOKEN"
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>Reset Your Password</h1>
|
<h1>Reset Your Password</h1>
|
||||||
<form action="/cgi-bin/reset_password_confirm.cgi" method="post">
|
<form action="/cgi-bin/reset_password_confirm.cgi" method="post">
|
||||||
<input type="hidden" name="token" value="$TOKEN">
|
<input type="hidden" name="token" value="$TOKEN">
|
||||||
<label for="password">New Password:</label>
|
<label for="password">New Password:</label>
|
||||||
<input type="password" id="password" name="password" required>
|
<input type="password" id="password" name="password" required>
|
||||||
<br>
|
<br>
|
||||||
|
|
70
user_panel/index.html
Normal file
70
user_panel/index.html
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>User Panel - monotreme.org</title>
|
||||||
|
<link rel="stylesheet" href="../styles.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<!-- Header -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="header">
|
||||||
|
<h1>Welcome to Your User Panel</h1>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Navigation -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="nav">
|
||||||
|
<a href="/">Home</a>
|
||||||
|
<a href="/about/">About</a>
|
||||||
|
<a href="/blog/">Blog</a>
|
||||||
|
<a href="/contact/">Contact</a>
|
||||||
|
<a href="/logout/">Logout</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Main Content and Sidebar -->
|
||||||
|
<tr>
|
||||||
|
<!-- Sidebar -->
|
||||||
|
<td class="sidebar">
|
||||||
|
<p><strong>User Options</strong></p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/user/profile">View Profile</a></li>
|
||||||
|
<li><a href="/user/settings">Account Settings</a></li>
|
||||||
|
<li><a href="/user/activity">Activity Log</a></li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- Main Content Area -->
|
||||||
|
<td class="content">
|
||||||
|
<h2>Hello, [USERNAME]!</h2>
|
||||||
|
<p>Welcome to your personal dashboard. Here, you can manage your account, view recent activity, and update your profile information.</p>
|
||||||
|
|
||||||
|
<div class="dashboard">
|
||||||
|
<h3>Your Recent Activity</h3>
|
||||||
|
<p>No recent activity available.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings">
|
||||||
|
<h3>Quick Settings</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/user/profile">Update Profile Information</a></li>
|
||||||
|
<li><a href="/user/change_password">Change Password</a></li>
|
||||||
|
<li><a href="/user/notifications">Manage Notifications</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="footer">
|
||||||
|
<p>© 2024 monotreme.org</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue