mirror of
https://github.com/itflow-org/itflow
synced 2026-03-06 13:54:51 +00:00
@@ -36,8 +36,9 @@ require_once "header.php";
|
|||||||
|
|
||||||
if (!empty($session_token)) {
|
if (!empty($session_token)) {
|
||||||
|
|
||||||
//Generate QR Code based off the generated key
|
// Generate QR Code
|
||||||
print sprintf('<img src="%s"/>', TokenAuth6238::getBarCodeUrl($session_name, ' ', $session_token, $_SERVER['SERVER_NAME']));
|
$data = "otpauth://totp/ITFlow:$session_email?secret=$session_token";
|
||||||
|
print "<img src='plugins/barcode/barcode.php?f=png&s=qr&d=$data'>";
|
||||||
|
|
||||||
echo "<p class='text-secondary'>$session_token</p>";
|
echo "<p class='text-secondary'>$session_token</p>";
|
||||||
}
|
}
|
||||||
|
|||||||
3352
plugins/barcode/barcode.php
Normal file
3352
plugins/barcode/barcode.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -58,14 +58,6 @@ class TokenAuth6238 {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getBarCodeUrl($username, $domain, $secretkey, $issuer) {
|
|
||||||
$url = "https://chart.apis.google.com/chart";
|
|
||||||
$url = $url."?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/";
|
|
||||||
$url = $url.$username . "@" . $domain . "%3Fsecret%3D" . $secretkey . '%26issuer%3D' . rawurlencode($issuer);
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function oath_hotp ($key, $counter, $debug=false) {
|
private static function oath_hotp ($key, $counter, $debug=false) {
|
||||||
$result = "";
|
$result = "";
|
||||||
$orgcounter = $counter;
|
$orgcounter = $counter;
|
||||||
|
|||||||
@@ -59,10 +59,12 @@ $remember_token_count = mysqli_num_rows($sql_remember_tokens);
|
|||||||
|
|
||||||
if (!empty($session_token)) {
|
if (!empty($session_token)) {
|
||||||
|
|
||||||
//Generate QR Code based off the generated key
|
// Generate QR Code
|
||||||
print sprintf('<img src="%s"/>', TokenAuth6238::getBarCodeUrl($session_name, ' ', $session_token, $_SERVER['SERVER_NAME']));
|
$data = "otpauth://totp/ITFlow:$session_email?secret=$session_token";
|
||||||
|
print "<img src='plugins/barcode/barcode.php?f=png&s=qr&d=$data'>";
|
||||||
|
|
||||||
echo "<p class='text-secondary'>$session_token</p>";
|
echo "<p class='text-secondary'>$session_token</p>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user