docwrapper.php3 745 Bytes
Newer Older
1
2
3
4
5
6
<?php
require("defs.php3");

#
# Standard Testbed Header
#
7
8
9
if (!$printable) {
    PAGEHEADER("Emulab Documentation");
}
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#
# Need to sanity check the path! For now, just make sure the path
# does not start with a dot or a slash.
#
$first = substr($docname, 0, 1);
if (strcmp($first, ".") == 0 ||
    strcmp($first, "/") == 0) {
    USERERROR("Invalid document name: $docname!");
}
#
# Nothing that looks like a ../ is allowed anywhere in the name
#
if (strstr($docname, "../")) {
    USERERROR("Invalid document name: $docname!");
}

27
28
29
if (!$printable) {
	echo("<b><a href=$REQUEST_URI&printable=1>Printable version of this document</a></b><br>");
}
30
31
32
33
34
readfile("$docname");

#
# Standard Testbed Footer
# 
35
36
37
if (!$printable) {
    PAGEFOOTER();
}
38
39
?>