|
From: Paulo H. S. de S. <ph...@us...> - 2004-03-26 02:19:56
|
Update of /cvsroot/uts/uts/src/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv384/src/www Modified Files: apontar.php arquivo.php index.php login.php utils.php Added Files: ajuda.php default.png display.php download.php login.php.in Log Message: - display.php: display preview from FITS - download.php: put a FITS in HTTP response header to user download it - arquivo.php: now it display real archive from user images Index: utils.php =================================================================== RCS file: /cvsroot/uts/uts/src/www/utils.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** utils.php 29 Jan 2004 03:03:23 -0000 1.1.1.1 --- utils.php 26 Mar 2004 02:09:03 -0000 1.2 *************** *** 21,25 **** $servers = array(); ! exec("spmtable $server", $spmout); if(count($spmout) < 4) { --- 21,25 ---- $servers = array(); ! exec("/home/indus/henrique/ssl/bin/spmtable $server", $spmout); if(count($spmout) < 4) { --- NEW FILE: login.php.in --- <? // log user and setup session variables if(($_POST['user'] != "henrique") || ($_POST['pass'] != "ovdemo")) { Header("Location: index.php?erro=1"); exit(-1); } session_start(); $_SESSION['user'] = $_POST['user']; $_SESSION['inicio'] = time(); $_SESSION['log'] = array(); $_SESSION['ra'] = array(); $_SESSION['dec'] = array(); $_SESSION['num_exp'] = array(); $_SESSION['exp_time'] = array(); $_SESSION['filter'] = array(); $_SESSION['bf_dir'] = "@prefix@" . "/imagens"; $_SESSION['bf_name'] = "imagem-" . $_POST['user'] . "-" . strftime("%d%m%Y", time()); $_SESSION['bf_fullpath'] = $_SESSION['bf_dir'] . "/" . $_SESSION['bf_name']; // create user image space //mkdir($_SESSION['bf_dir'], 0777); Header("Location: home.php"); ?> --- NEW FILE: display.php --- <? session_start(); if(!$_SESSION['user']) { session_destroy(); Header("Location: index.php"); } // tenta converter o arquivo caso nao exista um $fits_file = $_GET['filename']; $target_file = "imagens/" . basename($fits_file, ".fits") . ".jpg"; if(!file_exists($target_file)) { exec("convert $fits_file $target_file &> /dev/null", $tmp, $ret); } ?> <html> <head> <title>Observatórios Virtuais - Sessão - <?=$_SESSION['user']?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none} .tabela { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none; color: #000000} .tabelaH { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #666666; color: #FFFFFF} .tabelaOn { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #999999} .tabelaOff { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #CCCCCC} --> </style> </head> <body bgcolor="#000000" text="#FFFFFF" link="#CCCCCC" vlink="#CCCCCC"> <center> <b><?=$fits_file?></b><p> <? if($ret) { ?> <img src="default.png"> <? } else { ?> <img src="<?=$target_file?>"> <? } ?> </center> <p align="center"><a href="arquivo.php">:: voltar :::</a></p> </body> </html> --- NEW FILE: ajuda.php --- Index: index.php =================================================================== RCS file: /cvsroot/uts/uts/src/www/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.php 29 Jan 2004 03:03:23 -0000 1.1.1.1 --- index.php 26 Mar 2004 02:09:03 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + <? + + session_start(); + + if($_SESSION['user']) + Header("Location: home.php"); + + + ?> + <html> Index: arquivo.php =================================================================== RCS file: /cvsroot/uts/uts/src/www/arquivo.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** arquivo.php 29 Jan 2004 03:03:23 -0000 1.1.1.1 --- arquivo.php 26 Mar 2004 02:09:03 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- } + clearstatcache(); ?> *************** *** 18,25 **** <!-- body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none} ! .tabela { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none } ! .tabelaH { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #666666} .tabelaOn { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #999999} .tabelaOff { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #CCCCCC} --> </style> --- 19,27 ---- <!-- body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none} ! .tabela { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none; color: #000000 } ! .tabelaH { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #666666; color: #FFFFFF} .tabelaOn { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #999999} .tabelaOff { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none ; background-color: #CCCCCC} + a.ph { text-decoration: none; color: #000000 } --> </style> *************** *** 30,90 **** <p><img src="ovlogo.jpg" width="145" height="105"> </p> <p> </p> <table width="70%" border="0" class="tabela"> ! <tr bgcolor="#666666"> <td>Arquivo</td> <td>Tamanho</td> - <td>Ultima Modificação</td> <td>Visualizar</td> <td>Download</td> </tr> ! <tr bgcolor="#CCCCCC"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr bgcolor="#999999"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr bgcolor="#CCCCCC"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr bgcolor="#999999"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr bgcolor="#CCCCCC"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! </tr> ! <tr bgcolor="#999999"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> </tr> ! <tr bgcolor="#CCCCCC"> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> ! <td> </td> </tr> </table> <p> </p> --- 32,87 ---- <p><img src="ovlogo.jpg" width="145" height="105"> </p> <p> </p> + <table width="70%" border="0" class="tabela"> ! <tr bgcolor="#666666" class="tabelaH"> <td>Arquivo</td> <td>Tamanho</td> <td>Visualizar</td> <td>Download</td> </tr> ! <? ! ! $dir = 'imagens'; ! $dh = opendir($dir); ! ! while (false !== ($filename = readdir($dh))) { ! if((strstr($filename, ".fits")) && (strstr($filename, $_SESSION['bf_name']))) ! $files[] = $filename; ! } ! ! if(!count($files)) { ! ! ?> ! <tr class="tabelaOn"> ! <td colspan="5" align="center">Nenhum objeto na lista</td> </tr> ! <? ! ! } else { ! ! for ($i = 0; $i < count($files); $i++) { ! $stat = stat("imagens/" . $filename); ! ! if($i % 2) { ! ! ?> ! <tr class="tabelaOn"> ! <? ! } else { ! ?> ! <tr class="tabelaOff"> ! <? ! } ! ?> ! <td><?=$files[$i]?></td> ! <td><?=$stat['size']?> bytes</td> ! <td align="center"><a class="ph "href="display.php?filename=imagens/<?=$files[$i]?>">:: mostrar ::</a></td> ! <td align="center"><a class="ph "href="download.php?filename=imagens/<?=$files[$i]?>">:: download ::</a></td> </tr> + <? + } + } + ?> + </table> <p> </p> --- NEW FILE: default.png --- (This appears to be a binary file; contents omitted.) Index: apontar.php =================================================================== RCS file: /cvsroot/uts/uts/src/www/apontar.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** apontar.php 29 Jan 2004 03:03:23 -0000 1.1.1.1 --- apontar.php 26 Mar 2004 02:09:03 -0000 1.2 *************** *** 11,15 **** ! $servers = getServers("grus.fsc.ufsc.br"); if(!$servers) { --- 11,15 ---- ! $servers = getServers("octans"); if(!$servers) { *************** *** 19,24 **** $sync = new Syncd(); ! $sync->setInteractive(FALSE); ! $sync->connect('localhost', $servers['SYNCcontrol']); $sync->setStatus("RA", $_GET['ra']); --- 19,24 ---- $sync = new Syncd(); ! $sync->setInteractive(TRUE); ! $sync->connect('octans', $servers['SYNCcontrol']); $sync->setStatus("RA", $_GET['ra']); *************** *** 28,33 **** $sync->setStatus("EXPTIME", $_GET['exp_time']); $sync->setStatus("NEXP", $_GET['num_exp']); ! $sync->setStatus("BFNAME", dirname($_SERVER['SCRIPT_FILENAME']) . "/" . "imagem"); ! $sync->setStatus("INDEX", 0000); $sync->setStatus("OBSERVER", "GUTS Team"); $sync->setStatus("START", "NOW"); --- 28,32 ---- $sync->setStatus("EXPTIME", $_GET['exp_time']); $sync->setStatus("NEXP", $_GET['num_exp']); ! $sync->setStatus("BFNAME", $_SESSION['bf_fullpath']); $sync->setStatus("OBSERVER", "GUTS Team"); $sync->setStatus("START", "NOW"); --- NEW FILE: download.php --- <? session_start(); if(!$_SESSION['user']) { session_destroy(); header("Location: index.php"); } $len = filesize($_GET['filename']); header("Content-type: image/fits"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=" . $_GET['filename']); readfile($_GET['filename']); ?> Index: login.php =================================================================== RCS file: /cvsroot/uts/uts/src/www/login.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** login.php 29 Jan 2004 03:03:26 -0000 1.1.1.1 --- login.php 26 Mar 2004 02:09:03 -0000 1.2 *************** *** 20,26 **** $_SESSION['filter'] = array(); ! $_SESSION['bf_dir'] = dirname($_SERVER['SCRIPT_FILENAME']) . "/imagens/" . $_POST['user'] . "-".strftime("%d%m%Y", time()); - $_SESSION['bf_name'] = "imagem"; $_SESSION['bf_fullpath'] = $_SESSION['bf_dir'] . "/" . $_SESSION['bf_name']; --- 20,26 ---- $_SESSION['filter'] = array(); ! $_SESSION['bf_dir'] = "/home/indus/andre/uts" . "/imagens"; ! $_SESSION['bf_name'] = "imagem-" . $_POST['user'] . "-" . strftime("%d%m%Y", time()); $_SESSION['bf_fullpath'] = $_SESSION['bf_dir'] . "/" . $_SESSION['bf_name']; |