Location: PHPKode > projects > Wexplorer > weXplorer/dispatcher.php
<?php


/*
 * Created on 7 nov. 2005
 *
 */
require_once ('config.inc.php');
require_once ('session.php');


require_once (ACCESS_MANAGER.'.php');
if(preg_match ( "/\?framed$/", $_SERVER["REQUEST_URI"])) {
  if (isset ($_POST['login'])) {
	if (!login($_POST['login'], $_POST['password'])) {
		define('falseLogin', true);
	} else {
		echo '
 <html>
<head>
<title>Welcome</title>
<script language="JavaScript" type="text/javascript" src="'.ROOT_URL.'/js/popup.js"></script>  
<!-- START LIST VIEW STYLES AND SCRIPTS -->
<link type="text/css" rel="StyleSheet" href="'.ROOT_URL.'/css/sortabletable.css" />
<script src="'.ROOT_URL.'/js/sorttable.js"></script>
<script src="'.ROOT_URL.'/js/spook.js"></script>
<!-- END LIST VIEW STYLES AND SCRIPTS -->  
</head>
<body>

	<script language="JavaScript" type="text/javascript">	
	 if(parent.header != null){
		parent.header.location.href = "'.ROOT_URL.'/header.php?nochache='.time().'";
		parent.tree.document.cache = new Object();
		parent.tree.reget();	
  	} else {
		location.href="'.ROOT_URL.'";
	}
	</script>
</body>
</html>
';
		die();
	}
}
}else if (isset ($_POST['login'])) {
	if (!login($_POST['login'], $_POST['password'])) {
		define('falseLogin', true);
	} else
		if (isset ($_GET['framed'])) {
			echo '
					<script language="JavaScript" type="text/javascript">	
					parent.header.location.href = "'.ROOT_URL.'/header.php?nochache='.time().'";
					document.location.href=parent.tree.document.lastget;
					</script>';
			flush();
			die();
		} else {
		}
}
if (isset ($_GET['path'])) {
	$path = expandPath($_GET['path']);
} else {
	$path = parse_url ( $_SERVER[REQUEST_URI]);
	$path = urldecode ( $path ['path']);
	$path = str_replace(TRANSPARENT_URL_FRAGMENT, "", $path);
	$_GET['path'] = $path;
	$path = expandPath($path);
}
chdir(ROOT_DIR);

if (file_exists($path)) {
	if (!is_dir($path)) {
		if (substr($path, -3) == "php") {
			include ($path);
			die();
		}
		if (authorized($path)) {
			include ("binary.php");
			sendBinary($path);
		} else {
			//header("Location: ".ROOT_URL."/login.php");
			include("login.php");
		}
	} else {
		include ('index.php');
	}
} else {
	include ("404.php");
}
?>



Return current item: Wexplorer