> 9) + 1980; $month = ($DOSdate & 480) >> 5; $day = ($DOSdate & 31); $hours = ($DOStime & 63488) >> 11; $minutes = ($DOStime & 2016) >> 5; $seconds = ($DOStime & 31) * 2; return mktime($hours, $minutes, $seconds, $month, $day, $year); } function list_zip($filename) { global $backgrcolor, $headercolor, $tablecolor, $font, $headerfontcolor; global $normalfontcolor, $datetimeformat, $mess; $fp=@fopen($filename,"rb"); if (!$fp) {return;} fseek($fp, -22, SEEK_END); // Get central directory field values $headersignature = 0; do { // Search header $data = fread($fp, 22); list($headersignature,$numberentries, $centraldirsize, $centraldiroffset) = array_values(unpack("Vheadersignature/x6/vnumberentries/Vcentraldirsize/Vcentraldiroffset", $data)); fseek($fp, -23, SEEK_CUR); } while (($headersignature != 0x06054b50) && (ftell($fp) > 0)); if ($headersignature != 0x06054b50) { echo "

$mess[45]

"; fclose($fp); return; } // Go to start of central directory fseek($fp, $centraldiroffset, SEEK_SET); // Read central dir entries echo "

$mess[46]

"; echo "
"; echo ""; for ($i = 1; $i <= $numberentries; $i++) { // Read central dir entry $data = fread($fp, 46); list($arcfiletime,$arcfiledate,$arcfilesize,$arcfilenamelen,$arcfileattr) = array_values(unpack("x12/varcfiletime/varcfiledate/x8/Varcfilesize/Varcfilenamelen/x6/varcfileattr", $data)); $filenamelen = fread($fp, $arcfilenamelen); $arcfiledatetime = MsDosTimeToUNIX($arcfiledate, $arcfiletime); echo ""; // Print FileName echo ""; // Print FileSize column echo ""; // Print FileDate column echo ""; echo ""; } echo "
$mess[15] $mess[17] $mess[47]
"; if ($arcfileattr == 16) { echo "$filenamelen"; } else { echo $filenamelen; } echo ""; if ($arcfileattr == 16) { echo "$mess[48]";} else echo $arcfilesize; echo ""; echo date($datetimeformat, $arcfiledatetime); echo "
"; fclose($fp); return; } function verify_admin($login, $passw) { if (!file_exists("include/users.txt")) return 0; $fp=@fopen("include/users.txt","r"); if($fp) { while(!feof($fp)) { $buf=fgetcsv($fp, 255, ";"); if (!is_array($buf)) {continue;} if(!ereg("^[#]",$buf[0])) { $l=$buf[0]; $p=$buf[1]; if ($login==$l && $passw==$p && $login!="" && $passw!="") return 1; } } } return 0; } function place_header($message) { global $mess, $infopage, $font, $normalfontcolor, $selectedfontcolor, $homeurl; global $adminloggedin; echo "
» $message

"; if ($adminloggedin) { echo " "; } if (file_exists($infopage)) { include($infopage); } echo "
"; } function is_viewable($filename) { $retour=0; if(eregi("\.txt$|\.sql$|\.php$|\.php3$|\.phtml$|\.htm$|\.html$|\.cgi$|\.pl$|\.js$|\.css$|\.inc$",$filename)) {$retour=1;} return $retour; } function is_image($filename) { $retour=0; if(eregi("\.png$|\.bmp$|\.jpg$|\.jpeg$|\.gif$",$filename)) {$retour=1;} return $retour; } function is_browsable($filename) { $retour=0; if(eregi("\.zip$",$filename)) {$retour=1;} return $retour; } function taille($filename) { $taille=filesize($filename); if ($taille >= 1073741824) {$taille = round($taille / 1073741824 * 100) / 100 . " Gb";} elseif ($taille >= 1048576) {$taille = round($taille / 1048576 * 100) / 100 . " Mb";} elseif ($taille >= 1024) {$taille = round($taille / 1024 * 100) / 100 . " Kb";} else {$taille = $taille . " b";} if($taille==0) {$taille="-";} return $taille; } function unix_time() { global $timeoffset; $tmp = time() + 3600*$timeoffset; return $tmp; } function file_time($filename) { global $timeoffset; $tmp = filemtime($filename) + 3600*$timeoffset; return $tmp; } function DeleteFile($filename) { if (file_exists("$filename")) unlink("$filename"); // Delete file if (file_exists("$filename.desc")) {unlink("$filename.desc");} // Delete description if (file_exists("$filename.dlcnt")) {unlink("$filename.dlcnt");} // Delete download counter } function remove_old_files() { global $removefiles, $daysinhistory, $uploads_path; $time = 0; // Read timestamp (when system last time delete files) if (file_exists("$uploads_path/$$$.dlcnt")) { $fp=fopen("$uploads_path/$$$.dlcnt","r"); $time = fread($fp, 100); // read last scan date fclose($fp); } if (floor((time() - $time)/86400) >= 1) // If 1 day passed, then check & delete old files { $time = time(); // Remove all old files $handle=opendir($uploads_path); while ($filename = readdir($handle)) { if($filename!="." && $filename!="..") { if(!is_dir("$uploads_path/$filename")) { $file_modif_time=filemtime("$uploads_path/$filename"); if (floor(($time - $file_modif_time)/86400) >= $daysinhistory && $removefiles == 1) { DeleteFile("$uploads_path/$filename"); // Delete file & all auxiliary files } } } } closedir($handle); // Write new timestamp $fp = fopen("$uploads_path/$$$.dlcnt","w+"); // write counter file fwrite($fp, $time, 100); // write back fclose($fp); } } function DeleteFilesByList($list) { global $uploads_path; $list=str_replace("\x0D","",$list); $list=str_replace("\x0A",";",$list); $filenames=explode(";",$list); $i = 0; while ($i < count($filenames)) { if ($filenames[$i] != "") { DeleteFile("$uploads_path/" . $filenames[$i]); } $i++; } } function filedownloadcount($filename) { if (file_exists("$filename.dlcnt")) { $fp=fopen("$filename.dlcnt","r"); $count = fread($fp, 15); // read counter file fclose($fp); return $count; } else { return 0; } } function increasefiledownloadcount($filename) { if ($filename!="." && $filename!="..") { $count = filedownloadcount($filename); $count += 1; // number of downloads + 1 $fp = fopen("$filename.dlcnt","w+"); // write counter file @flock($fp, LOCK_EX); // Lock file in exclusive mode fwrite($fp, $count, 15); // write back @flock($fp, LOCK_UN); // Reset locking fclose($fp); } } function mimetype($filename) { global $mess,$HTTP_USER_AGENT; if(!eregi("MSIE",$HTTP_USER_AGENT)) {$client="netscape.gif";} else {$client="html.gif";} if(is_dir($filename)){$image="dossier.gif";} else if(eregi("\.txt$",$filename)){$image="txt.gif";} else if(eregi("\.html$",$filename)){$image=$client;} else if(eregi("\.htm$",$filename)){$image=$client;} else if(eregi("\.doc$",$filename)){$image="doc.gif";} else if(eregi("\.pdf$",$filename)){$image="pdf.gif";} else if(eregi("\.xls$",$filename)){$image="xls.gif";} else if(eregi("\.gif$",$filename)){$image="gif.gif";} else if(eregi("\.jpg$",$filename)){$image="jpg.gif";} else if(eregi("\.bmp$",$filename)){$image="bmp.gif";} else if(eregi("\.png$",$filename)){$image="gif.gif";} else if(eregi("\.zip$",$filename)){$image="zip.gif";} else if(eregi("\.rar$",$filename)){$image="rar.gif";} else if(eregi("\.gz$",$filename)){$image="zip.gif";} else if(eregi("\.tgz$",$filename)){$image="zip.gif";} else if(eregi("\.z$",$filename)){$image="zip.gif";} else if(eregi("\.exe$",$filename)){$image="exe.gif";} else if(eregi("\.mid$",$filename)){$image="mid.gif";} else if(eregi("\.wav$",$filename)){$image="wav.gif";} else if(eregi("\.mp3$",$filename)){$image="mp3.gif";} else if(eregi("\.avi$",$filename)){$image="avi.gif";} else if(eregi("\.mpg$",$filename)){$image="mpg.gif";} else if(eregi("\.mpeg$",$filename)){$image="mpg.gif";} else if(eregi("\.mov$",$filename)){$image="mov.gif";} else if(eregi("\.swf$",$filename)){$image="flash.gif";} else {$image="defaut.gif";} return $image; } function init($directory) { global $uploads_path,$direction,$mess,$font; if($directory==""){$current_dir=$uploads_path;} if($direction==""){$direction=1;} else { if($direction==1){$direction=0;}else{$direction=1;} } if($directory!=""){$current_dir="$uploads_path/$directory";} if(!file_exists($uploads_path)) {echo "The root path is not correct. Check the settings

$mess[29]
\n";exit;} if(!is_dir($current_dir)) {echo "$mess[30]

$mess[29]
\n";exit;} return $current_dir; } function assemble_tableaux($t1,$t2) { global $direction; $liste=""; if($direction==0) {$tab1=$t1; $tab2=$t2;} else {$tab1=$t2; $tab2=$t1;} if(is_array($tab1)) {while (list($cle,$val) = each($tab1)) {$liste[$cle]=$val;}} if(is_array($tab2)) {while (list($cle,$val) = each($tab2)) {$liste[$cle]=$val;}} return $liste; } function txt_vers_html($chaine) { $chaine=str_replace("&","&",$chaine); $chaine=str_replace("<","<",$chaine); $chaine=str_replace(">",">",$chaine); $chaine=str_replace("\"",""",$chaine); return $chaine; } function show_hidden_files($filename) { global $showhidden; $retour=1; if(substr($filename,0,1)=="." && $showhidden==0) {$retour=0;} return $retour; } function listing($current_dir) { global $direction,$order; $totalsize=0; $handle=opendir($current_dir); $list_dir = ""; $list_file = ""; while ($filename = readdir($handle)) { if($filename!="." && $filename!=".." && !eregi(".desc$", $filename) // Test for description && !eregi(".dlcnt$", $filename) // Test for download counter && show_hidden_files($filename)==1) { $filesize=filesize("$current_dir/$filename"); $totalsize+=$filesize; if(is_dir("$current_dir/$filename")) { // if($order=="mod") {$list_dir[$filename]=filemtime("$current_dir/$filename");} // else {$list_dir[$filename]=$filename;} } else { if($order=="nom") {$list_file[$filename]=mimetype("$current_dir/$filename");} else if($order=="taille") {$list_file[$filename]=$filesize;} else if($order=="mod") {$list_file[$filename]=filemtime("$current_dir/$filename");} else if($order=="rating") {$list_file[$filename]=filedownloadcount("$current_dir/$filename");} else {$list_file[$filename]=mimetype("$current_dir/$filename","image");} } } } closedir($handle); if(is_array($list_file)) { if($order=="nom") {if($direction==0){ksort($list_file);}else{krsort($list_file);}} else if($order=="mod") {if($direction==0){arsort($list_file);}else{asort($list_file);}} else if($order=="rating"||$order=="type") {if($direction==0){asort($list_file);}else{arsort($list_file);}} else {if($direction==0){ksort($list_file);}else{krsort($list_file);}} } // if(is_array($list_dir)) // { // if($order=="mod") {if($direction==0){arsort($list_dir);}else{asort($list_dir);}} // else {if($direction==0){ksort($list_dir);}else{krsort($list_dir);}} // } $liste=assemble_tableaux($list_dir,$list_file); if ($totalsize >= 1073741824) {$totalsize = round($totalsize / 1073741824 * 100) / 100 . " Gb";} elseif ($totalsize >= 1048576) {$totalsize = round($totalsize / 1048576 * 100) / 100 . " Mb";} elseif ($totalsize >= 1024) {$totalsize = round($totalsize / 1024 * 100) / 100 . " Kb";} else {$totalsize = $totalsize . " b";} return array($liste,$totalsize); } function contents_dir($current_dir) { global $font,$direction,$order,$directory,$totalsize,$mess,$tablecolor,$lightcolor; global $file_out_max_caracters,$showallfiles,$normalfontcolor; global $comment_max_caracters,$adminloggedin,$datetimeformat,$loginname,$password; $prev_currentdate = getdate(0); $day_passed = 0; // Read directory list($liste,$totalsize)=listing($current_dir); if(is_array($liste)) { while (list($filename,$mime) = each($liste)) { if(is_dir("$current_dir/$filename")) { $lien="index.php?direction=$direction&order=$order&directory="; if($directory!=""){$lien.="$directory/";} $lien.=$filename; $affiche_copier="non"; } else { $lien=""; if($directory!=""){$lien.="$directory/";} $lien.=$filename; $lien="javascript:popup('$lien')"; $affiche_copier="oui"; } $file_modif_time = file_time("$current_dir/$filename"); if($order=="mod") { $currentdate = getdate($file_modif_time); if (($currentdate['year'] != $prev_currentdate['year']) || ($currentdate['mon'] != $prev_currentdate['mon']) || ($currentdate['mday'] != $prev_currentdate['mday'])) { if (($day_passed == 1) && ($showallfiles == 0)) { // Print "Show all days message" echo "
$mess[44]
\n"; Break; } // Print day stamp $prev_currentdate = $currentdate; echo "
\n"; $month = $currentdate['mon']; $mday = $currentdate['mday']; $year = $currentdate['year']; echo "$mday / $mess[$month] / $year"; echo "
\n"; $day_passed+=1; } } echo "
\n"; if(is_viewable($filename) || is_image($filename) || is_browsable($filename) || is_dir("$current_dir/$filename")) {echo "";} echo substr($filename,0,$file_out_max_caracters); if(is_viewable($filename) || is_image($filename) || is_browsable($filename) || is_dir("$current_dir/$filename")) {echo "\n";} echo "
"; if ($adminloggedin) // If logged as admin, add delete file link { echo "  \"$mess[52]\""; echo "  \"$mess[54]\""; } echo " \"$mess[23]\""; echo filedownloadcount("$current_dir/$filename"); echo "
\n"; echo taille("$current_dir/$filename"); echo "
\n"; echo date($datetimeformat, $file_modif_time); echo "

\n"; // Load description if (file_exists("$current_dir/$filename.desc")) { $fp=fopen("$current_dir/$filename.desc","r"); $contents = fread ($fp, $comment_max_caracters); // read first 300 bytes fclose($fp); # $contents=str_replace("&","&",$contents); # $contents=str_replace("<","<",$contents); # $contents=str_replace(">",">",$contents); # $contents=str_replace("\"",""",$contents); $contents=str_replace("\x0D","",$contents); $contents=str_replace("\x0A"," ",$contents); echo $contents; } echo "

\n"; } } } function list_dir($current_dir) { global $directory,$url_path,$uploads_path,$mess,$direction; global $font,$order,$totalsize,$tablecolor,$headercolor,$backgrcolor; global $headerfontcolor, $normalfontcolor; if(eregi("\.\.",$directory)) {$directory="";} $current_dir=init($directory); //$base_nom_rep=str_replace($uploads_path,"",$current_dir); //if($base_nom_rep==""){$base_nom_rep="/";} if($direction==1){$direction=0;}else{$direction=1;} if($direction==1){$direction=0;}else{$direction=1;} echo "\n"; $lien = ""; if($directory!=""){$lien="&directory=".$directory;} echo " \n"; if($direction==1){$direction=0;}else{$direction=1;} if($directory!="") { $nom=dirname($directory); echo "\n"; } contents_dir($current_dir); echo "
$mess[15] \n"; if ($order=="nom"||$order=="") {echo "\"$mess[24]\"\n";} else {echo "\"$mess[24]\"\n";} echo "
$mess[16]\n"; if ($order=="rating") {echo "\"$mess[24]\"\n";} else {echo "\"$mess[24]\"\n";} echo "
$mess[17]\n"; if ($order=="taille") {echo "\"$mess[24]\"\n";} else {echo "\"$mess[24]\"\n";} echo "
$mess[18]\n"; if ($order=="mod") {echo "\"$mess[24]\"\n";} else {echo "\"$mess[24]\"\n";} echo "
$mess[24]    
$mess[43]: $totalsize
\n"; } function deldir($location) { if(is_dir($location)) { $all=opendir($location); while ($file=readdir($all)) { if (is_dir("$location/$file") && $file !=".." && $file!=".") { deldir("$location/$file"); if(file_exists("$location/$file")){rmdir("$location/$file"); } unset($file); } elseif (!is_dir("$location/$file")) { if(file_exists("$location/$file")){unlink("$location/$file"); } unset($file); } } closedir($all); rmdir($location); } else { if(file_exists("$location")) {unlink("$location");} } } function normalize_nom_filename($nom) { global $file_name_max_caracters; $nom=stripslashes($nom); $nom=str_replace("'","",$nom); $nom=str_replace("\"","",$nom); $nom=str_replace("\"","",$nom); $nom=str_replace("&","",$nom); $nom=str_replace(",","",$nom); $nom=str_replace(";","",$nom); $nom=str_replace("/","",$nom); $nom=str_replace("\\","",$nom); $nom=str_replace("`","",$nom); $nom=str_replace("<","",$nom); $nom=str_replace(">","",$nom); $nom=str_replace(":","",$nom); $nom=str_replace("*","",$nom); $nom=str_replace("|","",$nom); $nom=str_replace("?","",$nom); $nom=str_replace("§","",$nom); $nom=str_replace("+","",$nom); $nom=str_replace("^","",$nom); $nom=str_replace("(","",$nom); $nom=str_replace(")","",$nom); $nom=str_replace("=","",$nom); $nom=str_replace("$","",$nom); $nom=str_replace("%","",$nom); $nom = substr ($nom,0,$file_name_max_caracters); return $nom; } //---------------------------------------------------------------------------- // Shows complete page //---------------------------------------------------------------------------- function show_desc($filename) { global $current_dir,$directory,$url_path,$uploads_path,$mess,$direction; global $order,$totalsize,$font,$tablecolor,$backgrcolor,$headercolor,$showallfiles; global $headerfontcolor,$normalfontcolor,$adminloggedin,$loginname,$password; global $comment_max_caracters; // Load description if (file_exists("$uploads_path/$filename.desc")) { $fp=fopen("$uploads_path/$filename.desc","r"); $contents = fread ($fp, $comment_max_caracters); // read first 300 bytes fclose($fp); $contents=str_replace("\x0D","",$contents); $contents=str_replace("\x0A"," ",$contents); } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
$mess[54]: $filename
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
$mess[22]\n"; echo " \n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; } //---------------------------------------------------------------------------- // Shows complete page //---------------------------------------------------------------------------- function show_contents() { global $current_dir,$directory,$url_path,$uploads_path,$mess,$direction; global $order,$totalsize,$font,$tablecolor,$backgrcolor,$headercolor,$showallfiles; global $headerfontcolor,$normalfontcolor,$adminloggedin,$loginname,$password; list_dir($current_dir); if ($adminloggedin) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
$mess[20]
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
$mess[21]\n"; echo " \n"; echo "
$mess[22]\n"; echo " \n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
$mess[51]
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo "\n"; } } //---------------------------------------------------------------------------- // MAIN //---------------------------------------------------------------------------- header("Expires: Mon, 03 Jan 2000 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); include("include/conf.php"); $adminloggedin = 0; if (!isset($loginname)) $loginname = ""; if (!isset($password)) $password = ""; if (!isset($language)) $language = ""; if (!isset($order)) $order = ""; if (!isset($action)) $action = ""; if (!isset($showallfiles)) $showallfiles = 0; // Show only files for last day if (!isset($current_dir)) $current_dir = ""; if($language=="") {$language=$dft_language;} if ($order=="") {$order="mod";} switch($action) { //---------------------------------------------------------------------------- // Administrator LogIn //---------------------------------------------------------------------------- case "adminlogin"; require("include/${language}.php"); $adminloggedin = verify_admin($loginname, $password); include($headerpage); if ($adminloggedin) { place_header("Ha accedido como $loginname correctamente."); } else { place_header("Error: no puede acceder como $loginname."); } show_contents(); break; //---------------------------------------------------------------------------- // Delete files //---------------------------------------------------------------------------- case "deletefiles"; require("include/${language}.php"); $adminloggedin = verify_admin($loginname, $password); include($headerpage); if ($adminloggedin) { DeleteFilesByList($FileList); place_header("$loginname: archivos eliminados con éxito."); } else { place_header("$loginname: no se han podido eliminar los archivos - cuenta no válida."); } show_contents(); break; //---------------------------------------------------------------------------- // Change Language //---------------------------------------------------------------------------- case "savelanguage"; $language=$HTTP_GET_VARS["language"]; setcookie("language",$language,time()+31536000); // 1 year require("include/${language}.php"); include($headerpage); place_header($mess[41]); show_contents(); break; //---------------------------------------------------------------------------- // DOWNLOAD //---------------------------------------------------------------------------- case "downloadfile"; require("include/${language}.php"); $Nomfilename = basename($filename); $taille=filesize("$uploads_path/$filename"); increasefiledownloadcount("$uploads_path/$filename"); header("Content-Type: application/force-download; name=\"$Nomfilename\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: $taille"); header("Content-Disposition: attachment; filename=\"$Nomfilename\""); header("Expires: 0"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); readfile("$uploads_path/$filename"); exit(); break; //---------------------------------------------------------------------------- // EDIT DESCRIPTION //---------------------------------------------------------------------------- case "editdesc"; require("include/${language}.php"); $adminloggedin = verify_admin($loginname, $password); $nomdufilename=basename($filename); // Save description if (strlen($description)!=0) { $fp=fopen("$uploads_path/$nomdufilename.desc","w"); fputs ($fp,$description); fclose($fp); } include($headerpage); place_header($mess[56]); show_contents(); include($footerpage); exit(); break; //---------------------------------------------------------------------------- // SHOW DESCRIPTION //---------------------------------------------------------------------------- case "showdesc"; require("include/${language}.php"); $nomdufilename=basename($filename); include($headerpage); show_desc($nomdufilename); include($footerpage); exit(); break; //---------------------------------------------------------------------------- // VIEW & PRINT //---------------------------------------------------------------------------- case "view"; require("include/${language}.php"); $nomdufilename=basename($filename); echo "\n"; echo "$mess[26] : ".$nomdufilename."\n"; $fp=@fopen("$headerpage","r"); if($fp) { while(!feof($fp)) { $buffer=fgets($fp,4096); if(eregi("","",$val); $val=str_replace(CHR(10),"",$val); $val=str_replace(CHR(13),"",$val); echo "<$val onload=\"self.focus()\">\n"; } } break; } } fclose($fp); } echo "

$mess[26] : "; echo "\n"; echo "".$nomdufilename."




\n"; echo "\"$mess[27]\"\n"; echo "\"$mess[28]\"\n"; echo "
\n"; echo "

"; if(!is_image($filename)) { echo "
\n"; if (is_browsable($filename)) { list_zip("$uploads_path/$filename"); } else { $fp=@fopen("$uploads_path/$filename","r"); if($fp) { echo "

\n"; while(!feof($fp)) { $buffer=fgets($fp,4096); $buffer=txt_vers_html($buffer); $buffer=str_replace("\t","     ",$buffer); echo $buffer."
"; } fclose($fp); echo "

\n"; } else { echo "

$mess[31] : $uploads_path/$filename

"; } } echo "
\n"; } else { echo "\n"; } echo "
\n"; echo "\"$mess[27]\"\n"; echo "\"$mess[28]\"\n"; echo "
\n"; echo "\n"; echo "\n"; exit; break; //---------------------------------------------------------------------------- // UPLOAD //---------------------------------------------------------------------------- case "upload"; require("include/${language}.php"); $message = $mess[40]; $directory_source="/$directory"; $destination=$uploads_path.$directory_source; if ($userfile_size!=0) {$size_kb=$userfile_size/1024;} else {$size_kb=0;} if ($userfile=="none") {$message=$mess[34];} if ($userfile!="none" && $userfile_size!=0) { $userfile_name=normalize_nom_filename($userfile_name); // Try if file exists if (file_exists("$destination/$userfile_name") || // Or file is script eregi($rejectedfiles, $userfile_name) || ($size_kb > $maxalowedfilesize)) { if ($size_kb > $maxalowedfilesize) { $message="$mess[38] $userfile_name $mess[50] ($maxalowedfilesize Kb)!"; } else if (eregi($rejectedfiles, $userfile_name)) // If file is script { $message="$mess[49] $userfile_name !"; } else { $message="$mess[38] $userfile_name $mess[39]"; } } else { // Save description if (strlen($description)!=0) { $fp=fopen("$destination/$userfile_name.desc","w"); fputs ($fp,$description); fclose($fp); } if (!move_uploaded_file($userfile, "$destination/$userfile_name")) // if (!copy($userfile, "$destination/$userfile_name")) { $message="$mess[33] $userfile_name"; } else { $message="$mess[36] $userfile_name $mess[37]"; } } } include($headerpage); place_header($message); show_contents(); break; //---------------------------------------------------------------------------- // DEFAULT //---------------------------------------------------------------------------- default; require("include/${language}.php"); remove_old_files(); include($headerpage); show_contents(); break; } include($footerpage); ?>