Initial commit with updated Auth and media ignored
This commit is contained in:
26
Admin/auth/login.php
Executable file
26
Admin/auth/login.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
//login.php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$device = filterRequest("device_number");
|
||||
$phone = filterRequest("phone_number");
|
||||
|
||||
if (empty($device) || empty($phone)) {
|
||||
jsonError("device_number أو phone_number مفقود");
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt = $con->prepare("SELECT * FROM adminUser WHERE device_number = ? AND name = ?");
|
||||
$stmt->execute([$device, $phone]);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$admin = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
// يمكن لاحقًا توليد توكن أو بيانات أخرى
|
||||
printSuccess([
|
||||
"message" => "تم التحقق بنجاح",
|
||||
"admin" => $admin,
|
||||
]);
|
||||
} else {
|
||||
jsonError("بيانات الدخول غير صحيحة أو غير مسجلة.");
|
||||
}
|
||||
Reference in New Issue
Block a user