diff options
author | ramon <ramongomez@us.es> | 2016-03-30 17:37:35 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2016-03-30 17:37:35 +0000 |
commit | 2a31d57ef11638003d433c1ce411e05c71d208d4 (patch) | |
tree | fd14fd0159de1df4cbac11402dde4f436b04ded2 /admin/WebConsole/descargas/index.php | |
parent | 9c1341a700982fd4f9817541a54ac3e9dbec8d7c (diff) |
#718: Añadir iframe para descarga de agente OGAgent para sistemas operativos en propiedades de ordenadores.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4852 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/descargas/index.php')
-rw-r--r-- | admin/WebConsole/descargas/index.php | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/admin/WebConsole/descargas/index.php b/admin/WebConsole/descargas/index.php new file mode 100644 index 00000000..3a856d10 --- /dev/null +++ b/admin/WebConsole/descargas/index.php @@ -0,0 +1,56 @@ +<?php +include_once("../includes/ctrlacc.php"); +include_once("../clases/AdoPhp.php"); +include_once("../includes/CreaComando.php"); +include_once("../idiomas/php/".$idioma."/propiedades_ordenadores_".$idioma.".php"); +$cmd=CreaComando($cadenaconexion); // Crea objeto comando +if (!$cmd) + header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. + +// Security tip: change to local directory. +$oldpwd=getcwd(); +chdir(dirname(__FILE__)); +if (isset($_POST['file'])) { + // Send file. + sendFile ($_POST['file']); +} else { + // Show files list. + echo '<!DOCTYPE html>'."\n"; + echo '<html><head>'."\n"; + echo ' <link rel="stylesheet" type="text/css" href="../estilos.css" />'."\n"; + echo '</head><body>'."\n"; + echo '<div align="center" class="tabla_datos">'."\n"; + echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'."\n"; + echo ' <table>'."\n"; + echo ' <tr><th>'.$TbMsg['DOWNLOADS'].':</th></tr>'."\n"; + echo ' <tr><td><select name="file">'."\n"; + $filelist = glob("*"); + foreach ($filelist as $f) { + // Skip this file. + if ($f == basename(__FILE__)) continue; + echo ' <option value="'.$f.'">'.$f.'</option>'."\n"; + } + echo ' </select>'."\n"; + echo ' <input type="submit" value="" style="width:20px; background:url(../images/boton_confirmar.gif);"></td></tr>'."\n"; + echo '</table>'."\n"; + echo '</form>'."\n"; + echo '</body></html>'."\n"; +} +// Change again to source directory. +chdir($oldpwd); + + +// Send a file. +function sendFile($file) { + // Check if file exists in current directory and it isn't this file. + if (file_exists($file) and strpos($file,"/") === false and $file !== basename(__FILE__)) { + $file_info = apache_lookup_uri($file); + header('Content-Type: ' . $file_info->content_type); + header('Content-Length: ' . filesize($file)); + header('Content-Disposition: attachment; filename="' . $file . '"'); + virtual($file); + } +} + +?> + |