mirror of
https://github.com/pi-hole/web.git
synced 2026-04-22 01:39:50 +01:00
API QR token generator (#410)
* Added API QR token generator * Pass only token * Corrected link
This commit is contained in:
26
scripts/pi-hole/php/api_token.php
Normal file
26
scripts/pi-hole/php/api_token.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<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");
|
||||
}
|
||||
else
|
||||
{
|
||||
?><p>No password set<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?><p>Not authorized!</p><?php
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user