typo and cleanup debug output

main
lub 2 weeks ago
parent 7045ac374f
commit fa7447548a

@ -48,11 +48,6 @@ if (isset($_GET['secret']) && $_GET['secret'] === REGISTRATION_PASSWORD) {
]; ];
$content['mac'] = hash_hmac('sha1', $content['nonce']."\0".$content['username']."\0".$content['password']."\0".'notadmin', REGISTRATION_SHARED_SECRET); $content['mac'] = hash_hmac('sha1', $content['nonce']."\0".$content['username']."\0".$content['password']."\0".'notadmin', REGISTRATION_SHARED_SECRET);
# debug
echo '<!--';
var_dump($content);
echo '-->';
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, SYNAPSE_URL.'/_synapse/admin/v1/register'); curl_setopt($ch, CURLOPT_URL, SYNAPSE_URL.'/_synapse/admin/v1/register');
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
@ -63,13 +58,13 @@ if (isset($_GET['secret']) && $_GET['secret'] === REGISTRATION_PASSWORD) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch); $response = curl_exec($ch);
if (curl_error($ch) || curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) { if (curl_error($ch) || curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) {
$decoded_response = json_decode($response);
?> ?>
Registration for "<?php echo $username ?>" unsuccessful. Please try again later. Registration for "<?php echo $username ?>" unsuccessful. Please try again later.
<?php <?php
} else { } else {
$decoded_response = json_decode($response);
?> ?>
Registration successful. To start using it please install a Matrix client like <a href="https://element.io/download">Element</a><br> Registration successful. To start using it please install a Matrix client like <a href="https://element.io/download">Element</a><br>
@ -85,7 +80,6 @@ Also consider using a password manager.<br>
<br> <br>
<?php <?php
echo var_dump($decoded_response);
# logout out of session that exists after registering # logout out of session that exists after registering
$ch = curl_init(); $ch = curl_init();

Loading…
Cancel
Save