Files
web/scripts/pi-hole/php/api_token.php
rdwebdesign 4c8f869e7b Fixing PHP warnings in qrcode.php
Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2021-12-28 02:13:50 -03:00

49 lines
804 B
PHP

<html>
<head>
<style>
body {
background: #fff;
margin: 10px 0;
}
.qrcode {
text-align: center;
margin: 0 0 1em;
}
.qrcode svg {
max-width: 100%;
height: auto;
}
.token {
font-size: 14px;
word-break: break-word;
}
</style>
</head>
<body>
<?php
require "auth.php";
require "password.php";
check_cors();
if($auth) {
if(strlen($pwhash) > 0) {
echo '<div class="qrcode">';
require_once("../../vendor/qrcode.php");
$qr = QRCode::getMinimumQRCode($pwhash, QR_ERROR_CORRECT_LEVEL_Q);
// The size of each block (in pixels) should be an integer
$qr->printSVG(10);
echo "</div>";
echo 'Raw API Token: <code class="token">' . $pwhash . "</code></div>";
} else {
echo "<p>No password set</p>";
}
} else {
echo "<p>Not authorized!</p>";
}
?>
</body>
</html>