-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathindex.php
More file actions
121 lines (101 loc) · 4.01 KB
/
index.php
File metadata and controls
121 lines (101 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
require_once 'lib/boot.php';
use Photobooth\Service\ApplicationService;
use Photobooth\Service\AssetService;
use Photobooth\Service\ProcessService;
use Photobooth\Utility\PathUtility;
$assetService = AssetService::getInstance();
$noCacheFlag = !empty($_GET['refresh']);
if (!isset($_SESSION['asset_extra_version'])) {
$_SESSION['asset_extra_version'] = '';
}
if ($noCacheFlag) {
$_SESSION['asset_extra_version'] = (string) time();
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
}
$assetService->setExtraVersion($_SESSION['asset_extra_version'] ?: null);
if (!$config['ui']['skip_welcome']) {
if (!is_file(PathUtility::getAbsolutePath('welcome/.skip_welcome'))) {
header('location: ' . PathUtility::getPublicPath('welcome'));
exit();
}
}
if ($config['chromaCapture']['enabled']) {
header('location: ' . PathUtility::getPublicPath('chroma'));
exit();
}
// Login / Authentication check
if (
!$config['login']['enabled'] ||
in_array($_SERVER['REMOTE_ADDR'] ?? '', $config['protect']['ip_whitelist'] ?? [], true) ||
(!$config['protect']['localhost_index'] && (isset($_SERVER['SERVER_ADDR']) && $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR'])) ||
((isset($_SESSION['auth']) && $_SESSION['auth'] === true) || !$config['protect']['index'])
) {
$pageTitle = ApplicationService::getInstance()->getTitle();
$photoswipe = true;
$randomImage = false;
$remoteBuzzer = true;
} else {
header('location: ' . $config['protect']['index_redirect']);
exit();
}
include PathUtility::getAbsolutePath('template/components/main.head.php');
?>
<body class="gallery-mode--overlay ">
<?php include PathUtility::getAbsolutePath('template/components/video.background.php'); ?>
<?php include PathUtility::getAbsolutePath('template/components/preview.php'); ?>
<?php if ($config['video']['enabled'] && $config['video']['animation']): ?>
<div id="videoAnimation">
<ul class="left">
<?php for ($i = 1; $i <= 50; $i++) {
print '<li class="reel-item"></li>';
} ?>
</ul>
<ul class="right">
<?php for ($i = 1; $i <= 50; $i++) {
print '<li class="reel-item"></li>';
} ?>
</ul>
</div>
<?php endif; ?>
<?php
$privateStageStart = PathUtility::getAbsolutePath('private/components/stage.start.php');
$stageStart = PathUtility::getAbsolutePath('template/components/stage.start.php');
include file_exists($privateStageStart) ? $privateStageStart : $stageStart;
if (!$config['ui']['selfie_mode']) {
include PathUtility::getAbsolutePath('template/components/stage.loader.php');
include PathUtility::getAbsolutePath('template/components/stage.results.php');
}
if ($config['gallery']['enabled']) {
include PathUtility::getAbsolutePath('template/components/gallery.php');
}
if ($config['filters']['enabled'] && !$config['ui']['selfie_mode']) {
include PathUtility::getAbsolutePath('template/components/filter.php');
}
include PathUtility::getAbsolutePath('template/components/main.footer.php');
if ($config['ui']['selfie_mode']) {
echo '<script src="' . $assetService->getUrl('resources/js/selfie.js') . '"></script>';
}
?>
<script src="<?=$assetService->getUrl('resources/js/preview.js')?>"></script>
<script src="<?=$assetService->getUrl('resources/js/virtualKeyboard.js')?>"></script>
<script src="<?=$assetService->getUrl('resources/js/screensaver.js')?>"></script>
<script src="<?=$assetService->getUrl('resources/js/core.js')?>"></script>
<?php include PathUtility::getAbsolutePath('template/components/start.adminshortcut.php'); ?>
<?php ProcessService::getInstance()->boot(); ?>
<?php if ($noCacheFlag): ?>
<script>
(function () {
try {
const url = new URL(window.location.href);
url.searchParams.delete('refresh');
window.history.replaceState(null, '', url.toString());
} catch (e) {
// ignore
}
})();
</script>
<?php endif; ?>
</body>
</html>