mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 18:29:43 +01:00
Update qrcode.php and use SVG to generate the code (#2022)
Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -1,26 +1,45 @@
|
||||
<html><body>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.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)
|
||||
{
|
||||
if($auth) {
|
||||
if(strlen($pwhash) > 0) {
|
||||
echo '<div class="qrcode">';
|
||||
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>";
|
||||
$qr->printSVG("10px");
|
||||
echo "</div>";
|
||||
echo 'Raw API Token: <code class="token">' . $pwhash . "</code></div>";
|
||||
} else {
|
||||
echo "<p>No password set</p>";
|
||||
}
|
||||
else
|
||||
{
|
||||
?><p>No password set<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?><p>Not authorized!</p><?php
|
||||
} else {
|
||||
echo "<p>Not authorized!</p>";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user