-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
56 lines (45 loc) · 884 Bytes
/
index.php
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
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
include("init.php");
include("sidebar.php");
$SiteAdmin = -1;
if(isset($_SESSION['SiteAdmin']))
{
$SiteAdmin = $_SESSION['SiteAdmin'];
}
if(isset($_REQUEST['page']))
{
$page = $_REQUEST['page'];
if(str_ends_with($page,"/"))
{
$page = substr($page,0,strlen($page) -1);
}
if(!file_exists("content/".$page.".php"))
{
$page = "404";
}
}
else
{
$page = "community/news";
}
include("menu.php");
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
$smarty->assign('gen_time',$totaltime);
$smarty->assign('page', $page);
if(HasPagePermission($page,$current_user['SiteAdmin'],$sid))
{
include("content/".$page.".php");
}
else
{
DisplayPermissionError();
}
?>