Update qrcode.php and use SVG to generate the code (#2022)

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2021-12-24 07:38:58 -03:00
committed by GitHub
parent 685cfd1f8c
commit d060a3b5c9
2 changed files with 410 additions and 201 deletions

View File

@@ -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>