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SqGBObmXSZBqMIZoQZ2CXKmQbryqkZJ7YY14boRtbP///8fHx5eXl5OTk4mJiYODg3Z2dnBwcGlpaWBgYP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADYALAAAAAANABAAAAZyQJtwSCyOQiRRKBVamVpCgkBAQqkCJ4DJJRwUSp2SpwQqsWbdR2ft4YAy5+5i3Wm/47YBo3PpW+5oeQl0dnCBAxB8fRcWLHgDDYRuhl0Hin6OhwiSgF0KfBaFjw5rHxobExQVMEMGERIYNTQyMS9Ft0RBADs=";
$img['rar'] = &$img['zip'];
$img['tar'] = &$img['zip'];
$img['html'] = &$img['htm'];
$img['php'] = &$img['htm'];
$img['asp'] = &$img['htm'];
$img['jpg'] = &$img['img'];
$img['gif'] = &$img['img'];
$img['png'] = &$img['img'];
$img['bmp'] = &$img['img'];
{
$d = &$img[$i];
}
else
{
$d = &$img['<x>'];
}
header('Content-type: image/gif'); header('Content-Disposition: attachment; filename="' . $i . '"');
}
function getExt($filename)
{
}
function size($size)
{
$mult = 'kB';
$prec = 0;
if(round($size / 1024, 0)) {
$size /= 1024;
$mult = 'kB';
$prec = 3;
}
if(round($size / 1024, 0)) {
$size /= 1024;
$mult = 'mB';
$prec = 3;
}
return (round($size, $prec) . ' ' . $mult); }
function fsize($sfile)
{
}
function dsize($sdir)
{
$size = 0;
while(false !== ($read = readdir($handle))) {
if($read <> '.' && $read <> '..')
{
{
$size += fsize($sdir . $read);
}
{
$size += dsize($sdir . $read . '/');
}
}
}
return $size;
}
if(IsSet($_GET['dir']) && $_GET['dir'] <> '' && is_dir($_GET['dir'])) {
if($_GET['dir'] == './')
{
$dir = $_GET['dir'];
}
elseif(eregi('\.\./', $_GET['dir'])) {
$dir = './';
}
else
{
if(substr($_GET['dir'], -1) == '/') {
$dir = $_GET['dir'];
}
else
{
$dir = $_GET['dir'] . '/';
}
}
} else {
$dir = './';
}
if($dir == './')
{
$cur_dir = 'Root';
}
else
{
}
while(false !== ($read = readdir($handle))) {
if($read <> '.' && $read <> '..')
{
$show[] = $read;
}
}
?>
<html>
<head>
<title>Directory Indexer</title>
<style>
body { margin: 0px; }
body, td, th { font-family: Arial; font-size: 12px; }
a { color: #000000; text-decoration: underline; }
a:hover { color: #666666; text-decoration: none; }
.dir_container { border-left: 1px solid #000000; border-right: 1px solid #000000; width: 760px; }
.dir_container h1 { margin: 10px; }
.dir_container th { background-color: #000000; color: #FFFFFF; text-align: left; }
.row1 { background-color: #FFFFFF; }
.row2 { background-color: #DDDDDD; }
.error { background-color: #F2DDDD; border: 1px solid #992A2A; border-top: 0px; font-family: Verdana; margin: 5px; padding: 0px; }
.error h4 { background-color: #E3C0C0; border: 1px solid #992A2A; border-left: 0px; border-right: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; font-weight: bold; margin: 0px; padding: 5px; }
.error p { background-color: transparent; border: 0px; font-family: Verdana; color: #992A2A; font-size: 12px; margin: 0px; padding: 8px; }
</style>
</head>
<body>
<div align="center">
<table border="0" cellpadding="5" cellspacing="0" class="dir_container">
<tr>
<td colspan="5">
<h1>
<?php echo $cur_dir; ?></h1>
<?php
if($dir <> './')
{
$dirs = '<a href="index.php?dir=./">Root</a> / ';
foreach($ex as $nr => $tdir)
{
$link = './';
for($i = 0; $i < $nr; $i++)
{
$link .= $ex[$i] . '/';
}
$dirs .= '<a href="index.php?dir=' . $link . $tdir . '">' . $tdir . '</a> / ';
}
}
?>
</td>
</tr>
<tr>
<th width="1%"></th>
<th>Naam:</th>
<th width="15%">Grootte:</th>
<th width="20%">Type:</th>
<th width="30%">Gewijzigd op:</th>
</tr>
<?php
{
$i = 0;
foreach($show as $row)
{
$tr_class = ($i % 2 ? 'row1' : 'row2');
?>
<tr class="
<?php echo $tr_class; ?>">
<td><img src="index.php?i=
<?php echo (is_dir($dir . $row) ?
'dir' : getExt
($row)); ?>" alt="
<?php echo $row; ?>"></td>
<td><a href="
<?php echo (is_dir($dir . $row) ?
'index.php?dir=' . $dir . $row : $dir . $row); ?>">
<?php echo $row; ?></a></td>
<td align="right">
<?php echo size
(is_dir($dir . $row) ? dsize
($dir . $row . '/') : fsize
($dir . $row)); ?></td>
<td>
<?php echo (is_dir($dir . $row) ?
'Bestandsmap' : getExt
($row) . ' bestand'); ?></td>
</tr>
<?php
$i++;
}
}
else
{
?>
<tr>
<td colspan="5"><div class="error"><h4>Directory is leeg</h4> <p>Er staan (nog) geen mappen en/of bestanden in deze directory.</p></div></td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>