mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Initial WIP: Allow decrypting logins/credentials via the API
This commit is contained in:
1
api/v1/credentials/credential_model.php
Normal file
1
api/v1/credentials/credential_model.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
20
api/v1/credentials/read.php
Normal file
20
api/v1/credentials/read.php
Normal 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";
|
||||
|
||||
Reference in New Issue
Block a user