mirror of
https://github.com/hyzendust/freedoms4-backend-public.git
synced 2026-07-01 07:22:18 +02:00
Compare commits
2 Commits
483b995270
...
b99440ea75
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b99440ea75 | ||
|
|
31c4356b1e |
@@ -139,7 +139,7 @@ if ($user_id === 0) {
|
|||||||
$pdo = db_connect();
|
$pdo = db_connect();
|
||||||
|
|
||||||
// Prevent admin from acting on themselves
|
// Prevent admin from acting on themselves
|
||||||
$stmt = $pdo->prepare('SELECT username FROM users WHERE id = :id LIMIT 1');
|
$stmt = $pdo->prepare('SELECT username, email FROM users WHERE id = :id LIMIT 1');
|
||||||
$stmt->execute([':id' => $user_id]);
|
$stmt->execute([':id' => $user_id]);
|
||||||
$target = $stmt->fetch();
|
$target = $stmt->fetch();
|
||||||
if (!$target) {
|
if (!$target) {
|
||||||
@@ -202,6 +202,12 @@ if ($action === 'delete_user') {
|
|||||||
|
|
||||||
$pdo->prepare('DELETE FROM users WHERE id = :id')
|
$pdo->prepare('DELETE FROM users WHERE id = :id')
|
||||||
->execute([':id' => $user_id]);
|
->execute([':id' => $user_id]);
|
||||||
|
|
||||||
|
// Clear OTP history for this email so re-signing-up doesn't hit the
|
||||||
|
// daily OTP request limit because of OTPs sent before deletion.
|
||||||
|
$pdo->prepare('DELETE FROM email_otps WHERE email = :e')
|
||||||
|
->execute([':e' => $target['email']]);
|
||||||
|
|
||||||
json_out(['success' => true]);
|
json_out(['success' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
auth.php
10
auth.php
@@ -528,14 +528,14 @@ if ($action === 'signup') {
|
|||||||
|
|
||||||
$welcome_message =
|
$welcome_message =
|
||||||
"Hi {$username},\n\n" .
|
"Hi {$username},\n\n" .
|
||||||
"Welcome aboard!\n\n" .
|
"Welcome aboard, thank you for signing up!\n\n" .
|
||||||
"Thank you for signing up.\n\n" .
|
"Your credentials for the services:\n\n" .
|
||||||
"Your credentials for services:\n\n" .
|
|
||||||
"XMPP JID: {$xmpp_username}@freedoms4.org\n" .
|
|
||||||
"Email ID: {$username}@freedoms4.org\n" .
|
"Email ID: {$username}@freedoms4.org\n" .
|
||||||
|
"XMPP JID: {$xmpp_username}@freedoms4.org\n" .
|
||||||
"Passwords: Use the same password that you used during registration.\n\n" .
|
"Passwords: Use the same password that you used during registration.\n\n" .
|
||||||
"If you have any questions, I'm here to help:\n" .
|
"If you have any questions, I'm here to help:\n" .
|
||||||
"Email <mailto:hyzen@freedoms4.org> and XMPP <xmpp:hyzen@freedoms4.org>: hyzen@freedoms4.org\n" .
|
"Email: mailto:hyzen@freedoms4.org\n".
|
||||||
|
"XMPP: xmpp:hyzen@freedoms4.org\n" .
|
||||||
"IRC/Liberachat: hyzen, #freedoms4\n\n" .
|
"IRC/Liberachat: hyzen, #freedoms4\n\n" .
|
||||||
"Best regards,\n" .
|
"Best regards,\n" .
|
||||||
"hyzen, freedoms4.org.";
|
"hyzen, freedoms4.org.";
|
||||||
|
|||||||
Reference in New Issue
Block a user