33 lines
902 B
PHP
33 lines
902 B
PHP
|
<?php
|
||
|
include_once("headerFile.php");
|
||
|
//preg_match('/\/([\w]+[\.\w]+)$/i',$_SERVER['SCRIPT_NAME'],$SCRIPT_NAME);
|
||
|
$SCRIPT_NAME = basename($_SERVER['SCRIPT_NAME']);
|
||
|
if (!is_null($PARENT_SCRIPTNAME)) {
|
||
|
$LINK = $PARENT_SCRIPTNAME;
|
||
|
} else {
|
||
|
|
||
|
$LINK = $SCRIPT_NAME;
|
||
|
}
|
||
|
|
||
|
if (!$_SESSION['SCRIPT_ALLOW'][$LINK]){
|
||
|
if (strpos($SCRIPT_NAME,'_ajax.php') || strpos($SCRIPT_NAME,'_plugin.php')) {
|
||
|
echo "Your Session Is Expired. Please log out and log back in.";
|
||
|
} else {
|
||
|
//echo "$script_name";
|
||
|
$message = "Anda tidak mempunyai access untuk mengakses halaman <strong>'$SCRIPT_NAME'</strong>.";
|
||
|
if (headers_sent()) {
|
||
|
$output = <<< out
|
||
|
<span style="color:red;font-family:arial;size:11px">$message</span>
|
||
|
out;
|
||
|
|
||
|
echo $output;
|
||
|
} else {
|
||
|
redirect("./message_page.php?MESSAGE_HEADER=E R R O R&MESSAGE_BODY=Anda tidak mempunyai access untuk mengakses halaman `$SCRIPT_NAME` .");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
exit(0);
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|