Location: PHPKode > projects > PHPExplorer > modules/pub/include.php
<?
require_once("config.php");

$ok=0;
for($i=0;$pubpass[$i];$i++) if($pubpass[$i]==$pwd){ $ok=1; $anonymous=$anonymous[$i];}

@putenv("max_upload_size=".$maxfs."M");

if(!$ok){
 header("Location: $pathp/login.php?logout=1&sup=P");
}


if(!@chdir($anonymous)) @mkdir($anonymous,0777);

function dirsize($dirname){
 set_time_limit(1000);
 if(substr($dirname,-1,1)!="/") $dirname.="/";
 $z=opendir($dirname); $size="0";
 while($d=readdir($z)){
  if($d!="."&&$d!=".."){
   if(is_dir($dirname.$d)) $size=$size+dirsize($dirname.$d);
   else $size=$size+filesize($dirname.$d);
  }
 }
 return $size;
}

if(!$dir) $dir="/";

if(substr_count($dir,"..")||substr_count(":",$dir)||!@chdir($anonymous.$dir)){
 $dir="/"; header("Location: $pathp/modules/pub/index.php?dir=$dir&warn=1"); exit();}
if(substr($dir,-1,1)!="/") $dir.="/";

if($warn){ print("<html><Script>alert('Le dossier est invalide. Vous êtes ramené à la racine.');window.location.href='$pathp/modules/pub/index.php?dir=$dir';</Script></html>"); }

?>
Return current item: PHPExplorer