Files
intaleq/backend/auth/sendVerifyEmail.php
T
Hamza-AyedandClaude Opus 5 92dc6b3641 chore: استيراد أولي من سيرو (ecfe7568) — بلا أي تعديل
نسخة كاملة من مستودع سيرو عند ecfe7568 لتكون أساس تطبيق «انطلق».
نُسخ المتعقَّب في git فقط (12,509 ملفاً / 302 م.ب) بـ git archive، لا
`cp -r` — فاستُثنيت تلقائياً مخلفات البناء (build · node_modules ·
.dart_tool · .gradle · Pods ≈ 10.7 غ.ب) وكل ما يستثنيه .gitignore.

هذا الكوميت **بلا أي تعديل عمداً** حتى يكون كل ما يليه فرقاً مقروءاً
مقابل سيرو الأصلي. سيرو نفسه لم يُمسّ.

⚠️ لا يبني بعد: `.env` و`lib/env/env.g.dart` غير متعقَّبين في سيرو (وهذا
صحيح — أسرار لكل مستأجر). كل تطبيق فلاتر هنا يحتاج .env خاصاً بانطلق ثم
توليد env.g.dart عبر build_runner. لا تُنسخ أسرار سيرو.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:10:29 +03:00

71 lines
2.1 KiB
PHP

<?php
require_once __DIR__ . '/../connect.php';
$email = filterRequest("email");
$token = filterRequest("token");
$stmt = $con->prepare("SELECT * FROM `email_verifications` WHERE `email` = ?");
$stmt->execute([$email]);
$rowCount = $stmt->rowCount();
$admin='support@mobile-app.store';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
$headers .= "From: $admin" . "\r\n";
$subject = "Verify your email address";
$bodyEmail = "
<html>
<head>
<title>Verify your email address</title>
</head>
<body>
<p>Hi [$email],</p>
<p>We recently received a request to verify your email address for your account on SEFER App.</p>
<p>To verify your email address, please write this to app .</p>
$token
<p>If you did not request to verify your email address, please ignore this email.</p>
<p>Thank you,</p>
SEFER Team.
</body>
</html>
";
if ($rowCount > 0) {
// The email already exists, so update the data
// كانت القيم تُدمج في نص الاستعلام مباشرةً — حقن SQL عبر البريد أو الرمز.
$stmt = $con->prepare("UPDATE `email_verifications` SET `token` = ? WHERE `email` = ?");
$stmt->execute([$token, $email]);
if ($stmt->rowCount() > 0) {
// The update was successful
jsonSuccess($message = "Email verification data updated successfully");
mail($email, $subject, $bodyEmail, $headers);
} else {
// The update was unsuccessful
jsonError($message = "Failed to update email verification data");
}
} else {
// The email does not exist, so insert the data
$stmt = $con->prepare("INSERT INTO `email_verifications` (`email`, `token`) VALUES (?, ?)");
$stmt->execute([$email, $token]);
if ($stmt->rowCount() > 0) {
// The insertion was successful
jsonSuccess($message = "Email verification data saved successfully");
mail($email, $subject, $bodyEmail, $headers);
} else {
// The insertion was unsuccessful
jsonError($message = "Failed to save email verification data");
}
}
?>