Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config/*
!config/config.inc.php
data/
digicamcontrol/
manual/faq.html
manual/faq.*
node_modules/
package-lock.json
private/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This is my personal Photobooth fork with some extras on top (more information ca
- standalone slideshow via [localhost/slideshow](http://localhost/slideshow)
- access login via [localhost/login](http://localhost/login) instead [localhost/login.php](http://localhost/login.php)
- offline manual with settings explained under [localhost/manual](http://localhost/manual) ([andi34/photobooth#59](https://github.com/andi34/photobooth/pull/59))
- offline FAQ under [localhost/manual/faq.html](http://localhost/manual/faq.html)
- offline FAQ under [localhost/manual/faq.php](http://localhost/manual/faq.php)
- disk usage page, access via admin panel or at [localhost/admin/diskusage.php](http://localhost/admin/diskusage.php)
- fix windows compatibility
- fix check for image filter
Expand Down
2 changes: 2 additions & 0 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@
$config['protect']['localhost_admin'] = true;
$config['protect']['index'] = false;
$config['protect']['localhost_index'] = false;
$config['protect']['manual'] = false;
$config['protect']['localhost_manual'] = false;


// U S E R I N T E R F A C E
Expand Down
21 changes: 20 additions & 1 deletion faq/header.html → faq/header.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<?php
session_start();

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

// Login / Authentication check
if (
!$config['login']['enabled'] ||
(!$config['protect']['localhost_manual'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) ||
((isset($_SESSION['auth']) && $_SESSION['auth'] === true) || !$config['protect']['manual'])
) {
require_once('../lib/configsetup.inc.php');
} else {
header('location: ../login');
exit();
}

?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
Expand All @@ -17,4 +36,4 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" type="text/css" href="../node_modules/github-markdown-css/github-markdown.css">
</head>
<body class="markdown-body" style="padding: 5rem;">
<body class="markdown-body" style="padding: 5rem;">
3 changes: 3 additions & 0 deletions faq/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
header("location: ../manual/faq.php");
exit;
12 changes: 12 additions & 0 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,18 @@
'name' => 'protect[localhost_index]',
'value' => $config['protect']['localhost_index'],
],
'protect_manual' => [
'view' => 'advanced',
'type' => 'checkbox',
'name' => 'protect[manual]',
'value' => $config['protect']['manual'],
],
'protect_localhost_manual' => [
'view' => 'expert',
'type' => 'checkbox',
'name' => 'protect[localhost_manual]',
'value' => $config['protect']['localhost_manual'],
],
],
'userinterface' => [
'view' => 'basic',
Expand Down
8 changes: 5 additions & 3 deletions login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@
</form>
<hr>
<?php endif; ?>
<?php if(!$config['protect']['admin'] || !$config['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
<?php if(!$config['protect']['admin'] || (!$config['protect']['localhost_admin'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) || !$config['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
<p><a href="../admin" class="btn btn--login"><i class="fa fa-cog"></i> <span data-i18n="admin_panel"></span></a></p>
<?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>
<p><a href="../manual/faq.html" 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>
<?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>
<?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['login']['enabled'] || (isset($_SESSION['auth']) && $_SESSION['auth'] === true)): ?>
<?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="../" class="btn btn--login" ><i class="fa fa-times"></i> <span data-i18n="close"></span></a></p>
<?php endif; ?>
<?php if(isset($_SESSION['auth']) && $_SESSION['auth'] === true): ?>
Expand Down
20 changes: 17 additions & 3 deletions manual/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<?php
session_start();

require_once('../lib/config.php');
require_once('../lib/configsetup.inc.php');

// Login / Authentication check
if (
!$config['login']['enabled'] ||
(!$config['protect']['localhost_manual'] && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) ||
((isset($_SESSION['auth']) && $_SESSION['auth'] === true) || !$config['protect']['manual'])
) {
require_once('../lib/configsetup.inc.php');
} else {
header('location: ../login');
exit();
}

?>
<!DOCTYPE html>
Expand Down Expand Up @@ -85,9 +97,9 @@
break;
};

echo '<div class="form-row">';
Copy link
Copy Markdown
Owner Author

@andi34 andi34 Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why, but seems like it was added not in all cases or the div not closed - so move it down to each case.

switch($field['type']) {
case 'checkbox':
echo '<div class="form-row">';
echo '<p><h4><span data-i18n="'.$panel.':'.$key.'">'.$panel.':'.$key.'</span></h4></p>';
echo '<p><span data-i18n="manual:'.$panel.':'.$key.'">manual:'.$panel.':'.$key.'</span></p><hr>';
echo '</div>';
Expand All @@ -96,12 +108,14 @@
case 'range':
case 'select':
case 'input':
echo '<div class="form-row">';
echo '<p><h4><span data-i18n="'.$panel.':'.$key.'"></span></h4></p>';
echo '<p><span data-i18n="manual:'.$panel.':'.$key.'">manual:'.$panel.':'.$key.'</span></p><hr>';
echo '</div>';
break;
case 'color':
case 'hidden':
echo '<div class="form-row">';
echo '<input type="hidden" name="'.$field['name'].'" value="'.$field['value'].'"/>';
echo '</div>';
break;
Expand All @@ -113,7 +127,7 @@
}
?>
</br>
<a href="faq.html" class="btn faq-btn" title="FAQ" target="newwin"><span data-i18n="show_faq"></span> <i class="fa fa-question-circle" aria-hidden="true"></i></a></br>
<a href="faq.php" class="btn faq-btn" title="FAQ" target="newwin"><span data-i18n="show_faq"></span> <i class="fa fa-question-circle" aria-hidden="true"></i></a></br>
</form>
<a href="https://github.com/andi34/photobooth/wiki" class="btn wiki-btn"><span data-i18n="show_wiki"></span></a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A Photobooth webinterface for Raspberry Pi and Windows",
"scripts": {
"build": "npm-run-all --serial format build:faq build:gulp",
"build:faq": "mdown --input 'faq/*.md' --output manual --header faq/header.html --footer faq/footer.html",
"build:faq": "mdown --input 'faq/*.md' --output manual --header faq/header.php --footer faq/footer.html && mv manual/faq.html manual/faq.php",
"build:gulp": "gulp",
"build:sass": "gulp sass",
"eslint": "eslint src/js/*.js",
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"authentication:protect_index": "Protect start screen",
"authentication:protect_localhost_admin": "Protect admin panel on localhost access",
"authentication:protect_localhost_index": "Protect start screen on localhost access",
"authentication:protect_localhost_manual": "Protect manual & FAQ on localhost access",
"authentication:protect_manual": "Protect manual & FAQ",
"auto_reload": "Photobooth reloads automatically...",
"available_version": "Available version",
"busy": "Processing ...",
Expand Down Expand Up @@ -169,6 +171,8 @@
"manual:authentication:protect_index": "If enabled, start screen can only be accessed if a username and password is entered.",
"manual:authentication:protect_localhost_admin": "If disabled, admin panel can be accessed without username and password from localhost.",
"manual:authentication:protect_localhost_index": "If disabled, start screen can be accessed without username and password from localhost.",
"manual:authentication:protect_localhost_manual": "If disabled, manual and FAQ can be accessed without username and password from localhost.",
"manual:authentication:protect_manual": "If enabled, manual and FAQ can only be accessed if a username and password is entered.",
"manual:collage:collage_cntdwn_time": "Set your countdown time between pictures while taking a collage.",
"manual:collage:collage_continuous": "Take collage without interrupption.",
"manual:collage:collage_enabled": "If enabled, user can take a collage. A collage consists of 4 pictures. Optional you can take a collage with or without interruption.",
Expand Down
1 change: 1 addition & 0 deletions scripts/pack-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function createArchive(fileName, archive) {
archive.file('config/.htaccess');
archive.file('config/config.inc.php');
archive.file('chromakeying.php');
archive.file('faq/index.php');
archive.file('gallery.php');
archive.file('index.php');
archive.file('LICENSE');
Expand Down