You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: library/ajax/deleteprofile.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
<?php
2
2
3
-
db_transaction(function () {
3
+
$now = date('Y-m-d H:i:s');
4
+
db_transaction(function () use ($now) {
4
5
// Only append .deleted suffix if the email doesn't already have it
5
6
// This prevents double-deletion if the query is somehow executed twice
6
7
// Pattern checks for .deleted.<digits> after the @ symbol (e.g., user@domain.com.deleted.123)
7
-
db_query('UPDATE cms_users SET deleted = NOW(), email = CONCAT(email,".deleted.",id) WHERE id = :id AND (NOT deleted OR deleted IS NULL) AND email NOT REGEXP "@.*\.deleted\.[0-9]+$"', ['id' => $_POST['cms_user_id']]);
8
+
db_query('UPDATE cms_users SET deleted = :now, email = CONCAT(email,".deleted.",id) WHERE id = :id AND (NOT deleted OR deleted IS NULL) AND email NOT REGEXP "@.*\.deleted\.[0-9]+$"', ['now' => $now, 'id' => $_POST['cms_user_id']]);
8
9
updateAuth0UserFromDb($_POST['cms_user_id']);
9
10
});
10
11
11
-
simpleSaveChangeHistory('cms_users', $_POST['cms_user_id'], 'Record deleted without undelete');
12
+
simpleSaveChangeHistory('cms_users', $_POST['cms_user_id'], 'Record deleted without undelete', $now);
12
13
// when a user deactive its account we need to ensure that user logged out immediately and then redirected to Auth0 login page
0 commit comments