File "index.php"

Full Path: /home/analogde/www/JAVA/system/index.php
File size: 2.45 KB
MIME-type: text/x-php
Charset: utf-8

<?php
	
	$PXP_language = "en";

	require("./config.php");

	if(!file_exists(dirname(__FILE__) . "/.htaccess")){
	
		if(!is_writable(dirname(__FILE__)))
			die("Ensure that phpXplorer/system directory is writable!");

		require(dirname(__FILE__) . "/lang.pxlf/" . $PXP_system_language . ".pxl.php");	
	
		$isUnix = strpos(strToUpper(PHP_OS), "WIN") === false;
		
		if(!file_exists(dirname(__FILE__) . "/.htgroups"))
			if(!copy(dirname(__FILE__) . "/filetypes/htgroups/default.htgroups", dirname(__FILE__) . "/.htgroups"))
				die("Ensure that phpXplorer/system directory is writable!");
		
		if(!file_exists(dirname(__FILE__) . "/.htpasswd"))
			if($isUnix){
				if(!copy(dirname(__FILE__) . "/filetypes/htpasswd/unix.default.htpasswd", dirname(__FILE__) . "/.htpasswd"))
					die("Ensure that phpXplorer/system directory is writable!");
			}else{
				if(!copy(dirname(__FILE__) . "/filetypes/htpasswd/windows.default.htpasswd", dirname(__FILE__) . "/.htpasswd"))
					die("Ensure that phpXplorer/system directory is writable!");
			}

		$htaccessText = implode("", file(dirname(__FILE__) . "/filetypes/htaccess/default.htaccess"));

		$htaccessText = str_replace("{@AuthName}", "phpXplorer@" . $HTTP_SERVER_VARS["HTTP_HOST"], $htaccessText);
		$htaccessText = str_replace("{@AuthUserFile}", $PXP_dir . "/.htpasswd", $htaccessText);
		$htaccessText = str_replace("{@AuthGroupFile}", $PXP_dir. "/.htgroups", $htaccessText);
		$htaccessText = str_replace("user {@Require users}", "valid-user", $htaccessText);
		$htaccessText = str_replace("{@Require groups}", "", $htaccessText);
		
		$handle = fopen(dirname(__FILE__) . "/.htaccess", "w");
		fwrite($handle, $htaccessText);
		fclose($handle);
		
		require(dirname(__FILE__) . "/filetypes/pxsf/writeShareHtaccessFiles.php");

	 	header("Location: " . $PXP_url . "/index.php?shareId=" . $PXP_share_id);
	}
?>
<html>
<head>
<title>phpXplorer</title>
<script>
	function op(){}
</script>
</head>
<frameset rows="52,*" onUnload="if(parent.frames['basefrm'].destruct)parent.frames['basefrm'].destruct()">
  <frame src="./menuHead.php?shareId=<?php echo $PXP_share_id ?>" name="phpXplorerHead" scrolling="no" noresize="noresize">
  <frameset cols="160,*" frameborder="1" framespacing="1" border="2" name="phpXplorerWorkspace"> 
    <frame src="./tree_<?php echo $PXP_tree ?>.php?shareId=<?php echo $PXP_share_id ?>" name="phpXplorerTree">
    <frame src="<?php echo $PXP_startpage . '?shareId=' . $PXP_share_id ?>" name="basefrm">
  </frameset>
</frameset>
</html>