Files
web/scripts/pi-hole/php/api_token.php
XhmikosR dbed9e8d02 Wrap API token in code
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2019-12-07 09:56:50 +02:00

28 lines
431 B
PHP

<html><body>
<?php
require "auth.php";
require "password.php";
check_cors();
if($auth)
{
if(strlen($pwhash) > 0)
{
require_once("../../vendor/qrcode.php");
$qr = QRCode::getMinimumQRCode($pwhash, QR_ERROR_CORRECT_LEVEL_Q);
$qr->printHTML("10px");
echo "<br>Raw API Token: <code>" . $pwhash . "</code>";
}
else
{
?><p>No password set<?php
}
}
else
{
?><p>Not authorized!</p><?php
}
?>
</body>
</html>