redirect("http://www.adaptivecomputing.com/resources/downloads/mcm/snapshots", "snap"); ?>
function strstr_after($haystack, $needle, $case_insensitive = false) {
$strpos = ($case_insensitive) ? 'stripos' : 'strpos';
$pos = $strpos($haystack, $needle);
if (is_int($pos)) {
return substr($haystack, $pos + strlen($needle));
}
// Most likely false or null
return $pos;
}
// Start configs
$sitename='Moab Cluster Manager Snapshots';
$date='M-d-y'; // date format
$ignore=array('.','..','.htaccess','index.php','icon.php','Thumbs.db','windowsdebug'); // ignore these files
// End configs
/*
$root=dirname(__FILE__);
$dir=isset($_GET['dir'])?$_GET['dir']:'';if(strstr($dir,'..'))$dir='';
*/
$url = $_SERVER['PHP_SELF'];
$furl = '';
$dir = '';
$parts = split("/", $url);
array_pop($parts);
foreach($parts as $p){
$furl .= $p;
}
//$parts = array_reverse($parts);
if(isset($_GET['dir'])){
$furl = $_GET['dir'];
if ($furl == 'mcm/snapshots/windowsdebug' || $furl == 'mcm/snapshots/genericMetricBeta' || $furl == 'mcm/snapshots/cloud' || $furl == 'mcm/snapshots/ubirming' ) {
$backDir = 'mcm/snapshots';
$backUrl = 'product/mcm/snapshots.php?dir='.$backDir;
}
else{$furl = 'mcm/snapshots';}
}
else{
$furl = 'mcm/snapshots';
}
//$path="$root/$dir/";
$path="/home/web/files/$furl/";
$dirs=$files=array();
if(!is_dir($path)||false==($h=opendir($path)))exit('Directory does not exist.');
while(false!==($f=readdir($h)))
{
if(in_array($f,$ignore))continue;
if(is_dir($path.$f))$dirs[]=array('name'=>$f,'date'=>filemtime($path.$f),'url'=>'product/'.$furl.'.php?dir='.rawurlencode(trim("$furl$dir/$f",'/')));
else$files[]=array('name'=>$f,'size'=>filesize($path.$f),'date'=>filemtime($path.$f),'url'=>trim("/download/$furl/".rawurlencode($f),'/'));
}
closedir($h);
$current_dir_name = basename($dir);
//$up_dir=dirname($path.$dir);
//$up_url=($up_dir!=''&&$up_dir!='.')?'snapshots.php?dir='.rawurlencode($up_dir):'snapshots.php';
// END PHP ?>
=$current_dir_name==''?'Directory list':$current_dir_name?>


