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'; }