if($is_loged_in AND $_SERVER['HTTP_REFERER'] == '' AND !$_SESSION['dle_name'] ) {
$is_loged_in = FALSE;
} elseif ($is_loged_in AND $_SERVER['HTTP_REFERER'] != '' AND strpos( strtolower($_SERVER['HTTP_REFERER']), $config['admin_path'] ) === false) {
$allow_mod = array("editusers", "editnews", "iptools", "blockip");
$allow_action = array("edituser", "editnews");
if ($config['extra_login']) $allow_mod[] = "";
if (in_array($_GET['mod'], $allow_mod)) {
if (($_GET['action'] AND !in_array($_GET['action'], $allow_action)) OR $_GET['ifdelete']) $is_loged_in = FALSE;
} else $is_loged_in = FALSE;
} elseif ($is_loged_in AND strpos( strtolower($_SERVER['HTTP_REFERER']), "mod=editnews" ) !== false) {
if (@strpos( $_SERVER['HTTP_REFERER'], $_GET['id'] ) === false AND count($_GET) > 2 AND $_GET['mod'] != "editnews") $is_loged_in = FALSE;
}
if (!$is_loged_in) {
@session_destroy();
@session_unset();
}