Skip to content

Commit

Permalink
Usermin also needs a version of qr.cgi #116
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Oct 31, 2024
1 parent fcbe2af commit 832eb08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions twofactor/lang/en
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ twofactor_etotpmatch=Incorrect OTP code

enable_title=Enabled Two-Factor Authentication
enable_err=Enrollment failed

qr_err=Failed to generate QR code
qr_estr=Missing QR code string!
20 changes: 20 additions & 0 deletions twofactor/qr.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/local/bin/perl
# Show a QR code based on parameters

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
$main::no_acl_check = 1;
require './twofactor-lib.pl';

our (%in, %text, %gconfig, %config);
&ReadParse();
&error_setup($text{'qr_err'});

$in{'str'} || &error($text{'qr_estr'});
my ($img, $mime) = &generate_qr_code($in{'str'}, $in{'size'});
$img || &error($mime);

&PrintHeader(undef, $mime);
print $img;

0 comments on commit 832eb08

Please sign in to comment.