Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev' into stable3
Browse files Browse the repository at this point in the history
Change-Id: Ie2dafde36ab3374f4b863c4ae5520332a7b90d61
  • Loading branch information
andi34 committed Jun 18, 2021
2 parents 03210c3 + 3ecd486 commit 52da86c
Show file tree
Hide file tree
Showing 24 changed files with 661 additions and 396 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/gulp_sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches:
- dev
- stable2
- stable3
paths:
- '**.scss'
pull_request:
branches:
- dev
- stable2
- stable3
paths:
- '**.scss'
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches:
- dev
- stable2
- stable3
paths:
- '**.js'
pull_request:
branches:
- dev
- stable2
- stable3
paths:
- '**.js'
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ _(The full changelog can be found inside [the Photobooth Wiki](https://github.co

[![Translate on Crowdin](https://img.shields.io/badge/Traslate%20on-Crowdin-green.svg)](https://crowdin.com/project/photobooth)

[![Lint](https://github.com/andi34/photobooth/workflows/Lint/badge.svg?branch=stable2)](https://github.com/andi34/photobooth/actions?query=branch%3Astable2+workflow%3ALint)
[![gulp-sass](https://github.com/andi34/photobooth/workflows/gulp-sass/badge.svg?branch=stable2)](https://github.com/andi34/photobooth/actions?query=branch%3Astable2+workflow%3Agulp-sass)
[![Lint](https://github.com/andi34/photobooth/workflows/Lint/badge.svg?branch=stable3)](https://github.com/andi34/photobooth/actions?query=branch%3Astable3+workflow%3ALint)
[![gulp-sass](https://github.com/andi34/photobooth/workflows/gulp-sass/badge.svg?branch=stable3)](https://github.com/andi34/photobooth/actions?query=branch%3Astable3+workflow%3Agulp-sass)

## :heart_eyes: Features

Expand Down
13 changes: 11 additions & 2 deletions api/sendPic.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,21 @@
$mail->Subject = $config['mail']['subject'];

// Email body content
$mailContent = $config['mail']['text'];
$mail->isHTML($config['mail']['is_html']);
if ($config['mail']['is_html']) {
if (isset($config['mail']['alt_text']) && empty($config['mail']['alt_text'])) {
$mail->msgHTML($config['mail']['text']);
} else {
$mail->Body = $config['mail']['text'];
$mail->AltBody = $config['mail']['alt_text'];
}
} else {
$mail->Body = $config['mail']['text'];
}

// for send an attachment
$path = $config['foldersAbs']['images'] . DIRECTORY_SEPARATOR;

$mail->Body = $mailContent;
if (!$mail->addAttachment($path . $postImage)) {
die(
json_encode([
Expand Down
47 changes: 47 additions & 0 deletions api/shellCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
header('Content-Type: application/json');

require_once '../lib/config.php';

$mode = $_POST['mode'];

switch ($mode) {
case 'pre-command':
$cmd = sprintf($config['pre_photo']['cmd']);
break;
case 'post-command':
$cmd = sprintf($config['post_photo']['cmd']);
break;
default:
$cmd = 'echo "Error for mode ' . $mode . ' - command not defined in configuration"';
break;
}

$success = exec($cmd, $output, $retval);

if (isset($success)) {
switch ($retval) {
case 127:
$output = 'Command not found';
$success = false;
break;
case 0:
$success = true;
break;
default:
$success = 'unknown';
break;
}

echo json_encode([
'success' => $success,
'output' => $output,
'retval' => $retval,
'command' => $cmd,
]);
} else {
echo json_encode([
'success' => 'false',
'command' => $cmd,
]);
}
6 changes: 5 additions & 1 deletion config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@
$config['mail']['send_all_later'] = false;
$config['mail']['subject'] = null; // if empty, default translation is used
$config['mail']['text'] = null; // if empty, default translation is used
$config['mail']['alt_text'] = null; // if empty, default translation is used
$config['mail']['is_html'] = false;
$config['mail']['host'] = 'smtp.example.com';
$config['mail']['username'] = 'photobooth@example.com';
$config['mail']['password'] = 'yourpassword';
Expand Down Expand Up @@ -264,6 +266,7 @@
// possible style values: "classic", "modern", "custom"
$config['ui']['style'] = 'modern';
$config['button']['show_fs'] = false;
$config['button']['homescreen'] = true;
$config['ui']['font_size'] = '16px';
$config['colors']['countdown'] = '#ffffff';
$config['colors']['background_countdown'] = '#214852';
Expand Down Expand Up @@ -301,7 +304,8 @@
$config['preview']['cmd'] = null;
$config['preview']['killcmd'] = null;
$config['nodebin']['cmd'] = null;

$config['pre_photo']['cmd'] = null;
$config['post_photo']['cmd'] = null;

// F O L D E R S
$config['folders']['data'] = 'data';
Expand Down
3 changes: 3 additions & 0 deletions gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<script type="text/javascript" src="node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="vendor/PhotoSwipe/dist/photoswipe.min.js"></script>
<script type="text/javascript" src="vendor/PhotoSwipe/dist/photoswipe-ui-default.min.js"></script>
<script type="text/javascript" src="resources/js/remotebuzzer_client.js"></script>
<script type="text/javascript" src="resources/js/photoinit.js"></script>
<script type="text/javascript" src="resources/js/theme.js"></script>
<script type="text/javascript" src="resources/js/core.js"></script>
Expand All @@ -105,5 +106,7 @@
<?php endif; ?>
<script src="node_modules/@andreasremdt/simple-translator/dist/umd/translator.min.js"></script>
<script type="text/javascript" src="resources/js/i18n.js"></script>

<?php require_once('lib/services_start.php'); ?>
</body>
</html>
4 changes: 4 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@

<!-- Result Page -->
<div class="stages rotarygroup" id="result">

<?php if ($config['button']['homescreen']): ?>
<a href="#" class="<?php echo $btnClass1; ?> homebtn rotaryfocus"><i class="fa fa-home"></i> <span data-i18n="home"></span></a>
<?php endif; ?>

<div class="resultInner hidden">
<?php if ($config['gallery']['enabled']): ?>
<a href="#" class="<?php echo $btnClass1; ?> gallery-button rotaryfocus" ><i class="fa <?php echo $galleryIcon; ?>"></i> <span data-i18n="gallery"></span></a>
Expand Down
85 changes: 59 additions & 26 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
** - Admin panel sort order is defined by the order in this config file
** - The i18n tag for translation is identified by the actual section key
** - Parameter: Key / Value pairs are parameters which apply to how the section is displayed in the admin panel
** * 'view' (optional): Accepted values are 'basic', 'advanced' or 'expert'. Defines in which admin panel view mode
** the section is shown or not. Missing parameter defaults to 'expert'.
** * 'platform' (optional): Accepted values are 'all', 'linux', 'windows'. Defines whether the section is visible
** by platform. Missing parameter defaults to 'all'
** * 'view' (optional): Accepted values are 'basic', 'advanced' or 'expert'. Defines in which admin panel view mode
** the section is shown or not. Missing parameter defaults to 'expert'.
** * 'platform' (optional): Accepted values are 'all', 'linux', 'windows'. Defines whether the section is visible
** by platform. Missing parameter defaults to 'all'
** - Settings: Key / Array pairs define a setting (see next)
**
** * Settings descriptor
Expand All @@ -41,30 +41,30 @@
** - The i18n tag for translation is identified by concatenation of section key, ':', setting key. Tags for manual entries
** start with "manual:"
** Examples:
** "general:ui_language"
** "user_interface:button_show_fs"
** "manual:print:print_from_result"
** "general:ui_language"
** "user_interface:button_show_fs"
** "manual:print:print_from_result"
**
** - Parameter: Can be key/value or key/array pairs. Sort order does not matter.
** * 'view' (optional): Accepted values are 'basic', 'advanced' or 'expert'. Defines in which admin panel view mode
** the section is shown or not. Missing parameter defaults to 'expert'.
** * 'name': Matches the name of the config variable or array. For type 'button' this has no effect.
** * 'type': Values are 'input', 'range', 'color', 'hidden', 'checkbox', 'multi-select', 'select', 'button'. Defines the actual
** input type in the admin panel for this setting.
** * 'value': Value is a reference to the actual PB config (i.e. 'value' => $config['dev']['reload_on_error']) and pre-
** populates the current config value into the admin panel
** Exceptionally, for type 'button' this is the HTML element ID applied to the actual button itself.
** * 'placeholder': For types 'input', 'range', 'color' to prepopulate / preset the admin panel setting entry
** field / range selector. Often references the default config for this setting
** (i.e 'placeholder' => $defaultConfig['picture']['time_to_live'])
** For type 'button' this is the i18ntag string for the actual button text.
** * 'option': Only for types 'select','multi-select'. Lists the options available in this setting (i.e.
** 'options' => [
** '360px' => 'XS',
** '540px' => 'S',
** ]
** * 'range_min', 'range_max', 'range_step': Only for type 'range'. Define the slider range and step when moved
** * 'unit': Only for type 'range'. Defines the unit of the slider and is used to identify the i18n tag for translation of the unit
** * 'view' (optional): Accepted values are 'basic', 'advanced' or 'expert'. Defines in which admin panel view mode
** the section is shown or not. Missing parameter defaults to 'expert'.
** * 'name': Matches the name of the config variable or array. For type 'button' this has no effect.
** * 'type': Values are 'input', 'range', 'color', 'hidden', 'checkbox', 'multi-select', 'select', 'button'. Defines the actual
** input type in the admin panel for this setting.
** * 'value': Value is a reference to the actual PB config (i.e. 'value' => $config['dev']['reload_on_error']) and pre-
** populates the current config value into the admin panel
** Exceptionally, for type 'button' this is the HTML element ID applied to the actual button itself.
** * 'placeholder': For types 'input', 'range', 'color' to prepopulate / preset the admin panel setting entry
** field / range selector. Often references the default config for this setting
** (i.e 'placeholder' => $defaultConfig['picture']['time_to_live'])
** For type 'button' this is the i18ntag string for the actual button text.
** * 'option': Only for types 'select','multi-select'. Lists the options available in this setting (i.e.
** 'options' => [
** '360px' => 'XS',
** '540px' => 'S',
** ]
** * 'range_min', 'range_max', 'range_step': Only for type 'range'. Define the slider range and step when moved
** * 'unit': Only for type 'range'. Defines the unit of the slider and is used to identify the i18n tag for translation of the unit
*/

$configsetup = [
Expand Down Expand Up @@ -1209,6 +1209,19 @@
'name' => 'mail[text]',
'value' => htmlentities($config['mail']['text']),
],
'mail_alt_text' => [
'view' => 'advanced',
'type' => 'input',
'placeholder' => '',
'name' => 'mail[alt_text]',
'value' => htmlentities($config['mail']['alt_text']),
],
'mail_is_html' => [
'view' => 'advanced',
'type' => 'checkbox',
'name' => 'mail[is_html]',
'value' => $config['mail']['is_html'],
],
'mail_host' => [
'view' => 'basic',
'type' => 'input',
Expand Down Expand Up @@ -1511,6 +1524,12 @@
'name' => 'button[show_fs]',
'value' => $config['button']['show_fs'],
],
'button_homescreen' => [
'view' => 'advanced',
'type' => 'checkbox',
'name' => 'button[homescreen]',
'value' => $config['button']['homescreen'],
],
'ui_font_size' => [
'view' => 'advanced',
'type' => 'input',
Expand Down Expand Up @@ -1701,6 +1720,20 @@
'name' => 'take_picture[msg]',
'value' => htmlentities($config['take_picture']['msg']),
],
'pre_photo_cmd' => [
'view' => 'expert',
'type' => 'input',
'placeholder' => $defaultConfig['pre_photo']['cmd'],
'name' => 'pre_photo[cmd]',
'value' => htmlentities($config['pre_photo']['cmd']),
],
'post_photo_cmd' => [
'view' => 'expert',
'type' => 'input',
'placeholder' => $defaultConfig['post_photo']['cmd'],
'name' => 'post_photo[cmd]',
'value' => htmlentities($config['post_photo']['cmd']),
],
'print_cmd' => [
'view' => 'expert',
'type' => 'input',
Expand Down
4 changes: 4 additions & 0 deletions login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@
<?php endif; ?>
<p><a href="../gallery.php" class="btn btn--login"><i class="fa fa-th"></i> <span data-i18n="gallery"></span></a></p>
<p><a href="../slideshow" class="btn btn--login"><i class="fa fa-play"></i> <span data-i18n="slideshow"></span></a></p>
<?php if(!$config['protect']['index'] || (!$config['protect']['localhost_index'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) || !$config['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
<p><a href="../livechroma.php" class="btn btn--login"><i class="fa fa-paint-brush"></i> <span data-i18n="livechroma"></span></a></p>
<?php endif; ?>
<?php if(!$config['protect']['manual'] || (!$config['protect']['localhost_manual'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) || !$config['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
<p><a href="../manual/faq.php" class="btn btn--login" title="FAQ" target="newwin"><i class="fa fa-question-circle" aria-hidden="true"></i> <span data-i18n="show_faq"></span></a></p>
<p><a href="../manual" class="btn btn--login" title="Manual" target="newwin"><i class="fa fa-info-circle" aria-hidden="true"></i> <span data-i18n="show_manual"></span></a></p>
<p><a href="https://t.me/PhotoboothGroup" class="btn btn--login" title="Telegram" target="newwin"><i class="fa fa-telegram" aria-hidden="true"></i> <span data-i18n="telegram"></span></a></p>
<?php endif; ?>
<p><a href="./" class="btn btn--login"><i class="fa fa-refresh"></i> <span data-i18n="reload"></span></a></p>
<?php if(!$config['protect']['index'] || (!$config['protect']['localhost_index'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) || !$config['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@
"marvinj": "^1.0.0",
"normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5",
"onoff": "^6.0.1",
"onoff": "^6.0.3",
"selectize": "^0.12.6",
"socket.io": "^4.0.1",
"socket.io-client": "^4.0.1",
"socket.io": "^4.1.2",
"socket.io-client": "^4.1.2",
"waypoints": "^4.0.1",
"whatwg-fetch": "^3.6.2"
},
"devDependencies": {
"@babel/core": "^7.13.14",
"@babel/preset-env": "^7.13.8",
"@prettier/plugin-php": "^0.16.2",
"archiver": "^5.2.0",
"@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@prettier/plugin-php": "^0.16.3",
"archiver": "^5.3.0",
"colors": "^1.4.0",
"eslint": "^7.23.0",
"eslint": "^7.27.0",
"eslint-plugin-node": "^11.1.0",
"git-tag-version": "^1.3.1",
"gulp-babel": "^8.0.0",
"prettier": "^2.2.1"
"prettier": "^2.3.0"
}
}
6 changes: 5 additions & 1 deletion resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"chromaInfoAfter": "Bitte laden Sie die Seite neu, um ein neues Foto aufzunehmen",
"chromaInfoBefore": "Bitte wählen Sie einen Hintergrund, um ein neues Foto aufzunehmen",
"close": "Schließen",
"collage": "Collage\nCollage",
"collage": "Collage",
"collage:collage_cntdwn_time": "Collage-Countdown Timer:",
"collage:collage_continuous": "Collage ohne Unterbrechung aufnehmen",
"collage:collage_enabled": "Foto-Collage erlauben",
Expand Down Expand Up @@ -151,11 +151,13 @@
"login_username": "Benutzername",
"logout": "Ausloggen",
"mail": "E-Mail",
"mail:mail_alt_text": "Alternativer Text",
"mail:mail_enabled": "E-Mail aktivieren",
"mail:mail_file": "Name der E-Mail-Adressen-Datenbankdatei",
"mail:mail_fromAddress": "Absende Adresse",
"mail:mail_fromName": "Absender Name",
"mail:mail_host": "E-Mail Host Adresse",
"mail:mail_is_html": "HTML E-Mail",
"mail:mail_password": "Passwort",
"mail:mail_port": "Port",
"mail:mail_secure": "Sicherheit (tls oder ssl)",
Expand Down Expand Up @@ -273,11 +275,13 @@
"manual:keying:keying_variant": "Wählen Sie zwischen verschiedenen Chromakey-Algorithmen. <b>Bitte beachten Sie:</b> Seriously.js erfordert einen Browser, der WebGL unterstützt.",
"manual:keying:live_keying_enabled": "Umleiten von Index zu livechroma.php, die Standard-Startseite kann nicht aufgerufen werden!",
"manual:keying:live_keying_show_all": "Wenn aktiviert, werden das Originalbild und das Keying-Bild der Galerie hinzugefügt.",
"manual:mail:mail_alt_text": "Wenn die Option HTML-E-Mail aktiviert ist, wird der Inhalt dieses Feldes dann zum Mail-Text, wenn der E-Mail-Client des Empfängers keine HTML-E-Mails anzeigen kann.",
"manual:mail:mail_enabled": "Wenn diese Option aktiviert ist, ist für jedes Bild in der Galerie eine E-Mail-Schaltfläche sichtbar. Abhängig von Ihren Einstellungen können Sie Bilder direkt per E-Mail senden oder die eingegebene E-Mail-Adresse in einer Datenbank sammeln.",
"manual:mail:mail_file": "Dateiname für die E-Mail-Adressdatenbank.",
"manual:mail:mail_fromAddress": "Geben Sie Ihre Absenderadresse ein, die beim Senden von Bildern per E-Mail verwendet wird.",
"manual:mail:mail_fromName": "Geben Sie Ihren Absendernamen ein, der beim Senden von Bildern per E-Mail verwendet wird.",
"manual:mail:mail_host": "Geben Sie Ihre E-Mail-Host-Adresse ein.",
"manual:mail:mail_is_html": "Wenn diese Option aktiviert ist, unterstützt das Mail-Text-Feld HTML-Formatierungs- und semantische Markup-Funktionen.",
"manual:mail:mail_password": "Geben Sie Ihr Passwort ein, mit dem Sie sich in Ihr E-Mail-Konto einloggen.",
"manual:mail:mail_port": "Geben Sie den Port ein, über den E-Mails gesendet werden.",
"manual:mail:mail_secure": "Geben Sie das Protokoll ein, welches für die Transportverschlüsselung zwischen dem E-Mail-Client und dem Mailserver verwendet werden soll (SSL oder TLS).",
Expand Down
Loading

0 comments on commit 52da86c

Please sign in to comment.