Skip to content

Commit

Permalink
Config for Photobooths Webserver IP to fix Download via QR-Code
Browse files Browse the repository at this point in the history
- if Photobooth is opened via localhost/127.0.0.1 it is not possible to
  download images via QR code using a different device

Change-Id: Ifc7dc6cb6bf26dd9c069fc017234dec58a93e62f
  • Loading branch information
andi34 committed Dec 12, 2019
1 parent 2219d2f commit 3c985dc
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/qrcode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php
require_once('../lib/config.php');

if (!isset($config['webserver_ip'])) {
$SERVER_IP = $_SERVER['HTTP_HOST'];
} else {
$SERVER_IP = $config['webserver_ip'];
}

$filename = $_GET['filename'];
include('../vendor/phpqrcode/qrlib.php');
$url = 'http://'.$_SERVER['HTTP_HOST'].'/api/download.php?image=';
$url = 'http://'.$SERVER_IP.'/api/download.php?image=';
QRcode::png($url.$filename, false, QR_ECLEVEL_H, 10);
1 change: 1 addition & 0 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
$config['color_theme'] = 'default'; // possible values are default, blue-gray, or an array with the corresponding colors (e.g. ['primary' => '#fff', 'secondary'=>'#a1a1a1', 'font'=>'#000'])
$config['force_buzzer'] = false;
$config['dark_loader'] = false;
$config['webserver_ip'] = null;

// specify key id to use that key to take a picture or collage (e.g. 13 is the enter key)
// use for example https://keycode.info to get the key code
Expand Down
6 changes: 6 additions & 0 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
'name' => 'use_qr',
'value' => $config['use_qr']
],
'webserver_ip' => [
'type' => 'input',
'name' => 'webserver_ip',
'placeholder' => '127.0.0.1',
'value' => $config['webserver_ip']
],
'use_download' => [
'type' => 'checkbox',
'name' => 'use_download',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const L10N = {
'keyingerror': 'Chroma-Keying nicht möglich!',
'use_print': 'Drucken aktivieren',
'use_qr': 'QR-Code aktivieren',
'general_webserver_ip': 'IP-Adresse des Photobooth Webservers',
'use_download': 'Download aktivieren',
'print_qrcode': 'QR-Code auf dem Bild beim Drucken',
'show_gallery': 'Galerie aktivieren',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const L10N = {
'keyingerror': 'Chroma keying not possible!',
'use_print': 'Use Print',
'use_qr': 'Use QR Codes',
'general_webserver_ip': 'IP address of the Photobooth web server',
'use_download': 'Allow downloads',
'print_qrcode': 'QR-Code on the picture while printing',
'show_gallery': 'Show Gallery',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const L10N = {
'keyingerror': '¡La incrustación en el croma verde es imposible!',
'use_print': 'Utilizar la impresion',
'use_qr': 'Utilizar los códigos QR',
'general_webserver_ip': 'IP address of the Photobooth web server',
'use_download': 'Permitir descargas',
'print_qrcode': 'Código QR en la imagen en proceso de impresión',
'show_gallery': 'Muestre la galería',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const L10N = {
'keyingerror': 'L\'incrustation sur fond vert n\'est pas possible!',
'use_print': 'Utiliser l\'impression',
'use_qr': 'Utiliser le QR code',
'general_webserver_ip': 'IP address of the Photobooth web server',
'use_download': 'Autoriser les téléchargements',
'print_qrcode': 'QR-Code sur l\'image en cours d\'impression',
'show_gallery': 'Montrez la galerie',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/gr.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const L10N = {
'keyingerror': 'Chroma-Keying nicht möglich!',
'use_print': 'Ενεργοποίηση εκτύπωσης',
'use_qr': 'Ενεργοποιήστε τον κωδικό QR',
'general_webserver_ip': 'IP address of the Photobooth web server',
'use_download': 'Επιτρέψτε τη λήψη',
'print_qrcode': 'QR κώδικα στην εικόνα κατά την εκτύπωση',
'show_gallery': 'Ενεργοποιήστε τη συλλογή',
Expand Down

0 comments on commit 3c985dc

Please sign in to comment.