Skip to content

Commit 3fa93f9

Browse files
committed
Fixing env variable check
1 parent 0297285 commit 3fa93f9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/mouf_router.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
<?php
1+
<?php
2+
$moufUI = getenv('MOUF_UI');
3+
if ($moufUI !== false) {
4+
$moufUI = (bool) $moufUI;
5+
if (!$moufUI) {
6+
header('HTTP/1.1 403 Forbidden');
7+
echo 'Error! Access to Mouf UI is forbidden on this environment (env variable MOUF_UI is set to 0)';
8+
exit;
9+
}
10+
}
11+
unset($moufUI);
12+
213
if (!file_exists(__DIR__.'/../../../../mouf/no_commit/MoufUsers.php')) {
314

415
$rootUrl = $_SERVER['BASE']."/";

src/splash.php

-11
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
$moufUI = getenv('MOUF_UI');
12-
if ($moufUI !== false) {
13-
$moufUI = (bool) $moufUI;
14-
if (!$moufUI) {
15-
header('HTTP/1.1 403 Forbidden');
16-
echo 'Error! Access to Mouf UI is forbidden on this environment (env variable MOUF_UI is set to 0)';
17-
exit;
18-
}
19-
}
20-
unset($moufUI);
21-
2211
// Let's load the Mouf file, and the MoufAdmin file.
2312
// The MoufAdmin will replace the Mouf configuration file.
2413
if (file_exists(dirname(__FILE__).'/../MoufComponents.php')) {

0 commit comments

Comments
 (0)