begin process at 2012 02 13 07:42:36
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application

 > PHPMYEXPLORER(ZIP,TELECHARGEMENT,REPRISE... (MAJ)

PHPMYEXPLORER(ZIP,TELECHARGEMENT,REPRISE... (MAJ)


 Information sur la source

Note :
Aucune note
Catégorie :Application Niveau :Initié Date de création :05/02/2003 Date de mise à jour :17/09/2003 22:57:10 Vu / téléchargé :8 907 / 344

Auteur : Magicking

Ecrire un message privé
Site perso
Commentaire sur cette source (9)
Ajouter un commentaire et/ou une note

 Description

C'est un explorateur qui marche sur un serveur windows sous Linux je pense pas a cause des \\ pour les dossiers mais il se peut que votre script ne veuille pas envoyer les header(php.ini)

Y vous faut une table qui s'appele phpexplorer aves comme champs
Pseudo,Password,rang,up,dl,ef,favori
String Pseudo
Password Password
Int rang
Int up
Int dl
Int ef
String favori  

Source

  • <?
  • class zipfile
  • {
  • /**
  • * Array to store compressed data
  • *
  • * @var array $datasec
  • */
  • var $datasec = array();
  • /**
  • * Central directory
  • *
  • * @var array $ctrl_dir
  • */
  • var $ctrl_dir = array();
  • /**
  • * End of central directory record
  • *
  • * @var string $eof_ctrl_dir
  • */
  • var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
  • /**
  • * Last offset position
  • *
  • * @var integer $old_offset
  • */
  • var $old_offset = 0;
  • /**
  • * Converts an Unix timestamp to a four byte DOS date and time format (date
  • * in high two bytes, time in low two bytes allowing magnitude comparison).
  • *
  • * @param integer the current Unix timestamp
  • *
  • * @return integer the current date in a four byte DOS format
  • *
  • * @access private
  • */
  • function unix2DosTime($unixtime = 0) {
  • $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
  • if (1) {
  • $timearray['year'] = 2000;
  • $timearray['mon'] = 1;
  • $timearray['mday'] = 1;
  • $timearray['hours'] = 0;
  • $timearray['minutes'] = 0;
  • $timearray['seconds'] = 0;
  • } // end if
  • return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
  • ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
  • } // end of the 'unix2DosTime()' method
  • /**
  • * Adds "file" to archive
  • *
  • * @param string file contents
  • * @param string name of the file in the archive (may contains the path)
  • * @param integer the current timestamp
  • *
  • * @access public
  • */
  • function addFile($data, $name, $time = 0)
  • {
  • $name = str_replace('\\', '/', $name);
  • $dtime = dechex($this->unix2DosTime($time));
  • $hexdtime = '\x' . $dtime[6] . $dtime[7]
  • . '\x' . $dtime[4] . $dtime[5]
  • . '\x' . $dtime[2] . $dtime[3]
  • . '\x' . $dtime[0] . $dtime[1];
  • eval('$hexdtime = "' . $hexdtime . '";');
  • $fr = "\x50\x4b\x03\x04";
  • $fr .= "\x14\x00"; // ver needed to extract
  • $fr .= "\x00\x00"; // gen purpose bit flag
  • $fr .= "\x08\x00"; // compression method
  • $fr .= $hexdtime; // last mod time and date
  • // "local file header" segment
  • $unc_len = strlen($data);
  • $crc = crc32($data);
  • $zdata = gzcompress($data,0);
  • $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
  • $c_len = strlen($zdata);
  • $fr .= pack('V', $crc); // crc32
  • $fr .= pack('V', $c_len); // compressed filesize
  • $fr .= pack('V', $unc_len); // uncompressed filesize
  • $fr .= pack('v', strlen($name)); // length of filename
  • $fr .= pack('v', 0); // extra field length
  • $fr .= $name;
  • // "file data" segment
  • $fr .= $zdata;
  • // "data descriptor" segment (optional but necessary if archive is not
  • // served as file)
  • $fr .= pack('V', $crc); // crc32
  • $fr .= pack('V', $c_len); // compressed filesize
  • $fr .= pack('V', $unc_len); // uncompressed filesize
  • // add this entry to array
  • $this -> datasec[] = $fr;
  • $new_offset = strlen(implode('', $this->datasec));
  • // now add to central directory record
  • $cdrec = "\x50\x4b\x01\x02";
  • $cdrec .= "\x00\x00"; // version made by
  • $cdrec .= "\x14\x00"; // version needed to extract
  • $cdrec .= "\x00\x00"; // gen purpose bit flag
  • $cdrec .= "\x08\x00"; // compression method
  • $cdrec .= $hexdtime; // last mod time & date
  • $cdrec .= pack('V', $crc); // crc32
  • $cdrec .= pack('V', $c_len); // compressed filesize
  • $cdrec .= pack('V', $unc_len); // uncompressed filesize
  • $cdrec .= pack('v', strlen($name) ); // length of filename
  • $cdrec .= pack('v', 0 ); // extra field length
  • $cdrec .= pack('v', 0 ); // file comment length
  • $cdrec .= pack('v', 0 ); // disk number start
  • $cdrec .= pack('v', 0 ); // internal file attributes
  • $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set
  • $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
  • $this -> old_offset = $new_offset;
  • $cdrec .= $name;
  • // optional extra field, file comment goes here
  • // save to central directory
  • $this -> ctrl_dir[] = $cdrec;
  • } // end of the 'addFile()' method
  • /**
  • * Dumps out file
  • *
  • * @return string the zipped file
  • *
  • * @access public
  • */
  • function file()
  • {
  • $data = implode('', $this -> datasec);
  • $ctrldir = implode('', $this -> ctrl_dir);
  • return
  • $data .
  • $ctrldir .
  • $this -> eof_ctrl_dir .
  • pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
  • pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall
  • pack('V', strlen($ctrldir)) . // size of central dir
  • pack('V', strlen($data)) . // offset to start of central dir
  • "\x00\x00"; // .zip file comment length
  • } // end of the 'file()' method
  • } // end of the 'zipfile' class
  • $dos=realpath($dos);
  • $mylogin="root";
  • $mypass="";
  • if($logout=="done") {
  • $pseudo="";
  • $password="";
  • setcookie("pseudo","");
  • setcookie("password","");
  • header("Location: http://$HTTP_HOST/?dos=D:\\");
  • exit;
  • }
  • if(@mysql_connect("127.0.0.1",$mylogin,$mypass)) {
  • @mysql_select_db("tout");
  • $row=mysql_fetch_array(mysql_query("SELECT count(*) FROM `phpexplorer` WHERE `Pseudo`='$pseudo' AND `Password`=PASSWORD('$password')"));
  • if($row[0]=="0") {
  • ?>
  • <html>
  • <head>
  • <title>Login</title>
  • </head>
  • <body bgcolor="#000000" text="#FFFFFF">
  • <form name="connect" method="post">
  • <table align="center">
  • <tr bgcolor="#1F76A1">
  • <td>
  • <p>User Name</p>
  • </td>
  • <td>
  • <p><input type="text" name="pseudo" value="anonymous"
  • size="13" style="color:white; background-color:rgb(31,118,161); border-style:none;"
  • maxlength="15" OnClick="if(this.value=='anonymous') this.value=''"></p>
  • </td>
  • </tr>
  • <tr bgcolor="#CCCCCC">
  • <td>
  • <p>Password</p>
  • </td>
  • <td>
  • <p><input type="password" name="password" value="anonymous" style="color:white; background-color:rgb(204,204,204); border-style:none;"
  • maxlength="20" size="13"></p>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <p></p>
  • </td>
  • <td>
  • <p><input type="submit" name="Button" value=" "
  • style="background-image:url('login.gif'); background-repeat:no-repeat; background-attachment:fixed; border-style:none; background-position:0 0;"
  • onclick="document.connect.pseudo.focus();" onfocus="document.connect.pseudo.focus();"></p>
  • </td>
  • </tr>
  • </table>
  • </form>
  • <script>
  • document.connect.pseudo.focus();
  • </script>
  • </body>
  • </html>
  • <?
  • exit;
  • unset($row);
  • @mysql_close();
  • } else {
  • setcookie("pseudo","");
  • setcookie("password","");
  • }
  • }
  • $rang=0;
  • setcookie("pseudo",$pseudo,time()+3600);
  • setcookie("password",$password,time()+3600);
  • if($pseudo!="" && $password!="") {
  • @mysql_connect("127.0.0.1",$mylogin,$mypass);
  • @mysql_select_db("tout");
  • if(isset($fav)) {
  • if($fav=="!del") { $fav=""; }
  • mysql_query("UPDATE `phpexplorer` SET `favori`='$fav' WHERE `Pseudo`='$pseudo'");
  • }
  • $row=mysql_fetch_array(mysql_query("SELECT `rang`,`up`,`dl`,`ef`,`favori` FROM `phpexplorer` WHERE `Pseudo`='$pseudo' AND `Password`=PASSWORD('$password')"));
  • if($row[0]=="") { $rang=0; }
  • if(isset($row[0])) { $rang=$row[0]; }
  • $up=$row[1];
  • $dl=$row[2];
  • $ef=$row[3];
  • $favorie["DOS"]=$row[4];
  • if($favorie["DOS"]==""){
  • $favorie["NAME"]="<a href=\"?fav=$dos&dos=$dos\">Ajouter</a>";
  • }
  • if(strlen(str_replace("\\","",$favorie["DOS"]))!=2 && strlen(str_replace("\\","",$favorie["DOS"]))!=0){
  • $favorie["T"]=strrev(substr( strrev($favorie["DOS"]), 0, strpos(strrev($favorie["DOS"]),"\\") ));
  • if(strlen($favorie["T"])>13) {
  • $favorie["T"]=substr($favorie["T"],0,13);
  • }
  • $favorie["NAME"]="<a href=\"?dos=$favorie[DOS]\">$favorie[T]</a> <a href=\"?fav=!del&dos=$dos\">Sup</a>";
  • }
  • if(strlen(str_replace("\\","",$favorie["DOS"]))==2) {
  • $favorie["T"].=str_replace("\\\\","\\",$favorie["DOS"]);
  • $favorie["NAME"]="<a href=\"?dos=$favorie[DOS]\">$favorie[T]</a> <a href=\"?fav=!del&dos=$dos\">Sup</a>";
  • }
  • }
  • function erase($path) {
  • $rep=opendir($path);
  • while($lire = readdir($rep)) {
  • if ($lire!="." && $lire!="..") { $liredos=$path.$lire."\\";
  • if (is_dir($liredos)) {
  • erase($liredos);
  • } else {
  • unlink($liredos);
  • }
  • }
  • }
  • closedir($rep);
  • rmdir($path);
  • }
  • function addfil($content,&$zipfile,$originalrep){
  • $dump_buffer="";
  • $nameinzip="";
  • $content = realpath($content);
  • if(is_file($content)) {
  • $nameinzip=explode("\\",$content);
  • $nameinzip=$nameinzip[(sizeof($nameinzip)-1)];
  • if($fd = @fopen($content,"rb")) {
  • while(!feof($fd)) {
  • $dump_buffer.=fread($fd,4096);
  • }
  • if($originalrep==$nameinzip) { $originalrep=""; }
  • $zipfile -> addFile($dump_buffer,"PhpMyExplorer\\$originalrep$nameinzip");
  • fclose($fd);
  • }
  • }
  • if(is_dir("$content\\")){
  • $rep=opendir("$content\\");
  • while($lire = readdir($rep)) {
  • if ($lire!="." && $lire!="..") {
  • $liredos="$content\\$lire";
  • if (is_file("$liredos")){
  • if($originalrep!="" && substr($originalrep,strlen($originalrep)-1,strlen($originalrep))!="\\") { $originalrep.="\\"; }
  • addfil($liredos,&$zipfile,"$originalrep");
  • } else if (is_dir("$liredos\\")) {
  • if($originalrep!="" && substr($originalrep,strlen($originalrep)-1,strlen($originalrep))!="\\") { $originalrep.="\\"; }
  • addfil("$liredos",&$zipfile,"$originalrep$lire");
  • }
  • }
  • }
  • closedir($rep);
  • }
  • }
  • function getmicro() {
  • list($msec,$sec)=explode(" ",microtime());
  • return ($msec+$sec);
  • }
  • $DebutTime = getmicro();
  • /*
  • Pour les disques mettre chaque disque sous cette forme :
  • $Disk[0]="A:\\|di"; Pour la disquette [di est pour l'image de la disquette]
  • $Disk[1]="C:\\|DU"; Pour un disque dur [DU est pour l'image du disque dur]
  • $Disk[2]="E:\\|cd";
  • */
  • $adminmail="magicking@altern.org";
  • $Disk[0]="A:\\|di";
  • $Disk[1]="C:\\|dU";
  • $Disk[2]="D:\\|dU";
  • $Disk[3]="E:\\|cd";
  • $currentcolor="#1F76A1";
  • $tablecolor="#003666";
  • $colortext="#FFFFFF";
  • $max=20;
  • clearstatcache();
  • if(isset($Efface) && $rang!=0) {
  • $IEffassage=-1;
  • if(!(isset($lEffassage))) { $lEffassage=0; }
  • while($IEffassage<$lEffassage) {
  • $IEffassage++;
  • if($Effassage[$IEffassage]!="") {
  • $Effassage[$IEffassage]=str_replace(":p","+",$Effassage[$IEffassage]);
  • $Effassage[$IEffassage]=realpath($Effassage[$IEffassage]);
  • if(is_dir($Effassage[$IEffassage]."\\")) {
  • erase($Effassage[$IEffassage]."\\");
  • }
  • if(file_exists($Effassage[$IEffassage])) {
  • @unlink($Effassage[$IEffassage]);
  • }
  • $ef++;
  • }
  • }
  • mysql_query("UPDATE `phpexplorer` SET `ef`='$ef' WHERE `Pseudo`='$pseudo'");
  • }
  • $dos=str_replace(":p","+",$dos);
  • if($rang==1) {
  • $configname="phpexploreconfig";
  • if(isset($Sender)) {
  • @copy($uploader, "$dos\\$uploader_name");
  • $row[1]++;
  • mysql_query("UPDATE `phpexplorer` SET `up`='$row[1]' WHERE `Pseudo`='$pseudo'");
  • }
  • if(file_exists($dos."\\".$configname)) {
  • $Access=strrev(substr(strrev($Access),strpos(strrev($Access),"\\"),strlen($Access)));
  • if($Access = @fopen($dos."\\".$configname,"r")) {
  • while (!feof ($Access)) { $Config =$Config.@fgets($Access,1024); }
  • $Config=substr($Config,strpos($Config,"Allow")+6,strlen($Config));
  • $Config=explode(",",$Config);
  • $IConfig=0;
  • $Ip=explode(".",$REMOTE_ADDR);
  • while($IConfig<sizeof($Config)) {
  • unset($ConfigT);
  • $IConfigT=0;
  • $ConfigT=explode(".",$Config[$IConfig]);
  • while($IConfigT<sizeof($ConfigT)) {
  • $Configg=$ConfigT[$IConfigT];
  • $Ipp=$Ip[$IConfigT];
  • if($Configg!=$Ipp) { if($Configg!="*") { die("Forbidden "); } }
  • $IConfigT++;
  • }
  • $IConfig++;
  • }
  • }
  • }
  • }
  • if(isset($Mdos) && $rang!=0) {
  • if(!(is_dir($dos.$Mdos))) {
  • @mkdir($dos."\\".$Mdos,0700);
  • }
  • }
  • if(!(isset($zip))){
  • if( $dir = @opendir($dos . "\\") )
  • {
  • $CD=0;
  • $taille=0;
  • $irep=0;
  • $ifile=0;
  • $version="1.0";
  • $lEffassage=0;
  • echo "<html>\n\n<head>\n<title>Php My Explorer - $version</title>\n<style type=\"text/css\">\nA {\n text-decoration: none;\n}\nA.dossier {\n color: #FFFFFF;\n text-decoration: none;\n}\n\nA.file {\n color: #323240;\n text-decoration: none;\n}\n\n}\n</style>\n<script src=\"fade.js\" language=\"Javascript\"></script>";
  • ?>
  • <script language="JavaScript">
  • <!--
  • function init_float_layers()
  • {
  • var name;
  • var layer;
  • var i;
  • var j;
  • j = 0;
  • document._float_layers = new Array(Math.max(1, init_float_layers.arguments.length/2));
  • for (i = 0; i < init_float_layers.arguments.length; i += 2) {
  • name = init_float_layers.arguments[i];
  • if (name == '')
  • return;
  • if (navigator.appName.indexOf('Netscape', 0) != -1) {
  • layer = document.layers[name];
  • layer._fl_pos_left = layer.left;
  • layer._fl_pos_top = layer.top;
  • } else {
  • layer = document.all[name];
  • layer._fl_pos_left = layer.style.pixelLeft;
  • layer._fl_pos_top = layer.style.pixelTop;
  • }
  • layer._fl_pos = init_float_layers.arguments[i+1];
  • if (layer)
  • document._float_layers[j++] = layer;
  • }
  • document._fl_interval = setInterval('process_float_layers()', 200);
  • }
  • function page_width()
  • {
  • return (navigator.appName.indexOf('Netscape', 0) != -1) ? innerWidth : document.body.clientWidth;
  • }
  • function page_height()
  • {
  • return (navigator.appName.indexOf('Netscape', 0) != -1) ? innerHeight : document.body.clientHeight;
  • }
  • function process_float_layers()
  • {
  • if (document._float_layers) {
  • var i;
  • var layer;
  • for (i = 0; i < document._float_layers.length; i++) {
  • layer = document._float_layers[i];
  • if (navigator.appName.indexOf('Netscape', 0) != -1) {
  • if (layer._fl_pos == 1)
  • layer.left = layer._fl_pos_left + window.pageXOffset;
  • else if (layer._fl_pos == 2 || layer._fl_pos == 5)
  • layer.left = window.pageXOffset;
  • else if (layer._fl_pos == 3 || layer._fl_pos == 6)
  • layer.left = window.pageXOffset + (page_width() - layer.clip.width)/2;
  • else
  • layer.left = window.pageXOffset + page_width() - layer.clip.width - 16;
  • if (layer._fl_pos == 1)
  • layer.top = layer._fl_pos_top + window.pageYOffset;
  • else if (layer._fl_pos == 2 || layer._fl_pos == 3 || layer._fl_pos == 4)
  • layer.top = window.pageYOffset;
  • else
  • layer.top = window.pageYOffset + page_height() - layer.clip.height;
  • } else {
  • if (layer._fl_pos == 1)
  • layer.style.pixelLeft = layer._fl_pos_left + document.body.scrollLeft;
  • else if (layer._fl_pos == 2 || layer._fl_pos == 5)
  • layer.style.pixelLeft = document.body.scrollLeft;
  • else if (layer._fl_pos == 3 || layer._fl_pos == 6)
  • layer.style.pixelLeft = document.body.scrollLeft + (page_width() - layer.style.pixelWidth)/2;
  • else
  • layer.style.pixelLeft = document.body.scrollLeft + page_width() - layer.style.pixelWidth;
  • if (layer._fl_pos == 1)
  • layer.style.pixelTop = layer._fl_pos_top + document.body.scrollTop;
  • else if (layer._fl_pos == 2 || layer._fl_pos == 3 || layer._fl_pos == 4)
  • layer.style.pixelTop = document.body.scrollTop;
  • else
  • layer.style.pixelTop = document.body.scrollTop + page_height() - layer.style.pixelHeight;
  • }
  • }
  • }
  • }
  • // -->
  • </script>
  • <?
  • echo "</head>\n<body bgcolor=\"#000000\" text=\"white\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FFFFFF\" OnLoad=\"init_float_layers('Stat', 2);\">\n<div id=\"Stat\" style=\"filter:alpha(opacity=50); -moz-opacity:50%; position:absolute; left:0px; top:0px;\"><table border=1 bordercolor=blue bordercolordark=blue bordercolorlight=blue><tr><td style=background-color:648CB4;><table cellpadding=0 cellspacing=0><tr>
  • <td width=\"50\"><p>Pseudo</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$pseudo</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>Upload</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$up</p></td><td width=\"50\"><p>Download</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$dl</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>Effacement</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$ef</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\">Favorie</td><td><font style=\"color:648CB4;\"> . </font></td><td>$favorie[NAME]</td><td><font style=\"color:648CB4;\"> . </font></td><td><font style=\"color:648CB4;\"> . </font></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><a href=\"?logout=done\" class=\"nofade\">Logout</a></td></tr></table></td></tr></table></div>
  • \n<p align=\"center\">Vous étes dans $dos</p>\n<br><br><br>\n<div align=\"center\"><form method=POST action=\"\"><table border=\"0\">\n<tr bgcolor=\"$tablecolor\">\n<td>\n<p>File</p>\n</td>\n<td>\n<p>Size</p>\n</td>\n<td><p>Crée le</p>\n</td>\n<td>\n<p>Dernière modification</p>\n</td>\n<td>\n<p>Accédé le</p>\n</td>\n</tr>\n";
  • while( $sub_dir = @readdir($dir) )
  • {
  • while (list($unused,$disk)=each($Disk)) {
  • $disk=explode("|",$disk);
  • if(@opendir($disk[0])) {
  • echo "<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$disk[0]\"><img src=\"$disk[1].gif\" border=\"0\"></a><br></p>\n</td>\n<td>\n<p>Disque $disk[0]</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n</tr>\n";
  • }
  • $CD++;
  • }
  • if($sub_dir!=".") {
  • if($sub_dir=="..") {
  • $edos=str_replace("+",":p",$dos);
  • echo "<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$edos\\..\\\"><img src=\"up.gif\" border=\"0\"></a><br></p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n</tr>\n";
  • }
  • if(!($sub_dir=="..")) {
  • if (file_exists($dos)){
  • $sizeofFF=filesize("$dos\\$sub_dir");
  • if($sizeofFF=="0") {
  • if($dirt=is_dir("$dos\\$sub_dir\\"))
  • {
  • $sizeofFF="-";
  • } else {
  • $sizeofFF="0";
  • }
  • } else {
  • if($sizeofFF>1024) {
  • $taille++;
  • $sizeofFF=$sizeofFF/1024; //Conversion en KO
  • }
  • if($sizeofFF>1024) {
  • $taille++;
  • $sizeofFF=$sizeofFF/1024; //Conversion en MO
  • }
  • if($sizeofFF>1000) {
  • $taille++;
  • $sizeofFF=$sizeofFF/1000; //conversion GO
  • }
  • if(strpos($sizeofFF,".")) {
  • $sizeofFF=substr($sizeofFF,0,strpos($sizeofFF,"."));
  • }
  • }
  • }
  • switch($taille) {
  • case '0':
  • if(!($sizeofFF=="-")) {
  • $addon="Octets";
  • if($sizeofFF<2) { $addon="Octet"; }
  • }
  • $taille=0;
  • break;
  • case '1':
  • $addon="KO";
  • $taille=0;
  • break;
  • case '2':
  • $addon="MO";
  • $taille=0;
  • break;
  • case '3':
  • $addon="GO";
  • $taille=0;
  • break;
  • }
  • $dos=str_replace("\\\\","\\",$dos);
  • if(is_dir("$dos\\$sub_dir\\")) {
  • $Creation=@date("d/m/y",fileatime("$dos\\$sub_dir\\"));
  • $colortext="#FFFFFF";
  • $currentcolor="#1F76A1";
  • $esub_dir=$sub_dir;
  • $sub_dir=str_replace("+",":p",$sub_dir);
  • $dos=str_replace("+",":p",$dos);
  • if(strlen($esub_dir)>$max) { $esub_dir=substr($esub_dir,0,$max)."..."; }
  • $rep[strtolower(str_replace(" ","",$esub_dir))]="<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$dos\\$sub_dir\" class=\"dossier\">$esub_dir</a><br></p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td><p>$Creation</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td whidth=\"1\"><input type=\"checkbox\" name=\"Effassage[$lEffassage]\" value=\"$dos\\$sub_dir\"></td>\n</tr>\n";
  • }
  • if(is_file("$dos\\$sub_dir")) {
  • $Creation=@date("d/m/y",fileatime("$dos\\$sub_dir"));
  • $colortext="#000066";
  • $currentcolor="#CCCCCC";
  • $esub_dir=$sub_dir;
  • $sub_dir=str_replace("+",":p",$sub_dir);
  • $dos=str_replace("+",":p",$dos);
  • if(strlen($esub_dir)>$max) { $esub_dir=substr($esub_dir,0,$max)."(.".strrev(substr(strrev($esub_dir),0,strrev(strpos(strrev($esub_dir),".")))).")"; }
  • $Filectime=@date("d/m/y",filemtime("$dos\\$sub_dir"));
  • $Accedation=@date("d/m/y",fileatime("$dos\\$sub_dir"));
  • if($Filectime=="") { $Filectime="-"; }
  • $file[strtolower($esub_dir)]="<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$dos\\$sub_dir\" class=\"file\">$esub_dir</a><br></p>\n</td>\n<td>\n<p>$sizeofFF $addon</p>\n</td>\n<td>\n<p>$Creation</p>\n</td>\n<td>\n<p>$Filectime</p>\n</td>\n<td>\n<p>$Accedation</p>\n</td>\n<td whidth=\"1\"><input type=\"checkbox\" name=\"Effassage[$lEffassage]\" value=\"$dos\\$sub_dir\"></td>\n</tr>\n";
  • }
  • $lEffassage++;
  • $addon="";
  • }
  • }
  • }
  • if(is_array($rep)) {
  • ksort($rep);
  • reset($rep);
  • while (list($brep,$irep)=each($rep)) {
  • echo $irep;
  • }
  • }
  • if(is_array($file)) {
  • ksort($file);
  • reset($file);
  • while (list($bfile,$ifile)=each($file)) {
  • echo $ifile;
  • }
  • }
  • closedir($dir);
  • clearstatcache();
  • $EnTout=round((getmicro()-$DebutTime)*100)/100;
  • echo "<tr bgcolor=\"#000000\">\n<td></td><td></td><td></td><td></td><td></td><td></td><td><input type=\"submit\" name=\"Efface\" value=\"Effacé\" style=\"height:18; margin:0; border-style:none;\"></td>\n<td><input type=\"submit\" name=\"zip\" value=\"Zippé\" style=\"height:18; margin:0; border-style:none;\"></td>\n</tr>\n</table><input type=\"hidden\" name=\"lEffassage\" value=\"$lEffassage\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"></form></div>\n<br><br>\n<form method=POST action=\"\"><p align=\"center\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"><input type=\"text\" name=\"Mdos\" style=\"color:black; background-color:silver; margin:0; border-style:none;\"> <input type=\"submit\" value=\"Cree\" style=\"height:18; margin:0; border-style:none;\"></p></form><form method=POST action=\"\" enctype=\"multipart/form-data\"><p align=\"center\"><input type=\"file\" name=\"uploader\" style=\"color:black; background-color:silver; margin:0; border-style:none;\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"> <input type=\"submit\" name=\"Sender\" value=\"Envoie\" style=\"height:18; margin:0; border-style:none;\"></p></form><br><br><div align=\"center\"><table border=\"0\">\n<tr bgcolor=\"#696969\">\n<td><font size=\"1\">Temps d'execution: $EnTout sec</font></td><td>\n<font size=\"1\">Dev Realisé par <a href=\"mailto:magicking@altern.org\">Magicking</a></font>\n</td>\n\n</tr>\n</div></table>\n</body>\n</html>";
  • exit;
  • }
  • }
  • if($rang==0) {
  • header("HTTP/1.0 403 Forbidden");
  • echo "Vous n'étes pas autorisé a télécharger un fichier\nContactez l'administrateur pour avoir plus de renseignement $adminmail";
  • exit;
  • }
  • if(!(is_dir($dos . "\\")) || isset($zip)) {
  • if (file_exists($dos) || isset($zip)){
  • $row[2]++;
  • mysql_query("UPDATE `phpexplorer` SET `dl`='$row[2]' WHERE `Pseudo`='$pseudo'");
  • $temp=@explode("\\",$dos);
  • $sizeofT=sizeof($temp);
  • $filee=$temp[$sizeofT-1];
  • $headers = getallheaders();
  • while (list($entete, $valeur) = each($headers)) {
  • if(strtolower($entete)=="range" && !(isset($zip))) {
  • $ok=$valeur;
  • $ok=str_replace(" ","",$ok);
  • $ok=str_replace("bytes=","",$ok);
  • $ok=str_replace("-","",$ok);
  • header("HTTP/1.1 206 Partial Content");
  • header("Date: " . gmdate("D, d M Y H:i:s T") . " GMT");
  • break;
  • }
  • }
  • if(!(isset($zip))) {
  • header("Content-Disposition: attachment; filename=$filee");
  • header("Last-Modified: " . (date("D, d M Y H:i:s T", filemtime($dos))));
  • header("Accept-Ranges: bytes");
  • header("Content-Length: " . (filesize($dos)-$ok));
  • if(isset($ok)) {
  • $tailler=(filesize($dos)-1)."/".(filesize($dos));
  • $aff=$ok."-".$tailler;
  • header("Content-Range: bytes ".$aff);
  • }
  • header("Connection: close");
  • header("Content-Type: application/octet-stream; name=\"$filee\"");
  • if($fd = @fopen($dos,"rb")) {
  • if(isset($ok)) {
  • fseek($fd,$ok);
  • }
  • while(!feof($fd)) {
  • echo fread($fd,4096);
  • }
  • fclose($fd);
  • }
  • } else {
  • $zipfile = new zipfile();
  • $countE=0;
  • $zpcount=0;
  • header("Information: " . sizeof($Effassage) . " a zippe");
  • while($countE<$lEffassage) {
  • $content=$Effassage[$countE];
  • if($content!="") {
  • $nameinzip=explode("\\",$content);
  • $nameinzip=$nameinzip[(sizeof($nameinzip)-1)];
  • addfil($content,&$zipfile,"$nameinzip");
  • $zpcount++;
  • header("Information: $zpcount zipped");
  • }
  • $countE++;
  • }
  • $zipfile -> addFile("Vous avez téléchargez ce(s) depuis PhpMyExplorer utilisé sur $HTTP_HOST
  • Pour securité les IP sont garder la votre au moment du téléchargement est : $REMOTE_ADDR", "commentaire.txt");
  • //Sur mon serve les ip sont logge
  • $zipped = $zipfile -> file();
  • $zipped = substr($zipped,$ok,strlen($zipped));
  • header("Content-Disposition: attachment; filename=PhpMyExplorer.zip");
  • // header("Last-Modified: " . (date("D, d M Y H:i:s T", 1));
  • header("Accept-Ranges: bytes");
  • header("Content-Length: " . (strlen($zipped)));
  • header("Connection: close");
  • header("Content-Type: application/x-zip; name=\"PhpMyExplorer.zip\"");
  • echo $zipped;
  • }
  • }
  • }
  • @mysql_close();
  • ?>
<?
class zipfile
{
    /**
     * Array to store compressed data
     *
     * @var  array    $datasec
     */
    var $datasec      = array();

    /**
     * Central directory
     *
     * @var  array    $ctrl_dir
     */
    var $ctrl_dir     = array();

    /**
     * End of central directory record
     *
     * @var  string   $eof_ctrl_dir
     */
    var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";

    /**
     * Last offset position
     *
     * @var  integer  $old_offset
     */
    var $old_offset   = 0;


    /**
     * Converts an Unix timestamp to a four byte DOS date and time format (date
     * in high two bytes, time in low two bytes allowing magnitude comparison).
     *
     * @param  integer  the current Unix timestamp
     *
     * @return integer  the current date in a four byte DOS format
     *
     * @access private
     */
    function unix2DosTime($unixtime = 0) {
        $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);

        if (1) {
        	$timearray['year']    = 2000;
        	$timearray['mon']     = 1;
        	$timearray['mday']    = 1;
        	$timearray['hours']   = 0;
        	$timearray['minutes'] = 0;
        	$timearray['seconds'] = 0;
        } // end if

        return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
                ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
    } // end of the 'unix2DosTime()' method


    /**
     * Adds "file" to archive
     *
     * @param  string   file contents
     * @param  string   name of the file in the archive (may contains the path)
     * @param  integer  the current timestamp
     *
     * @access public
     */
    function addFile($data, $name, $time = 0)
    {
        $name     = str_replace('\\', '/', $name);

        $dtime    = dechex($this->unix2DosTime($time));
        $hexdtime = '\x' . $dtime[6] . $dtime[7]
                  . '\x' . $dtime[4] . $dtime[5]
                  . '\x' . $dtime[2] . $dtime[3]
                  . '\x' . $dtime[0] . $dtime[1];
        eval('$hexdtime = "' . $hexdtime . '";');

        $fr   = "\x50\x4b\x03\x04";
        $fr   .= "\x14\x00";            // ver needed to extract
        $fr   .= "\x00\x00";            // gen purpose bit flag
        $fr   .= "\x08\x00";            // compression method
        $fr   .= $hexdtime;             // last mod time and date

        // "local file header" segment
        $unc_len = strlen($data);
        $crc     = crc32($data);
        $zdata   = gzcompress($data,0);
        $zdata   = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
        $c_len   = strlen($zdata);
        $fr      .= pack('V', $crc);             // crc32
        $fr      .= pack('V', $c_len);           // compressed filesize
        $fr      .= pack('V', $unc_len);         // uncompressed filesize
        $fr      .= pack('v', strlen($name));    // length of filename
        $fr      .= pack('v', 0);                // extra field length
        $fr      .= $name;

        // "file data" segment
        $fr .= $zdata;

        // "data descriptor" segment (optional but necessary if archive is not
        // served as file)
        $fr .= pack('V', $crc);                 // crc32
        $fr .= pack('V', $c_len);               // compressed filesize
        $fr .= pack('V', $unc_len);             // uncompressed filesize

        // add this entry to array
        $this -> datasec[] = $fr;
        $new_offset        = strlen(implode('', $this->datasec));


        // now add to central directory record
        $cdrec = "\x50\x4b\x01\x02";
        $cdrec .= "\x00\x00";                // version made by
        $cdrec .= "\x14\x00";                // version needed to extract
        $cdrec .= "\x00\x00";                // gen purpose bit flag
        $cdrec .= "\x08\x00";                // compression method
        $cdrec .= $hexdtime;                 // last mod time & date
        $cdrec .= pack('V', $crc);           // crc32
        $cdrec .= pack('V', $c_len);         // compressed filesize
        $cdrec .= pack('V', $unc_len);       // uncompressed filesize
        $cdrec .= pack('v', strlen($name) ); // length of filename
        $cdrec .= pack('v', 0 );             // extra field length
        $cdrec .= pack('v', 0 );             // file comment length
        $cdrec .= pack('v', 0 );             // disk number start
        $cdrec .= pack('v', 0 );             // internal file attributes
        $cdrec .= pack('V', 32 );            // external file attributes - 'archive' bit set

        $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
        $this -> old_offset = $new_offset;

        $cdrec .= $name;

        // optional extra field, file comment goes here
        // save to central directory
        $this -> ctrl_dir[] = $cdrec;
    } // end of the 'addFile()' method


    /**
     * Dumps out file
     *
     * @return  string  the zipped file
     *
     * @access public
     */
    function file()
    {
	$data    = implode('', $this -> datasec);
        $ctrldir = implode('', $this -> ctrl_dir);

        return
            $data .
            $ctrldir .
            $this -> eof_ctrl_dir .
            pack('v', sizeof($this -> ctrl_dir)) .  // total # of entries "on this disk"
            pack('v', sizeof($this -> ctrl_dir)) .  // total # of entries overall
            pack('V', strlen($ctrldir)) .           // size of central dir
            pack('V', strlen($data)) .              // offset to start of central dir
            "\x00\x00";                             // .zip file comment length
    } // end of the 'file()' method

} // end of the 'zipfile' class
$dos=realpath($dos);
$mylogin="root";
$mypass="";
if($logout=="done") {
	$pseudo="";
	$password="";
	setcookie("pseudo","");
	setcookie("password","");
	header("Location: http://$HTTP_HOST/?dos=D:\\");
	exit;
}
if(@mysql_connect("127.0.0.1",$mylogin,$mypass)) {
			@mysql_select_db("tout");
			$row=mysql_fetch_array(mysql_query("SELECT count(*) FROM `phpexplorer` WHERE `Pseudo`='$pseudo' AND `Password`=PASSWORD('$password')"));
			if($row[0]=="0") {
?>
<html>
<head>
<title>Login</title>
</head>

<body bgcolor="#000000" text="#FFFFFF">
<form name="connect" method="post">
    <table align="center">
        <tr bgcolor="#1F76A1">
            <td>
                <p>User Name</p>
            </td>
            <td>
                <p><input type="text" name="pseudo" value="anonymous"
                size="13" style="color:white; background-color:rgb(31,118,161); border-style:none;"
                maxlength="15" OnClick="if(this.value=='anonymous') this.value=''"></p>
            </td>
        </tr>
        <tr bgcolor="#CCCCCC">
            <td>
                <p>Password</p>
            </td>
            <td>
                <p><input type="password" name="password" value="anonymous" style="color:white; background-color:rgb(204,204,204); border-style:none;"
                maxlength="20" size="13"></p>
            </td>
        </tr>
        <tr>
            <td>
                <p></p>
            </td>
            <td>
                <p><input type="submit" name="Button" value="                   "
                style="background-image:url('login.gif'); background-repeat:no-repeat; background-attachment:fixed; border-style:none; background-position:0 0;"
                onclick="document.connect.pseudo.focus();" onfocus="document.connect.pseudo.focus();"></p>
            </td>
        </tr>
    </table>
</form>
<script>
document.connect.pseudo.focus();
</script> 
</body>
</html>
<?
exit;
	unset($row);
	@mysql_close();
	} else {
setcookie("pseudo","");
setcookie("password","");
}
}
$rang=0;
setcookie("pseudo",$pseudo,time()+3600);
setcookie("password",$password,time()+3600);
if($pseudo!="" && $password!="") {
@mysql_connect("127.0.0.1",$mylogin,$mypass);
@mysql_select_db("tout");
if(isset($fav)) {
if($fav=="!del") { $fav=""; }
mysql_query("UPDATE `phpexplorer` SET `favori`='$fav' WHERE `Pseudo`='$pseudo'");
}
$row=mysql_fetch_array(mysql_query("SELECT `rang`,`up`,`dl`,`ef`,`favori` FROM `phpexplorer` WHERE `Pseudo`='$pseudo' AND `Password`=PASSWORD('$password')"));
if($row[0]=="") { $rang=0; }
if(isset($row[0])) { $rang=$row[0]; }
$up=$row[1];
$dl=$row[2];
$ef=$row[3];
$favorie["DOS"]=$row[4];
	if($favorie["DOS"]==""){
		$favorie["NAME"]="<a href=\"?fav=$dos&dos=$dos\">Ajouter</a>";
	} 
	if(strlen(str_replace("\\","",$favorie["DOS"]))!=2 && strlen(str_replace("\\","",$favorie["DOS"]))!=0){
		$favorie["T"]=strrev(substr( strrev($favorie["DOS"]), 0, strpos(strrev($favorie["DOS"]),"\\") ));
		if(strlen($favorie["T"])>13) {
			$favorie["T"]=substr($favorie["T"],0,13);
		}
		$favorie["NAME"]="<a href=\"?dos=$favorie[DOS]\">$favorie[T]</a>    <a href=\"?fav=!del&dos=$dos\">Sup</a>";
	}
	if(strlen(str_replace("\\","",$favorie["DOS"]))==2) {
		$favorie["T"].=str_replace("\\\\","\\",$favorie["DOS"]);
		$favorie["NAME"]="<a href=\"?dos=$favorie[DOS]\">$favorie[T]</a>    <a href=\"?fav=!del&dos=$dos\">Sup</a>";
	}
}

function erase($path) {
	$rep=opendir($path);
	while($lire = readdir($rep)) {
		if ($lire!="." && $lire!="..") { $liredos=$path.$lire."\\";
			if (is_dir($liredos)) {
				erase($liredos);
			} else {
				unlink($liredos);
			}
		}
	}
closedir($rep);
rmdir($path);

}
function addfil($content,&$zipfile,$originalrep){
	$dump_buffer="";
	$nameinzip="";
	$content = realpath($content);

	if(is_file($content)) {
		$nameinzip=explode("\\",$content);
		$nameinzip=$nameinzip[(sizeof($nameinzip)-1)];
		if($fd = @fopen($content,"rb")) {
			while(!feof($fd)) {
				$dump_buffer.=fread($fd,4096);
			}
			if($originalrep==$nameinzip) { $originalrep=""; }
			$zipfile -> addFile($dump_buffer,"PhpMyExplorer\\$originalrep$nameinzip");
		fclose($fd);
		}
	}
	if(is_dir("$content\\")){
		$rep=opendir("$content\\");
		while($lire = readdir($rep)) {
			if ($lire!="." && $lire!="..") { 
				$liredos="$content\\$lire";
				if (is_file("$liredos")){
					if($originalrep!="" && substr($originalrep,strlen($originalrep)-1,strlen($originalrep))!="\\") { $originalrep.="\\"; }
					addfil($liredos,&$zipfile,"$originalrep");
				} else if (is_dir("$liredos\\")) {
					if($originalrep!="" && substr($originalrep,strlen($originalrep)-1,strlen($originalrep))!="\\") { $originalrep.="\\"; }
					addfil("$liredos",&$zipfile,"$originalrep$lire");
				}
			}
		}
		closedir($rep);
	}
}
function getmicro() {
list($msec,$sec)=explode(" ",microtime()); 
return ($msec+$sec); 
}
$DebutTime = getmicro();
/*
Pour les disques mettre chaque disque sous cette forme :
$Disk[0]="A:\\|di"; Pour la disquette [di est pour l'image de la disquette]
$Disk[1]="C:\\|DU"; Pour un disque dur [DU est pour l'image du disque dur]
$Disk[2]="E:\\|cd";
*/
$adminmail="magicking@altern.org";
$Disk[0]="A:\\|di";
$Disk[1]="C:\\|dU";
$Disk[2]="D:\\|dU";
$Disk[3]="E:\\|cd";
$currentcolor="#1F76A1";
$tablecolor="#003666";
$colortext="#FFFFFF";
$max=20;
clearstatcache();
if(isset($Efface) && $rang!=0) {
	$IEffassage=-1;
	if(!(isset($lEffassage))) { $lEffassage=0; }
		while($IEffassage<$lEffassage) {

			$IEffassage++;
			if($Effassage[$IEffassage]!="") {
				$Effassage[$IEffassage]=str_replace(":p","+",$Effassage[$IEffassage]);
				$Effassage[$IEffassage]=realpath($Effassage[$IEffassage]);
				if(is_dir($Effassage[$IEffassage]."\\")) {
					erase($Effassage[$IEffassage]."\\");
				}
				if(file_exists($Effassage[$IEffassage])) {
					@unlink($Effassage[$IEffassage]);
				}
			$ef++;
			}
		}
mysql_query("UPDATE `phpexplorer` SET `ef`='$ef' WHERE `Pseudo`='$pseudo'");
}
$dos=str_replace(":p","+",$dos);
if($rang==1) {
$configname="phpexploreconfig";
if(isset($Sender)) {
@copy($uploader, "$dos\\$uploader_name");
$row[1]++;
mysql_query("UPDATE `phpexplorer` SET `up`='$row[1]' WHERE `Pseudo`='$pseudo'");
}
if(file_exists($dos."\\".$configname)) {
		$Access=strrev(substr(strrev($Access),strpos(strrev($Access),"\\"),strlen($Access)));

 		if($Access = @fopen($dos."\\".$configname,"r")) {
		while (!feof ($Access)) { $Config =$Config.@fgets($Access,1024); }
		$Config=substr($Config,strpos($Config,"Allow")+6,strlen($Config));
		$Config=explode(",",$Config);
		
		$IConfig=0;
		$Ip=explode(".",$REMOTE_ADDR);
		while($IConfig<sizeof($Config)) {
			unset($ConfigT);
			$IConfigT=0;
			$ConfigT=explode(".",$Config[$IConfig]);
			while($IConfigT<sizeof($ConfigT)) {
				$Configg=$ConfigT[$IConfigT];
				$Ipp=$Ip[$IConfigT];
				if($Configg!=$Ipp) { if($Configg!="*") { die("Forbidden "); } }
				$IConfigT++;
			}
			$IConfig++;
		}
		}
}
}
if(isset($Mdos) && $rang!=0) {
if(!(is_dir($dos.$Mdos))) {
@mkdir($dos."\\".$Mdos,0700);
}
}
if(!(isset($zip))){
if( $dir = @opendir($dos . "\\") )
{
$CD=0;
$taille=0;
$irep=0;
$ifile=0;
$version="1.0";
$lEffassage=0;
echo "<html>\n\n<head>\n<title>Php My Explorer - $version</title>\n<style type=\"text/css\">\nA {\n	text-decoration: none;\n}\nA.dossier {\n	color: #FFFFFF;\n	text-decoration: none;\n}\n\nA.file {\n	color: #323240;\n	text-decoration: none;\n}\n\n}\n</style>\n<script src=\"fade.js\" language=\"Javascript\"></script>";
?>
<script language="JavaScript">
<!--
function init_float_layers()
{
  var name;
  var layer;
  var i;
  var j;

  j = 0;
  document._float_layers = new Array(Math.max(1, init_float_layers.arguments.length/2));
  for (i = 0; i < init_float_layers.arguments.length; i += 2) {
    name  = init_float_layers.arguments[i];
    if (name == '')
      return;
    if (navigator.appName.indexOf('Netscape', 0) != -1) {
      layer = document.layers[name];
      layer._fl_pos_left = layer.left;
      layer._fl_pos_top  = layer.top;
    } else {
      layer = document.all[name];
      layer._fl_pos_left = layer.style.pixelLeft;
      layer._fl_pos_top  = layer.style.pixelTop;
    }
    layer._fl_pos = init_float_layers.arguments[i+1];
    if (layer)
      document._float_layers[j++] = layer;
  }

  document._fl_interval = setInterval('process_float_layers()', 200);
}

function page_width()
{
  return (navigator.appName.indexOf('Netscape', 0) != -1) ? innerWidth  : document.body.clientWidth;
}

function page_height()
{
  return (navigator.appName.indexOf('Netscape', 0) != -1) ? innerHeight : document.body.clientHeight;
}

function process_float_layers()
{
  if (document._float_layers) {
      var i;
      var layer;
      for (i = 0; i < document._float_layers.length; i++) {
	  layer = document._float_layers[i];
	  if (navigator.appName.indexOf('Netscape', 0) != -1) {
	    if (layer._fl_pos == 1)
	      layer.left = layer._fl_pos_left + window.pageXOffset;
	    else if (layer._fl_pos == 2 || layer._fl_pos == 5) 
	      layer.left = window.pageXOffset;
	    else if (layer._fl_pos == 3 || layer._fl_pos == 6) 
	      layer.left = window.pageXOffset + (page_width() - layer.clip.width)/2;
	    else
	      layer.left = window.pageXOffset + page_width() - layer.clip.width - 16;
	    if (layer._fl_pos == 1)
	      layer.top = layer._fl_pos_top + window.pageYOffset;
	    else if (layer._fl_pos == 2 || layer._fl_pos == 3 || layer._fl_pos == 4)
	      layer.top = window.pageYOffset;
	    else
	      layer.top  = window.pageYOffset + page_height() - layer.clip.height;
	  } else {
	    if (layer._fl_pos == 1)
	      layer.style.pixelLeft = layer._fl_pos_left + document.body.scrollLeft;
	    else if (layer._fl_pos == 2 || layer._fl_pos == 5)
	      layer.style.pixelLeft = document.body.scrollLeft;
	    else if (layer._fl_pos == 3 || layer._fl_pos == 6)
	      layer.style.pixelLeft = document.body.scrollLeft + (page_width() - layer.style.pixelWidth)/2;
	    else
	      layer.style.pixelLeft = document.body.scrollLeft + page_width()  - layer.style.pixelWidth;
	    if (layer._fl_pos == 1)
	      layer.style.pixelTop = layer._fl_pos_top + document.body.scrollTop;
	    else if (layer._fl_pos == 2 || layer._fl_pos == 3 || layer._fl_pos == 4)
	      layer.style.pixelTop = document.body.scrollTop;
	    else
	      layer.style.pixelTop  = document.body.scrollTop  + page_height() - layer.style.pixelHeight;
         }
      }
  }
}

// -->
</script>
<?
echo "</head>\n<body bgcolor=\"#000000\" text=\"white\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FFFFFF\" OnLoad=\"init_float_layers('Stat', 2);\">\n<div id=\"Stat\" style=\"filter:alpha(opacity=50); -moz-opacity:50%; position:absolute; left:0px; top:0px;\"><table border=1 bordercolor=blue bordercolordark=blue bordercolorlight=blue><tr><td style=background-color:648CB4;><table cellpadding=0 cellspacing=0><tr>
<td width=\"50\"><p>Pseudo</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$pseudo</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>Upload</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$up</p></td><td width=\"50\"><p>Download</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$dl</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>Effacement</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><p>$ef</p></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\">Favorie</td><td><font style=\"color:648CB4;\"> . </font></td><td>$favorie[NAME]</td><td><font style=\"color:648CB4;\"> . </font></td><td><font style=\"color:648CB4;\"> . </font></td><td><font style=\"color:648CB4;\"> . </font></td><td width=\"50\"><a href=\"?logout=done\" class=\"nofade\">Logout</a></td></tr></table></td></tr></table></div>
\n<p align=\"center\">Vous étes dans $dos</p>\n<br><br><br>\n<div align=\"center\"><form method=POST action=\"\"><table border=\"0\">\n<tr bgcolor=\"$tablecolor\">\n<td>\n<p>File</p>\n</td>\n<td>\n<p>Size</p>\n</td>\n<td><p>Crée le</p>\n</td>\n<td>\n<p>Dernière modification</p>\n</td>\n<td>\n<p>Accédé le</p>\n</td>\n</tr>\n";
				while( $sub_dir = @readdir($dir) )
				{
while (list($unused,$disk)=each($Disk)) {
	$disk=explode("|",$disk);
	if(@opendir($disk[0])) {
	echo "<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$disk[0]\"><img src=\"$disk[1].gif\" border=\"0\"></a><br></p>\n</td>\n<td>\n<p>Disque $disk[0]</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n</tr>\n";
	}
	$CD++;
}
	if($sub_dir!=".") {

		if($sub_dir=="..") {
		$edos=str_replace("+",":p",$dos);
		echo "<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$edos\\..\\\"><img src=\"up.gif\" border=\"0\"></a><br></p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n</tr>\n";
		}
	if(!($sub_dir=="..")) {
		if (file_exists($dos)){
			$sizeofFF=filesize("$dos\\$sub_dir");
			 
			if($sizeofFF=="0") { 
				if($dirt=is_dir("$dos\\$sub_dir\\"))
				{
					$sizeofFF="-";
				} else {
					$sizeofFF="0";
				}
			} else {
		
			if($sizeofFF>1024) {
			$taille++;
			$sizeofFF=$sizeofFF/1024; //Conversion en KO
			}

			if($sizeofFF>1024) {
			$taille++;
			$sizeofFF=$sizeofFF/1024; //Conversion en MO
			}

			if($sizeofFF>1000) {
			$taille++;
			$sizeofFF=$sizeofFF/1000; //conversion GO
			}

		if(strpos($sizeofFF,".")) {
		$sizeofFF=substr($sizeofFF,0,strpos($sizeofFF,"."));
		}

		}
		}
		switch($taille) {
		case '0':
		if(!($sizeofFF=="-")) {
		$addon="Octets";
		if($sizeofFF<2) { $addon="Octet"; }
		}
		$taille=0;
		break;
		case '1':
		$addon="KO";
		$taille=0;
		break;
		case '2':
		$addon="MO";
		$taille=0;
		break;
		case '3':
		$addon="GO";
		$taille=0;
		break;
		}
		$dos=str_replace("\\\\","\\",$dos);
		
		if(is_dir("$dos\\$sub_dir\\")) {
		$Creation=@date("d/m/y",fileatime("$dos\\$sub_dir\\"));
		$colortext="#FFFFFF";
		$currentcolor="#1F76A1";
		$esub_dir=$sub_dir;
		$sub_dir=str_replace("+",":p",$sub_dir);
		$dos=str_replace("+",":p",$dos);
		if(strlen($esub_dir)>$max) { $esub_dir=substr($esub_dir,0,$max)."..."; }
		
			$rep[strtolower(str_replace(" ","",$esub_dir))]="<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$dos\\$sub_dir\" class=\"dossier\">$esub_dir</a><br></p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td><p>$Creation</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td>\n<p>-</p>\n</td>\n<td whidth=\"1\"><input type=\"checkbox\" name=\"Effassage[$lEffassage]\" value=\"$dos\\$sub_dir\"></td>\n</tr>\n";
		} 
		if(is_file("$dos\\$sub_dir")) {
		$Creation=@date("d/m/y",fileatime("$dos\\$sub_dir"));
		$colortext="#000066";
		$currentcolor="#CCCCCC";
		$esub_dir=$sub_dir;
		$sub_dir=str_replace("+",":p",$sub_dir);
		$dos=str_replace("+",":p",$dos);
		if(strlen($esub_dir)>$max) { $esub_dir=substr($esub_dir,0,$max)."(.".strrev(substr(strrev($esub_dir),0,strrev(strpos(strrev($esub_dir),".")))).")"; }
		$Filectime=@date("d/m/y",filemtime("$dos\\$sub_dir"));
		$Accedation=@date("d/m/y",fileatime("$dos\\$sub_dir"));
			if($Filectime=="") { $Filectime="-"; }
			$file[strtolower($esub_dir)]="<tr bgcolor=\"$currentcolor\">\n<td>\n<p><a href=\"?dos=$dos\\$sub_dir\" class=\"file\">$esub_dir</a><br></p>\n</td>\n<td>\n<p>$sizeofFF $addon</p>\n</td>\n<td>\n<p>$Creation</p>\n</td>\n<td>\n<p>$Filectime</p>\n</td>\n<td>\n<p>$Accedation</p>\n</td>\n<td whidth=\"1\"><input type=\"checkbox\" name=\"Effassage[$lEffassage]\" value=\"$dos\\$sub_dir\"></td>\n</tr>\n";
		}
		$lEffassage++;
		$addon="";
	}
}
}
if(is_array($rep)) {
ksort($rep);
reset($rep);
while (list($brep,$irep)=each($rep)) {
echo $irep;
}
}
if(is_array($file)) {
ksort($file);
reset($file);
while (list($bfile,$ifile)=each($file)) {
echo $ifile;
}
}
closedir($dir);
clearstatcache();
$EnTout=round((getmicro()-$DebutTime)*100)/100;
echo "<tr bgcolor=\"#000000\">\n<td></td><td></td><td></td><td></td><td></td><td></td><td><input type=\"submit\" name=\"Efface\" value=\"Effacé\" style=\"height:18; margin:0; border-style:none;\"></td>\n<td><input type=\"submit\" name=\"zip\" value=\"Zippé\" style=\"height:18; margin:0; border-style:none;\"></td>\n</tr>\n</table><input type=\"hidden\" name=\"lEffassage\" value=\"$lEffassage\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"></form></div>\n<br><br>\n<form method=POST action=\"\"><p align=\"center\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"><input type=\"text\" name=\"Mdos\" style=\"color:black; background-color:silver; margin:0; border-style:none;\"> <input type=\"submit\" value=\"Cree\" style=\"height:18; margin:0; border-style:none;\"></p></form><form method=POST action=\"\" enctype=\"multipart/form-data\"><p align=\"center\"><input type=\"file\" name=\"uploader\" style=\"color:black; background-color:silver; margin:0; border-style:none;\"><input type=\"hidden\" name=\"dos\" value=\"$dos\"> <input type=\"submit\" name=\"Sender\" value=\"Envoie\" style=\"height:18; margin:0; border-style:none;\"></p></form><br><br><div align=\"center\"><table border=\"0\">\n<tr bgcolor=\"#696969\">\n<td><font size=\"1\">Temps d'execution: $EnTout sec</font></td><td>\n<font size=\"1\">Dev Realisé par <a href=\"mailto:magicking@altern.org\">Magicking</a></font>\n</td>\n\n</tr>\n</div></table>\n</body>\n</html>";
exit;
}
}
if($rang==0) {
header("HTTP/1.0 403 Forbidden");
echo "Vous n'étes pas autorisé a télécharger un fichier\nContactez l'administrateur pour avoir plus de renseignement $adminmail";
exit;
}
if(!(is_dir($dos . "\\")) || isset($zip)) {
	if (file_exists($dos) || isset($zip)){
		$row[2]++;
		mysql_query("UPDATE `phpexplorer` SET `dl`='$row[2]' WHERE `Pseudo`='$pseudo'");
		$temp=@explode("\\",$dos);
		$sizeofT=sizeof($temp);
		$filee=$temp[$sizeofT-1];
		$headers = getallheaders();
		while (list($entete, $valeur) = each($headers)) {
			if(strtolower($entete)=="range" && !(isset($zip))) {
				$ok=$valeur;
				$ok=str_replace(" ","",$ok);
				$ok=str_replace("bytes=","",$ok);
				$ok=str_replace("-","",$ok);
				header("HTTP/1.1 206 Partial Content");
				header("Date: " . gmdate("D, d M Y H:i:s T") . " GMT");
				break;
			}
		}
		if(!(isset($zip))) {
			header("Content-Disposition: attachment; filename=$filee");
			header("Last-Modified: " . (date("D, d M Y H:i:s T", filemtime($dos))));
			header("Accept-Ranges: bytes");
			header("Content-Length: " . (filesize($dos)-$ok));
				if(isset($ok)) {
					$tailler=(filesize($dos)-1)."/".(filesize($dos));
					$aff=$ok."-".$tailler;
					header("Content-Range: bytes ".$aff);
				}
			header("Connection: close");
			header("Content-Type: application/octet-stream; name=\"$filee\"");
			if($fd = @fopen($dos,"rb")) {
				if(isset($ok)) {
					fseek($fd,$ok);
				}
				while(!feof($fd)) {
					echo fread($fd,4096);
				}
			fclose($fd);
			}

		} else {

			$zipfile = new zipfile();
			$countE=0;
			$zpcount=0;
			header("Information: " . sizeof($Effassage) . " a zippe");
			while($countE<$lEffassage) {
				$content=$Effassage[$countE];
				if($content!="") {
					$nameinzip=explode("\\",$content);
					$nameinzip=$nameinzip[(sizeof($nameinzip)-1)];
					addfil($content,&$zipfile,"$nameinzip");
					$zpcount++;
					header("Information: $zpcount zipped");
				}
				$countE++;
			}
	
			$zipfile -> addFile("Vous avez téléchargez ce(s) depuis PhpMyExplorer utilisé sur $HTTP_HOST
Pour securité les IP sont garder la votre au moment du téléchargement est : $REMOTE_ADDR", "commentaire.txt");
//Sur mon serve les ip sont logge
			$zipped = $zipfile -> file();
			$zipped = substr($zipped,$ok,strlen($zipped));
			header("Content-Disposition: attachment; filename=PhpMyExplorer.zip");
//			header("Last-Modified: " . (date("D, d M Y H:i:s T", 1));
			header("Accept-Ranges: bytes");
			header("Content-Length: " . (strlen($zipped)));
			header("Connection: close");
			header("Content-Type: application/x-zip; name=\"PhpMyExplorer.zip\"");
			echo $zipped;
				
		}
	}
}
@mysql_close();
?> 

 Conclusion

Je pense qui y'a moyen de l'optimiser encore mais j'ai pas le temps

magicking@altern.org  

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

Source avec Zip BNC & SERVEUR WEB CLASS/PHP5
CLASS POUR LES TEMPLATES
SQLBUILDER POUR LES MYSQL_QUERY FACILE(LOL)
ZIP
IP DANS UN CARDE COLORISEZ

 Sources de la même categorie

Source avec Zip Source avec une capture PHPREPOGENERATOR + REPO (WIN) par alvinp
Source avec Zip IPHONE - ICÔNE D'APPEL TÉLÉPHONIQUE SUR L'ÉCRAN D'ACCUEIL par Rainbow
Source avec Zip Source avec une capture [APP WEB]SERVEUREXPLOREUR par thematrix01
Source avec Zip Source avec une capture MY.BOOKMARKS par inwebo
Source avec Zip M.V.C M.E.D par faceme

Commentaires et avis

Commentaire de mehdibou le 06/02/2003 20:00:02

hum... tu aurais peut être pu traduire, nan ?

Commentaire de Magicking le 07/02/2003 10:40:37

traduire quoi ? la class pour le zip dsl mais c'est pas de moi je les trouvé dans phpmyadmin

Commentaire de dawill le 19/06/2003 13:19:41

Commentaire de Magicking le 19/06/2003 16:53:14

Commentaire de dezossor le 02/07/2003 13:51:45

pour le problème que tu rencontre pour un serveur Linux, pourquoi n'utilise tu les adresse UNC de tes different repertoire, ce qui rendrais ton script compatible avec toutes les plate form UNIX/WIN/MACOS.

Commentaire de psyjc le 28/07/2003 16:04:49

oulalaaaaaaaaa
jai interet a prevoir la cafetiere si je veux comprendre le script :s

jai parcourut rapidement, ia pas mal de truc qui me semble louche quand meme, surtout (comme tu l'a dit) a propos des slashs.

bref,je testerais ca quand meme, ca peut m'inspirer :)

Commentaire de Magicking le 28/07/2003 16:10:53

erf quant j'ais fais se script il ya beaucoup de truc que je ne connaisais pas donc faut pas t'ettoner si je reinvente la roue

Commentaire de francisnguyen le 21/10/2003 13:31:40

Bonjour,
Le script m'intéresse mais je n'arrive pas a passer l'étape du login.
Je travail en local avec easyphp1.5.
J'ai créé la base "tout" avec la table.
Le champs passwor n'exipte pas avec 1.5 je l'ai remplacé par string.
Est ce que tu penses que ca viens de la?
Merci

Commentaire de ben01n le 31/03/2004 21:44:54

j'ai le même problème que francisnguyen :
lorsque je tape mon pseudo et mon mot de passe et que je clique sur le bouton pour me loguer il me renvoit systematiquement sur l'écran de login.
donc si quelqu'un a la soluce.....
(je bosse avec easyphp 1.7)

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,484 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales