Add QR code type "Wifi" + handle every request in index.php (#27)

QR codes types can now be chosen between the default text mode and the Wifi mode.

The WiFi form is on a dedicated page, and that has been implemented by managing every HTTP request from index.php

For more information about the format used for Wifi QR codes check https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11

Co-authored-by: Miraty <miraty+git@antopie.org>
Reviewed-on: #27 (https://code.antopie.org/miraty/libreqr/issues/27)
Reviewed-by: Miraty <miraty@noreply.code.antopie.org>
Co-authored-by: Denise <denisebitca@42l.fr>
Co-committed-by: Denise <denisebitca@42l.fr>

e4491752f2
This commit is contained in:
FbIN Support 2025-09-07 17:17:32 +05:30
commit 1df83b89a1
8 changed files with 362 additions and 156 deletions

View file

@ -3,6 +3,12 @@ $loc = array(
'subtitle' => "QR codes generator",
'description' => "Generate QR codes freely. Choose content, size, colors…",
'tab_text' => "Text",
'tab_wifi' => "Wifi",
'tab_wifi_title' => "Wifi QR codes generation",
'label_wifi_ssid' => "Network name / SSID",
'label_wifi_password' => "Password",
'label_content' => "Text to encode",
'label_redundancy' => "Redundancy rate",
'label_margin' => "Margin size",
@ -11,7 +17,10 @@ $loc = array(
'label_fgColor' => "Foreground color",
'placeholder' => "Enter the text to encode in the QR code",
'placeholder_wifi_ssid' => "Box-A31B",
'placeholder_wifi_password' => "correct horse battery staple",
'help_wifi_password' => "The WPA, WPA2 or WPA3 key. Leave empty if it's an open network.",
'help_content' => "
<p>You can encode whatever text you want.</p>
<p>Software decoding these QR codes could suggest to open them with dedicated software, depending on their <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes' hreflang='en' rel='help external noreferrer'>URI scheme</a>.</p>
@ -25,12 +34,16 @@ $loc = array(
'button_create' => "Generate",
'button_download' => "Save this QR code",
'button_edit' => "Edit",
'title_showOnlyQR' => "Show this QR code only",
'alt_QR_before' => 'QR code meaning "',
'alt_QR_after' => '"',
'wifi_raw_content_before' => "This QR code contains: ",
'wifi_raw_content_after' => "",
'metaText_qr' => "
<h3>What's a QR code?</h3>
A QR code is a 2 dimensional barcode in which text is written in binary. It can be decoded with a device equipped with a photo sensor and adequate software.
@ -39,4 +52,5 @@ $loc = array(
'metaText_legal' => "LibreQR " . LIBREQR_VERSION . " is free software whose <a href='https://code.antopie.org/miraty/libreqr/' rel='external noreferrer'>source code</a> is available under the terms of the <abbr title='GNU Affero General Public License version 3 or any later version'><a href='LICENSE.html' hreflang='en' rel='license'>AGPLv3</a>+</abbr>.",
'error_generation' => "An error occurred while generating the QR code. Try with different parameters.",
);
'error_404' => "This page doesn't exist.",
);