From 8635dd1c7ca4ec7042ec70f98e36299ba9b4626e Mon Sep 17 00:00:00 2001 From: lub Date: Mon, 28 Jul 2025 12:58:24 +0200 Subject: [PATCH] start implementing the actual API calls untested unfinished --- index.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 75726aa..87b3db2 100644 --- a/index.php +++ b/index.php @@ -6,11 +6,13 @@
+ Username:

@@ -57,15 +59,29 @@ Also consider using a password manager.
$_POST['nonce'], + username => $_POST['username'], + password => $_POST['password'] + admin = false + ]; + $content->mac = hash_hmac('sha1', $content->nonce."\s".$content->username."\s".$content->password."\s".$content->admin + $options = [ 'http' => [ 'method' => 'POST', 'header' => 'authorization: Bearer '.ACCESS_TOKEN, - 'content-type: application/json' + 'content-type: application/json', + 'content' => json_encode($content); ] ]; $context = stream_context_create($options); - file_get_contents($url, false, $context); + $result = file_get_contents(REGISTRATION_API_URL, false, $context); + if ($result === FALSE) { + # something with errors + } else { + # success + } } else { echo 'Invalid URL'; }