OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
models
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 07:35:13 AM
rwxr-xr-x
📄
Authenticator.php
713 bytes
08/07/2024 04:33:38 AM
rw-r--r--
Editing: Authenticator.php
Close
<?php class Authenticator { private $pdo; public function __construct(PDO $pdo) { $this->pdo = $pdo; } public function authenticate($api_key, $secret_key) { try { $stmt = $this->pdo->prepare('SELECT * FROM api_keys WHERE api_key = ? AND secret_key = ?'); $stmt->execute([$api_key, $secret_key]); // Check if there is a matching API key and secret key if ($stmt->rowCount() > 0) { return true; } else { return false; } } catch (PDOException $e) { throw new Exception("Database error: " . $e->getMessage()); } } } ?>