<?
if ($_GET['path']) {
	$sys['path'] = $str->fromHTML($_GET['path']);
} else {
	$sys['path'] = $str->fromHTML($_POST['path']);
}

if ($_GET['object']) {
	$sys['object'] = $str->fromHTML($_GET['object']);
} else {
	$sys['object'] = $str->fromHTML($_POST['object']);
}

if ($_GET['uid']) {
	$sys['uid'] = $str->fromHTML($_GET['uid']);
} else {
	$sys['uid'] = $str->fromHTML($_POST['uid']);
}

if ($_GET['gid']) {
	$sys['gid'] = $str->fromHTML($_GET['gid']);
} else {
	$sys['gid'] = $str->fromHTML($_POST['gid']);
}

if ($_GET['pid']) {
	$sys['pid'] = $str->fromHTML($_GET['pid']);
} else {
	$sys['pid'] = $str->fromHTML($_POST['pid']);
}

if ($_GET['act']) {
	$sys['act'] = $_GET['act'];
} else {
	$sys['act'] = $_POST['act'];
}

if (!isCleanFilename($sys['object'])) {
	exit("Error: ".base64_encode("dirty object var")."");
}

if (!isCleanPath($sys['path'])) {
	exit("Error: ".base64_encode("dirty path var")."");
}



$sys['path'] = cleanPath($sys['path']);

$commentFileName = ".afian.comments";
$thumbsDirName = ".afian.thumbs";


/* these are the objects that will not be listed */
$ignoreFiles = array(
	$commentFileName, 
	$thumbsDirName, 
	".afian.descriptions",
	".afian.locking",
	".htaccess",
	".AppleDouble"
);


$ilegalCharacters = array("\\","/",":","*","?","<",">","|","\"");


if ($_GET['sort']) {
	$_SESSION['detailSort'] = $_GET['sort'];
} else {
	if (!$_SESSION['detailSort']) {
		$_SESSION['detailSort'] = "filename";
	}
}


if ($_GET['sortDir'] && ($_GET['sortDir'] == "ASC" || $_GET['sortDir'] == "DESC")) {
	$_SESSION['sortDir'] = $_GET['sortDir'];
} else {
	$_SESSION['sortDir'] = "ASC";
}
?>