diff --git a/assets/images/pp/4b8bd95296e082031c8ae8c4b35fed88.png b/assets/images/pp/4b8bd95296e082031c8ae8c4b35fed88.png
new file mode 100644
index 00000000..7ec285db
Binary files /dev/null and b/assets/images/pp/4b8bd95296e082031c8ae8c4b35fed88.png differ
diff --git a/assets/images/pp/cc83c3045d2b41073f0939f298d06459.jpg b/assets/images/pp/cc83c3045d2b41073f0939f298d06459.jpg
new file mode 100644
index 00000000..309a0f73
Binary files /dev/null and b/assets/images/pp/cc83c3045d2b41073f0939f298d06459.jpg differ
diff --git a/src/pages/other/account_settings.php b/src/pages/other/account_settings.php
index 2fad3432..e99b3114 100644
--- a/src/pages/other/account_settings.php
+++ b/src/pages/other/account_settings.php
@@ -175,11 +175,11 @@ $user = $result->fetch_assoc();
}
if (response.status === 'success') {
- // Update the profile picture source with cache-busting query string
- // Reload the current page
- window.location.reload();
-
$('#responseMessage').html('
' + response.message + '
');
+ // Reload the current page after a short delay
+ setTimeout(function() {
+ window.location.reload();
+ }, 1500);
} else {
$('#responseMessage').html('' + response.message + '
');
}
diff --git a/src/processors/upload_profile_picture.php b/src/processors/upload_profile_picture.php
index 775ea2a9..e31a4f56 100644
--- a/src/processors/upload_profile_picture.php
+++ b/src/processors/upload_profile_picture.php
@@ -1,9 +1,15 @@
'error', 'message' => 'Database connection failed']));
+}
$response = array('status' => 'error', 'message' => 'Something went wrong');
@@ -69,11 +75,11 @@ if (isset($_FILES['profile_picture']) && $_FILES['profile_picture']['error'] !=
// Log the action
auditLog($user_id, 'PROFILE_PIC_UPLOAD', 'users', $user_id, ['filename' => $randomFilename]);
} else {
- $response['message'] = 'Failed to update profile picture in the database';
+ $response['message'] = 'Failed to update profile picture in the database: ' . $stmt->error;
}
$stmt->close();
} else {
- $response['message'] = 'Failed to move uploaded file.';
+ $response['message'] = 'Failed to move uploaded file. Error code: ' . $_FILES['profile_picture']['error'];
}
} else {
$response['message'] = 'No file uploaded or file error.';