init
commit
8f4a4baf0d
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<title>I M NINJA | Registration</title>
|
||||
|
||||
<?php
|
||||
define('ACCESS_TOKEN', 'at_bsef');
|
||||
define('REGISTRATION_PASSWORD', 'asef');
|
||||
if ($_GET['secret'] === REGISTRATION_PASSWORD) {
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="secret" value="<?php echo REGISTRATION_PASSWORD ?>">
|
||||
|
||||
Username:<br>
|
||||
<input type="text" name="username"><br>
|
||||
<br>
|
||||
Password:<br>
|
||||
<input type="password" name="password"><br>
|
||||
<br>
|
||||
<input type="submit" value="Register">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
} elseif ($_POST['secret'] === REGISTRATION_PASSWORD) {
|
||||
$username = filter_var($_POST['username'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
var_dump($_POST);
|
||||
|
||||
$options = [
|
||||
'http' => [
|
||||
'method' => 'POST',
|
||||
'header' => 'authorization: Bearer '.ACCESS_TOKEN,
|
||||
'content-type: application/json'
|
||||
]
|
||||
];
|
||||
$context = stream_context_create($options);
|
||||
$registration = file_get_contents($url, false, $context);
|
||||
if ($registration === false) {
|
||||
?>
|
||||
|
||||
Registration for "<?php echo $username ?>"unsuccessful. Please try again later.
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
||||
Registration successful. To start using it please install a Matrix client like <a href="https://element.io/download">Element</a><br>
|
||||
<br>
|
||||
Server: <strong>imninja.net</strong><br>
|
||||
Username: <strong><?php echo $username ?></strong><br>
|
||||
Password: <strong>* * * * *</strong><br>
|
||||
<br>
|
||||
For password recovery purposes it's recommended to set an email address after you successfully logged on to your new Matrix account.<br>
|
||||
<br>
|
||||
Also consider using a password manager.<br>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
$options = [
|
||||
'http' => [
|
||||
'method' => 'POST',
|
||||
'header' => 'authorization: Bearer '.ACCESS_TOKEN,
|
||||
'content-type: application/json'
|
||||
]
|
||||
];
|
||||
$context = stream_context_create($options);
|
||||
file_get_contents($url, false, $context);
|
||||
} else {
|
||||
echo 'Invalid URL';
|
||||
}
|
||||
?>
|
||||
|
||||
<!--
|
||||
<br>
|
||||
<br>
|
||||
<sub>This is an <a href="https://imninja.net">imninja.net</a> service.</sub>
|
Loading…
Reference in New Issue