Initial WIP: Allow decrypting logins/credentials via the API

This commit is contained in:
wrongecho
2024-08-19 21:23:43 +01:00
parent 86e3f377ab
commit 63feff03d2
7 changed files with 129 additions and 58 deletions

View File

@@ -0,0 +1,20 @@
<?php
require_once '../validate_api_key.php';
require_once '../require_get_method.php';
// Specific credential/login via ID (single)
if (isset($_GET['login_id'])) {
$id = intval($_GET['login_id']);
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_id = '$id' AND login_client_id LIKE '$client_id'");
} else {
// All credentials ("logins")
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_client_id LIKE '$client_id' ORDER BY login_id LIMIT $limit OFFSET $offset");
}
// Output
require_once "../read_output.php";