Viewing file: index2.php (6.58 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include "../frames/conn.php";
//<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
error_reporting (FATAL + ERROR);
date_default_timezone_set('UTC');
// primero, vemos que vengan parametros correctos.
//one=usuario, two=fecha formato (Y-m-d H) , tree el md5 de los otros dos
/*
if (!$_REQUEST['one'] or !$_REQUEST['two'] or !$_REQUEST['three']){
ECHO "ENTRADA CON PARAMETROS NO ADECUADOS \n";
DIE();
}
*/
//una peque�a clase para sacar usuario y fecha
//print_r($_REQUEST);
$nombreobj=new Encriptor();
$nombre=$nombreobj->encrypt("pepito lopez"); // en pruebas
//$nombre=$nombreobj->encrypt($_REQUEST['one']); // definitivo
unset ($nombreobj);
$fechaobj=new Encriptor();
$fecha=$fechaobj->encrypt(date("2010-05-25 09:00")); // en pruebas
//$fecha=$fechaobj->encrypt("2010-05-25 18:00"); // en pruebas
//$fecha=$fechaobj->encrypt($_REQUEST['two']); // definitivo
unset ($fechaobj);
$md5obj=new Encriptor();
$md5=$md5obj->encrypt("--pepito lopez--".date("2010-05-25 09:00")); // en pruebas
//$md5=$md5obj->encrypt($_REQUEST['three']); // definitivo
unset ($md5obj);
$objeto=NEW datos($nombre,$fecha,$md5);
function showContent()
{
$sql="select * from ".BBDD.".torrebruno_files where 1 order by id asc";
echo $sql;
while ($row=mysql_fetch_array(mysql_query($sql,$conn))){
print_r($row);
$external = new Encriptor($key);
$link=$external->encript($row['ruta']);
echo "<tr><td><img src='style/file2.gif' width='16' height='16' alt='file'/> <a href='bajando_torr.php?l=$link'>".$row['titulo']."</a></td>"
."<td align='right'>".$row['fecha']."</td>"
."<td align='right'>".$row['tamano']." bytes</td></tr>";
}
}
function showContent_old($path){
IF (strpos("lalala".$path,"..")>0){
$path=".";
echo "directorio no accesible. Pulse volver en su navegador";
die();
}
if ($handle = opendir($path))
{
$up = substr($path, 0, (strrpos(dirname($path."/."),"/")));
echo "<tr><td colspan='2'><img src='style/up2.gif' width='16' height='16' alt='up'/> <a href='".$_SERVER['PHP_SELF']."?path=$up'>Up one level</a></td></tr>";
$directorio = '/';
/////////////
function ordenar($a,$b){
return strcmp(strtolower($a), strtolower($b));
}
///////////////
while (false !== ($fole = readdir($handle)))
{
$arch[]=$fole;
}
usort($arch, "ordenar");
foreach ($arch as $file){
if ($file != "." && $file != "..")
{
$fName = $file;
$file = $path.'/'.$file;
$fichero=$file;
if(is_file($file) and strpos("lalala".$file,'htacce')==0 and strpos("lalala".$file,'pureftpd-upload')==0 and $file<>'./.ftpquota' and $file <>'./index.php') { // echo $fichero."<br>";
echo "<tr><td><img src='style/file2.gif' width='16' height='16' alt='file'/> <a href='$fichero'>".$fName."</a></td>"
."<td align='right'>".date ('d-m-Y H:i:s', filemtime($file))."</td>"
."<td align='right'>".filesize($file)." bytes</td></tr>";
} elseif (is_dir($file) and $file<>"style") {
print "<tr><td colspan='2'><img src='style/dir2.gif' width='16' height='16' alt='dir'/> <a href='".$_SERVER['PHP_SELF']."?path=$fichero'>$fName</a></td></tr>";
}
}ELSE{
}
}
closedir($handle);
}
}
if (isset($_POST['submitBtn'])){
$actpath = isset($_POST['path']) ? $_POST['path'] : '.';
} else {
$actpath = isset($_GET['path']) ? $_GET['path'] : '.';
}
class datos
{
public $usuario;
public $fecha;
public $tres;
public function __construct($one,$two,$three){
// ECHO $one."\n";
// ECHO $two."\n";
// ECHO $three."\n" ;
//one=usuario, two=fecha formato (Y-m-d H) , tree el md5 de los otros dos
$usuarioobj=new Encriptor();
$this->usuario=$usuarioobj->decrypt($one);
unset($usuarioobj);
$fechaobj=new Encriptor();
$this->fecha=$fechaobj->decrypt($two);
unset($fechaobj);
$tresobj=new Encriptor();
$this->tres=$tresobj->decrypt($three);
unset($tresobj);
// print_r($this);
// ahora, $this->tres debe contener $this->usuario y this->fecha
if (!strstr($this->tres,$this->usuario)){
echo "usuario incorrecto";
die();
}
if (!strstr($this->tres,$this->fecha)){
echo "fecha incorrecta";
die();
}
// echo "restahoras es ".restahoras($this->fecha,date("Y-m-d H:i"));
if (restahoras($this->fecha,date("Y-m-d H:i")) > "02:00:00"){
echo "sesion caducada. Vuelva a la p�gina de origen y refresquela para actualizar el enlace";
die();
}
}
}
function restaHoras($horaIni, $horaFin){
return (date("H:i:s", strtotime("00:00:00") + strtotime($horaFin) - strtotime($horaIni) ));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Micro navegador</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div class="caption">MICRO EXPLORADOR RECOPILATORIOS</div>
<? /*
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="path">
<table width="100%">
<tr><td>Path: <input class="text" name="path" type="text" size="40" value="<?php echo $actpath; ?>" /></td></tr>
<tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="List content" /></td></tr>
</table>
</form><br/>
*/
?>
<div class="caption">Directorio Actual: <?php echo $actpath ?></div>
<div id="icon"> </div>
<div id="result">
<table width="100%">
<?php
showContent($actpath);
?>
</table>
</div>
<div id="source">Customized By darklooker</div>
</div>
</body>
|