-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathman.php
More file actions
80 lines (78 loc) · 2.24 KB
/
Copy pathman.php
File metadata and controls
80 lines (78 loc) · 2.24 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
<?PHP
include 'header.php';
include 'language.php';
$uname=$_SESSION['uname'];
$admin=$_SESSION['admin'];
function description($file, $pat) {
$f=fopen($file,"r");
$name=0;
while (($line=fgets($f))!=FALSE) {
if ($name==0) {
if (strncmp($line, "<h2>NAME", 8)==0)
$name=1;
}
else {
if (strstr($line, $pat)!=FALSE) {
$s=strstr($line, "-");
if ($s == FALSE) {
$s=strstr($line, "−");
if ($s == FALSE)
return "";
}
return str_replace("</p>\n", "", $s);
}
}
continue;
}
return "";
}
function listman($path) {
$files=scandir($path);
if ($files==FALSE)
return;
printf ("<div class=\"table-responsive\">\n<table class=\"table\">\n<tbody>\n");
foreach ($files as $file) {
if ($file == "." || $file == "..")
continue;
printf("<tr>");
$name=preg_replace("/.html/", "", $file);
$fullpath=$path.'/'.$file;
printf("<td><a href=\"%s\">%s</a></td><td>%s</td>\n", $fullpath, $name,
description($fullpath, $name));
printf("</tr>");
}
printf ("</tbody></table></div>\n");
}
?>
<!DOCTYPE html>
<html>
<?PHP include('header.html');?>
<body class="hold-transition <?PHP echo $skin;?> sidebar-mini">
<div class="wrapper">
<!-- Navigation -->
<?PHP include 'navigation.php';?>
<div class="content-wrapper">
<section class="content-header">
<h1 class="page-header">Cube <?PHP echo $lang['MAN_PAGES'];?></h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-solid">
<div class="box-body">
<h3><?PHP echo $lang['COMMAND'];?></h3>
<?PHP listman("man1"); ?>
<h3><?PHP echo $lang['CONFIG'];?></h3>
<?PHP listman("man5"); ?>
<h3><?PHP echo $lang['DAEMON'];?></h3>
<?PHP listman("man8"); ?>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<?PHP include('js.html');?>
</body>
</html>