-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.php
More file actions
49 lines (35 loc) · 2.17 KB
/
default.php
File metadata and controls
49 lines (35 loc) · 2.17 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
<?php
# default.php the "boot strapper" for this project.
#
# created 2012/05/15 by Dave Henderson (dhenderson@cliquesoft.org or support@cliquesoft.org)
# updated 2019/11/23 by Dave Henderson (dhenderson@cliquesoft.org or support@cliquesoft.org)
#
# Unless a valid Cliquesoft Proprietary License (CPLv1) has been purchased
# for this device, this software is licensed under the Cliquesoft Public
# License (CPLv2) as found on the Cliquesoft website at www.cliquesoft.org
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the appropriate Cliquesoft License for details.
#
# NOTES
header('Content-Type: text/html; charset=utf-8');
if (isset($_COOKIE['username'])) { $user=$_COOKIE['username']; } else { $user='guest'; }
if (! @file_exists("data/config.js") || ! @file_exists("data/config.php")) { # IF we no configuration has been made, then we need to run the setup so...
$page = @fopen("home/".$user."/look/tracker.setup.html", "r");
} else if ( $_GET['p'] != '' && @file_exists("home/".$user."/look/".$_GET['p'])) { # IF we have a specific file to display (and it exists), then...
$page = @fopen("home/".$user."/look/".$_GET['p'], "r");
} else if( $_GET['kb'] != '' && @file_exists("home/".$user."/look/tracker.kb.html")) { # IF we need to show a knowledge base (kb) article, then...
$page = @fopen("home/".$user."/look/tracker.kb.html", "r");
} else if( $_GET['report'] != '' && @file_exists("home/".$user."/look/tracker.report.html")) { # IF we need to show a report, then...
$page = @fopen("home/".$user."/look/tracker.report.html", "r");
} else { # OTHERWISE, this was being called without any specific page (e.g. http://127.0.0.1/) and the default page needs to be shown...
$page = @fopen("home/".$user."/look/tracker.html", "r");
}
while ($LINE = fgets($page)) {
# Psuedo snippets for dynamic content using shell-style-variables in the .html file
if (strpos($LINE, '${UN}') !== false) { $LINE = str_replace('${UN}', $user, $LINE); }
if (strpos($LINE, '${WIKI}') !== false) { $LINE = str_replace('${WIKI}', WIKI, $LINE); }
echo "$LINE";
}
?>