forked from andrew867/timeclock
-
Notifications
You must be signed in to change notification settings - Fork 5
/
header.php
66 lines (50 loc) · 1.62 KB
/
header.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
57
58
59
60
61
62
63
64
65
66
<?php
require 'common.php';
ob_start();
echo "<html>\n";
// grab the connecting ip address. //
$connecting_ip = get_ipaddress();
if (empty($connecting_ip)) {
return false;
}
// determine if connecting ip address is allowed to connect to PHP Timeclock //
if ($restrict_ips == "yes") {
for ($x = 0; $x < count($allowed_networks); $x++) {
$is_allowed = ip_range($allowed_networks[$x], $connecting_ip);
if (!empty($is_allowed)) {
$allowed = true;
}
}
if (!isset($allowed)) {
echo "You are not authorized to view this page.";
exit;
}
}
// connect to db //
tc_connect();
// include css and timezone offset//
if (($use_client_tz == "yes") && ($use_server_tz == "yes")) {
echo 'Please reconfigure your config.inc.php file, you cannot have both $use_client_tz AND $use_server_tz set to \'yes\'';
exit;
}
echo "<head>\n";
if ($use_client_tz == "yes") {
if (!isset($_COOKIE['tzoffset'])) {
include 'tzoffset.php';
echo "<meta http-equiv='refresh' content='0;URL=timeclock.php'>\n";
}
}
echo "<link rel='stylesheet' type='text/css' media='screen' href='css/default.css' />\n";
echo "<link rel='stylesheet' type='text/css' media='screen' href='css/local.css' />\n";
echo "<link rel='stylesheet' type='text/css' media='print' href='css/print.css' />\n";
echo "<script language=\"javascript\" src=\"scripts/common.js\"></script>\n";
// set refresh rate for each page //
if ($refresh == "none") {
echo "</head>\n";
} else {
echo "<meta http-equiv='refresh' content=\"$refresh;URL=timeclock.php\">\n";
echo "</head>\n";
}
setTimeZone();
?>
<body>