<?
error_reporting(0);
if(!file_exists("inc/config.php")){
header("Location: install.php");exit;
}
require_once("inc/validate.php");
$needed_dirs=array("tmp/","tmp/file/","tmp/img/");
foreach($needed_dirs as $dir){
if(file_exists($dir)){
if(!is_dir($dir)){
header("Location: error.php?id=1");exit;
}
}
else{
if(!mkdir($dir,0777,true)){
header("Location: error.php?id=2");exit;
}
}
}
include("inc/head.inc");
$drives=array();
$result=mysql_query("SELECT * FROM file_drives WHERE name!='recyclebin' ORDER BY name");
while($row=mysql_fetch_array($result)){
if(permission($row['name'],"view")){
$drives[]=$row['name'];
}
}
if(permission("recyclebin","view")){
$drives[]="recyclebin";
}
?>
<table id="pane_table"><tr><td id='left_pane'>
<div class="pane-inner">
<h2>Pods</h2>
<div id="pod_area">
</div>
</div>
</td><td id="right_pane">
<div class="pane-inner">
<h2>Drives</h2>
<ul class='drive_list'>
<?
foreach($drives as $drive){
$name=ucwords($drive);
if($drive=="recyclebin"){
$name="Recycle Bin";
echo "</ul><h2>$name</h2><ul class='drive_list'>";
}
echo "<li id='file_$drive'><span class='location'>$drive/</span>";
if(permission($drive,"edit")&&$drive!="recyclebin"){
echo "<span class='fright'><a href='javascript:create_dir(\"$drive/\",\"$drive\");'><img src='src/img/icons/folder_add.png'></a></span>";
}
echo "<a href='javascript:open(\"$drive/\",\"$drive\");'><img class='icon drive_icon' src='src/img/icons/drive_network.png'> $name</a></li> \n";
}
?>
<ul>
</div>
</td><td>
</table>
<?include("inc/foot.inc");?>