forked from Luis-J-Ianez/cubecomps.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib_ref_admin.php
30 lines (29 loc) · 1.04 KB
/
lib_ref_admin.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
<?
/* This file is a security measure to prevent entering certain pages directly, instead of through a link.
* This is because some pages take actions over the database (or where else), and if entered in error, they could cause
* unexpected or even harmful results.
*/
if(!isset($_SESSION)) {
session_start();
}
include "inc_private.php";
if (!$_SESSION["c_admin"] || !preg_match("~//(www.|test.)?".DOMAIN."~i",$_SERVER["HTTP_REFERER"]))
{
$txt = <<<TEXT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Session expired!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
</head>
<body style="font-family:arial;">
<h1 style="color:#0a328c;font-size:1.0em;">SESSION EXPIRED</h1>
<p style="font-size:0.8em;">Please <a href="/">re-login</a>.</p>
</body>
</html>
TEXT;
exit($txt);
}
?>